Skip to content

Latest commit

 

History

History
660 lines (353 loc) · 13 KB

REFERENCE.md

File metadata and controls

660 lines (353 loc) · 13 KB

Reference

Table of Contents

Classes

  • snmp: Installs the Net-SNMP daemon package, service, and configuration. Installs the Net-SNMP trap daemon service and configuration.
  • snmp::client: Installs the Net-SNMP client package and configuration.
  • snmp::params: This class handles OS-specific configuration of the snmp module.

Defined types

  • snmp::snmpv3_user: Creates a SNMPv3 user with authentication and encryption paswords.

Classes

snmp

Installs the Net-SNMP daemon package, service, and configuration. Installs the Net-SNMP trap daemon service and configuration.

Examples

class { 'snmp':
  com2sec       => [ 'notConfigUser default PassW0rd' ],
  manage_client => true,
}

# Only configure and run the snmptrap daemon:
class { 'snmp':
  ro_community        => 'SeCrEt',
  service_ensure      => 'stopped',
  trap_service_ensure => 'running',
  trap_handlers       => [
    'default /usr/bin/perl /usr/bin/traptoemail [email protected]',
    'IF-MIB::linkDown /home/nba/bin/traps down',
  ],
}

Parameters

The following parameters are available in the snmp class.

agentaddress

Data type: Any

An array of addresses, on which snmpd will listen for queries.

Default value: $snmp::params::agentaddress

snmptrapdaddr

Data type: Array[String[1]]

An array of addresses, on which snmptrapd will listen to receive incoming SNMP notifications.

Default value: $snmp::params::snmptrapdaddr

ro_community

Data type: Any

Read-only (RO) community string or array for agent and snmptrap daemon.

Default value: $snmp::params::ro_community

ro_community6

Data type: Any

Read-only (RO) community string or array for IPv6 agent.

Default value: $snmp::params::ro_community6

rw_community

Data type: Any

Read-write (RW) community string or array agent.

Default value: $snmp::params::rw_community

rw_community6

Data type: Any

Read-write (RW) community string or array for IPv6 agent.

Default value: $snmp::params::rw_community6

ro_network

Data type: Any

Network that is allowed to RO query the daemon. Can be string or array.

Default value: $snmp::params::ro_network

ro_network6

Data type: Any

Network that is allowed to RO query the daemon via IPv6. Can be string or array.

Default value: $snmp::params::ro_network6

rw_network

Data type: Any

Network that is allowed to RW query the daemon. Can be string or array.

Default value: $snmp::params::rw_network

rw_network6

Data type: Any

Network that is allowed to RW query the daemon via IPv6. Can be string or array.

Default value: $snmp::params::rw_network6

contact

Data type: Any

Responsible person for the SNMP system.

Default value: $snmp::params::contact

location

Data type: Any

Location of the SNMP system.

Default value: $snmp::params::location

sysname

Data type: Any

Name of the system (hostname).

Default value: $snmp::params::sysname

services

Data type: Any

For a host system, a good value is 72 (application + end-to-end layers).

Default value: $snmp::params::services

com2sec

Data type: Array[String[1]]

An array of VACM com2sec mappings. Must provide SECNAME, SOURCE and COMMUNITY. See http://www.net-snmp.org/docs/man/snmpd.conf.html#lbAL for details.

Default value: $snmp::params::com2sec

com2sec6

Data type: Array[String[1]]

An array of VACM com2sec6 mappings. Must provide SECNAME, SOURCE and COMMUNITY. See http://www.net-snmp.org/docs/man/snmpd.conf.html#lbAL for details.

Default value: $snmp::params::com2sec6

groups

Data type: Array[String[1]]

An array of VACM group mappings. Must provide GROUP, <v1|v2c|usm|tsm|ksm>, SECNAME. See http://www.net-snmp.org/docs/man/snmpd.conf.html#lbAL for details.

Default value: $snmp::params::groups

views

Data type: Array[String[1]]

An array of views that are available to query. Must provide VNAME, TYPE, OID, and [MASK]. See http://www.net-snmp.org/docs/man/snmpd.conf.html#lbAL for details.

Default value: $snmp::params::views

accesses

Data type: Array[String[1]]

