SNMPD Configuration Template

Part of a standard server setup for me includes installing SNMPD for remote monitoring of hosts. A simple SNMPD configuration template can be found below. You will need to change these variables:

  • COM_NAME: This should be the community name that your SNMP poller users when connecting to the host.
  • PREFIX: This should be an allowed prefix that can connect to the SNMP daemon. This accepts IPv4 or IPv6 addresses or networks. If you need to allow multiple addresses and/or networks, you can add additional lines as needed. This configuration goes by default into /etc/snmp/snmpd.conf:
##       sec.name  source          community
### This community is allowed to query locally
com2sec local     localhost        COM_NAME
### This community is allowed to be polled remotely
### As an example to allow polling by the networks 10/8 and 172.16/12 using the community name 0sdgig03tt:
### com2sec mynetwork 10.0.0.0/8      0sdgig03tt
### com2sec mynetwork 172.16.0.0/12   0sdgig03tt
com2sec mynetwork PREFIX           COM_NAME
#
##     group.name sec.model  sec.name
group MyRWGroup  v2c        local
group MyROGroup  v2c        mynetwork
#
#group MyRWGroup  any        otherv3user
#...
#
##           incl/excl subtree                          mask
view all    included  .1                                80
#
#view mib2   included  .iso.org.dod.internet.mgmt.mib-2 fc
#
##                context sec.model sec.level prefix read   write  notif
access MyROGroup ""      v2c       noauth    exact      all    none   none
access MyRWGroup ""      v2c       noauth    exact      all    all    all
#
syslocation My System Location
syscontact Me <my@email.com>
#
disk  /     1000000
disk  /tmp  50000
disk  /home 5000000

After changing the configuration file restart the SNMPD service and you should then be able to poll the server.

Leave a Reply

Your email address will not be published. Required fields are marked *