SNMP on linux

 

Gather information

How to determine where to find or create the configuration file. The following command lists the snmp search path.

snmpd -Dread_config -H 2>&1 | grep "config path" | sort -u

 

How to check for existing configuration files.

snmpd -Dread_config -H 2>&1 | grep "Reading" | sort -u

 

To add comments to an existing uncommented snmpd.conf use the command snmpconf as follows.

cd /usr/local/share
snmpconf -R /usr/local/share/snmp/snmpd.conf -a -f snmpd.conf

 

To list all the recognised directives available for the snmpd.conf file use the snmpd command as follows.

snmpd -H

This command will also check the current snmpd.conf file for errors.

 

To show the version information for the agent use the snmpd -v command as follows.

snmpd -v
NET-SNMP version:  5.4.1.2
Web:               http://www.net-snmp.org/
Email:             net-snmp-coders@lists.sourceforge.net

 

Configuration

To help configure the basic snmpd options use the perl script snmpconf. This is a question and answer setup script that is fairly straight forward to use, however knowing the answers may not be.

To help be more specific with the configuration file setup, groups have been created that can be chosen at the command line.

To view the groups use the -G option as follows.

snmpconf -G
Known GROUPs of tokens:

  system_setup
  basic_setup
  monitoring_services
  access_control
  trapsinks

 

To configure the basic settings use the -g basic_setup option as follows.

snmpconf -g basic_setup