An array of access controls that are available to query. Must provide GROUP, CONTEXT, <any|v1|v2c|usm|tsm|ksm>, LEVEL, PREFX, READ, WRITE, and NOTIFY. See http://www.net-snmp.org/docs/man/snmpd.conf.html#lbAL for details.

Default value: $snmp::params::accesses

dlmod

Data type: Array[String[1]]

Array of dlmod lines to add to the snmpd.conf file. Must provide NAME and PATH (ex. "cmaX /usr/lib64/libcmaX64.so"). See http://www.net-snmp.org/docs/man/snmpd.conf.html#lbBD for details.

Default value: $snmp::params::dlmod

extends

Data type: Array[String[1]]

Array of extend lines to add to the snmpd.conf file. Must provide NAME, PROG and ARG. See http://www.net-snmp.org/docs/man/snmpd.conf.html#lbBA for details.

Default value: $snmp::params::extends

snmpd_config

Data type: Array[String]

Safety valve. Array of lines to add to the snmpd.conf file. See http://www.net-snmp.org/docs/man/snmpd.conf.html for all options.

Default value: $snmp::params::snmpd_config

disable_authorization

Data type: Enum['yes','no']

Disable all access control checks.

Default value: $snmp::params::disable_authorization

do_not_log_traps

Data type: Enum['yes','no']

Disable the logging of notifications altogether.

Default value: $snmp::params::do_not_log_traps

do_not_log_tcpwrappers

Data type: Enum['yes','no']

Disable the logging of tcpwrappers messages, e.g. "Connection from UDP: " messages in syslog.

Default value: $snmp::params::do_not_log_tcpwrappers

trap_handlers

Data type: Array[String[1]]

An array of programs to invoke on receipt of traps. Must provide OID and PROGRAM (ex. "IF-MIB::linkDown /bin/traps down"). See http://www.net-snmp.org/docs/man/snmptrapd.conf.html#lbAI for details.

Default value: $snmp::params::trap_handlers

trap_forwards

Data type: Array[String[1]]

An array of destinations to send to on receipt of traps. Must provide OID and DESTINATION (ex. "IF-MIB::linkUp udp:1.2.3.5:162"). See http://www.net-snmp.org/docs/man/snmptrapd.conf.html#lbAI for details.

Default value: $snmp::params::trap_forwards

snmptrapd_config

Data type: Array[String]

Safety valve. Array of lines to add to the snmptrapd.conf file. See http://www.net-snmp.org/docs/man/snmptrapd.conf.html for all options.

Default value: $snmp::params::snmptrapd_config

manage_client

Data type: Boolean

Whether to install the Net-SNMP client package.

Default value: $snmp::params::manage_client

snmp_config

Data type: Any

Safety valve. Array of lines to add to the client's global snmp.conf file. See http://www.net-snmp.org/docs/man/snmp.conf.html for all options.

Default value: $snmp::params::snmp_config

ensure

Data type: Enum['present','absent']

Ensure if present or absent.

Default value: $snmp::params::ensure

autoupgrade

Data type: Boolean

Upgrade package automatically, if there is a newer version.

Default value: $snmp::params::autoupgrade

package_name

Data type: Any

Name of the package. Only set this if your platform is not supported or you know what you are doing.

Default value: $snmp::params::package_name

snmpd_options

Data type: Any

Commandline options passed to snmpd via init script.

Default value: $snmp::params::snmpd_options

service_config_perms

Data type: Any

Set permissions for the service configuration file.

Default value: $snmp::params::service_config_perms

service_config_dir_group

Data type: Any

Set group ownership for the service configuration file.

Default value: $snmp::params::service_config_dir_group

service_ensure

Data type: Stdlib::Ensure::Service

Ensure if service is running or stopped.

Default value: $snmp::params::service_ensure

service_name

Data type: Any

Name of SNMP service. Only set this if your platform is not supported or you know what you are doing.

Default value: $snmp::params::service_name

service_enable

Data type: Boolean

Start service at boot.

Default value: $snmp::params::service_enable

service_hasstatus

Data type: Boolean

Service has status command.

Default value: $snmp::params::service_hasstatus

service_hasrestart

Data type: Boolean

Service has restart command.

Default value: $snmp::params::service_hasrestart

