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.
Installs the Net-SNMP daemon package, service, and configuration. Installs the Net-SNMP trap daemon service and configuration.
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',
],
}
The following parameters are available in the snmp
class.
Data type: Any
An array of addresses, on which snmpd will listen for queries.
Default value: $snmp::params::agentaddress
Data type: Array[String[1]]
An array of addresses, on which snmptrapd will listen to receive incoming SNMP notifications.
Default value: $snmp::params::snmptrapdaddr
Data type: Any
Read-only (RO) community string or array for agent and snmptrap daemon.
Default value: $snmp::params::ro_community
Data type: Any
Read-only (RO) community string or array for IPv6 agent.
Default value: $snmp::params::ro_community6
Data type: Any
Read-write (RW) community string or array agent.
Default value: $snmp::params::rw_community
Data type: Any
Read-write (RW) community string or array for IPv6 agent.
Default value: $snmp::params::rw_community6
Data type: Any
Network that is allowed to RO query the daemon. Can be string or array.
Default value: $snmp::params::ro_network
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
Data type: Any
Network that is allowed to RW query the daemon. Can be string or array.
Default value: $snmp::params::rw_network
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
Data type: Any
Responsible person for the SNMP system.
Default value: $snmp::params::contact
Data type: Any
Location of the SNMP system.
Default value: $snmp::params::location
Data type: Any
Name of the system (hostname).
Default value: $snmp::params::sysname
Data type: Any
For a host system, a good value is 72 (application + end-to-end layers).
Default value: $snmp::params::services
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
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
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
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
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
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
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
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
Data type: Enum['yes','no']
Disable all access control checks.
Default value: $snmp::params::disable_authorization
Data type: Enum['yes','no']
Disable the logging of notifications altogether.
Default value: $snmp::params::do_not_log_traps
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
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
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
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
Data type: Boolean
Whether to install the Net-SNMP client package.
Default value: $snmp::params::manage_client
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
Data type: Enum['present','absent']
Ensure if present or absent.
Default value: $snmp::params::ensure
Data type: Boolean
Upgrade package automatically, if there is a newer version.
Default value: $snmp::params::autoupgrade
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
Data type: Any
Commandline options passed to snmpd via init script.
Default value: $snmp::params::snmpd_options
Data type: Any
Set permissions for the service configuration file.
Default value: $snmp::params::service_config_perms
Data type: Any
Set group ownership for the service configuration file.
Default value: $snmp::params::service_config_dir_group
Data type: Stdlib::Ensure::Service
Ensure if service is running or stopped.
Default value: $snmp::params::service_ensure
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
Data type: Boolean
Start service at boot.
Default value: $snmp::params::service_enable
Data type: Boolean
Service has status command.
Default value: $snmp::params::service_hasstatus
Data type: Boolean
Service has restart command.
Default value: $snmp::params::service_hasrestart
Data type: Any
Commandline options passed to snmptrapd via init script.
Default value: $snmp::params::snmptrapd_options
Data type: Stdlib::Ensure::Service
Ensure if service is running or stopped.
Default value: $snmp::params::trap_service_ensure
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
Data type: Any
Start service at boot.
Default value: $snmp::params::trap_service_enable
Data type: Any
Service has status command.
Default value: $snmp::params::trap_service_hasstatus
Data type: Any
Service has restart command.
Default value: $snmp::params::trap_service_hasrestart
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
Data type: Boolean
Include the master option to enable AgentX registrations.
Default value: $snmp::params::master
Data type: Any
Defines the permissions and ownership of the AgentX Unix Domain socket.
Default value: $snmp::params::agentx_perms
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
Data type: Any
Defines the address the master agent listens at, or the subagent should connect to.
Default value: $snmp::params::agentx_socket
Data type: Integer[0]
Defines the timeout period (NUM seconds) for an AgentX request.
Default value: $snmp::params::agentx_timeout
Data type: Integer[0]
Defines the number of retries for an AgentX request.
Default value: $snmp::params::agentx_retries
Data type: Boolean
Disable com2sec, group, and access in snmpd.conf
Default value: $snmp::params::snmpv2_enable
Data type: String[1]
Default value: $snmp::params::template_snmpd_conf
Data type: String[1]
Default value: $snmp::params::template_snmpd_sysconfig
Data type: String[1]
Default value: $snmp::params::template_snmptrapd
Data type: String[1]
Default value: $snmp::params::template_snmptrapd_sysconfig
Installs the Net-SNMP client package and configuration.
class { 'snmp::client':
snmp_config => [ 'defVersion 2c', 'defCommunity public', ],
}
The following parameters are available in the snmp::client
class.
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
Data type: Enum['present', 'absent']
Ensure if present or absent.
Default value: $snmp::params::ensure
Data type: Boolean
Upgrade package automatically, if there is a newer version.
Default value: $snmp::params::autoupgrade
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
This class handles OS-specific configuration of the snmp module.
Creates a SNMPv3 user with authentication and encryption paswords.
snmp::snmpv3_user { 'myuser':
authtype => 'MD5',
authpass => '1234auth',
privpass => '5678priv',
}
The following parameters are available in the snmp::snmpv3_user
defined type.
Data type: Any
Authentication password for the user.
Data type: Enum['SHA','MD5']
Authentication type for the user. SHA or MD5
Default value: 'SHA'
Data type: Any
Encryption password for the user.
Default value: undef
Data type: Enum['AES','DES']
Encryption type for the user. AES or DES
Default value: 'AES'
Data type: Enum['snmpd','snmptrapd']
Which daemon file in which to write the user. snmpd or snmptrapd
Default value: 'snmpd'