snmptrapd_options

Data type: Any

Commandline options passed to snmptrapd via init script.

Default value: $snmp::params::snmptrapd_options

trap_service_ensure

Data type: Stdlib::Ensure::Service

Ensure if service is running or stopped.

Default value: $snmp::params::trap_service_ensure

trap_service_name

Data type: Any

Name of SNMP service Only set this if your platform is not supported or you know what you are doing.

Default value: $snmp::params::trap_service_name

trap_service_enable

Data type: Any

Start service at boot.

Default value: $snmp::params::trap_service_enable

trap_service_hasstatus

Data type: Any

Service has status command.

Default value: $snmp::params::trap_service_hasstatus

trap_service_hasrestart

Data type: Any

Service has restart command.

Default value: $snmp::params::trap_service_hasrestart

openmanage_enable

Data type: Boolean

Adds the smuxpeer directive to the snmpd.conf file to allow net-snmp to talk with Dell's OpenManage

Default value: $snmp::params::openmanage_enable

master

Data type: Boolean

Include the master option to enable AgentX registrations.

Default value: $snmp::params::master

agentx_perms

Data type: Any

Defines the permissions and ownership of the AgentX Unix Domain socket.

Default value: $snmp::params::agentx_perms

agentx_ping_interval

Data type: Any

This will make the subagent try and reconnect every NUM seconds to the master if it ever becomes (or starts) disconnected.

Default value: $snmp::params::agentx_ping_interval

agentx_socket

Data type: Any

Defines the address the master agent listens at, or the subagent should connect to.

Default value: $snmp::params::agentx_socket

agentx_timeout

Data type: Integer[0]

Defines the timeout period (NUM seconds) for an AgentX request.

Default value: $snmp::params::agentx_timeout

agentx_retries

Data type: Integer[0]

Defines the number of retries for an AgentX request.

Default value: $snmp::params::agentx_retries

snmpv2_enable

Data type: Boolean

Disable com2sec, group, and access in snmpd.conf

Default value: $snmp::params::snmpv2_enable

template_snmpd_conf

Data type: String[1]

Default value: $snmp::params::template_snmpd_conf

template_snmpd_sysconfig

Data type: String[1]

Default value: $snmp::params::template_snmpd_sysconfig

template_snmptrapd

Data type: String[1]

Default value: $snmp::params::template_snmptrapd

template_snmptrapd_sysconfig

Data type: String[1]

Default value: $snmp::params::template_snmptrapd_sysconfig

snmp::client

Installs the Net-SNMP client package and configuration.

Examples

class { 'snmp::client':
  snmp_config => [ 'defVersion 2c', 'defCommunity public', ],
}

Parameters

The following parameters are available in the snmp::client class.

snmp_config

Data type: Any

Array of lines to add to the client's global snmp.conf file. See http://www.net-snmp.org/docs/man/snmp.conf.html for all options.

Default value: $snmp::params::snmp_config

ensure

Data type: Enum['present', 'absent']

Ensure if present or absent.

Default value: $snmp::params::ensure

autoupgrade

Data type: Boolean

Upgrade package automatically, if there is a newer version.

Default value: $snmp::params::autoupgrade

package_name

Data type: Any

Name of the package. Only set this if your platform is not supported or you know what you are doing.

Default value: $snmp::params::client_package_name

snmp::params

This class handles OS-specific configuration of the snmp module.

Defined types

snmp::snmpv3_user

Creates a SNMPv3 user with authentication and encryption paswords.

Examples

snmp::snmpv3_user { 'myuser':
  authtype => 'MD5',
  authpass => '1234auth',
  privpass => '5678priv',
}

Parameters

The following parameters are available in the snmp::snmpv3_user defined type.

authpass

Data type: Any

Authentication password for the user.

authtype

Data type: Enum['SHA','MD5']

Authentication type for the user. SHA or MD5

Default value: 'SHA'

privpass

Data type: Any

Encryption password for the user.

Default value: undef

privtype

Data type: Enum['AES','DES']

Encryption type for the user. AES or DES

Default value: 'AES'

daemon

Data type: Enum['snmpd','snmptrapd']

Which daemon file in which to write the user. snmpd or snmptrapd

Default value: 'snmpd'