PDA

View Full Version : Installation and Configuration of Net-SNMP Agent For Traverse



CJ Goldsmith
December 1 2009, 08:23 PM
Below is a guide for installing / configuring the Net-SNMP agent on a number of Linux environments (Fedora Core / CentOS / Ubuntu).

Fedora Core & CentOS Installations:

First you will need to determine if you have the net-snmp agent installed, the easiest way to accomplish this is to search for the snmpd.conf configuration file or the demon executable file.

On my system these files are located in the following locations:

/etc/snmp/snmpd.conf
/etc/init.d/snmpd

If you do not currently have these files installed, you will need to install the Net-SNMP package on your system first.

We are going to install using the yum package manager, simply enter the following command from a command line:


sudo yum install net-snmp

Let the yum manager install the required package and any dependencies.

Ubuntu Installation

Again you are going to want to determine if the net-snmp package has already been installed on your system. The easiest way to tell is to locate the snmpd.conf and snmpd files on your file system. Again for me they are located at the following locations:


/etc/snmp/snmpd.conf
/etc/init.d/snmpd

If the Net-SNMP package has not yet been installed on your system you can use the APT package manager to install it with the following command:


sudo apt-get install libsnmp-base snmp snmpd

Let the APT package manager install all packages and any dependencies.

Editing the snmpd.conf File

Once you have the snmpd agent installed on your system you are going to need to edit the snmpd config file so that it can be used with Traverse for monitoring.

There are 2 options here for versions 1 and 2c (snmp versions).

You can circumvent alot of the configuration options by adding the following line to the top of the snmpd.conf file:


rocommunity public .1.3.6.1

NOTE: it has been observed that in some cases (Solaris) the rocommunity declaration cannot be used in conjunction with any other declaration types. To be safe you may want to move your current snmpd.conf file to a backup location (.bak) and create a new file with only the previous line in it.

If you want to conform to the conventions of the sample configuration file you will need to make a small adjustment to get the agent to respond to many of the host OID's that Traverse is going to require in order to properly monitor the host machine.

Below are relevant snippets from the sample configuration file that currently comes with the Net-SNMP package:


com2sec notConfigUser default public

group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser

view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1

access notConfigGroup "" any noauth exact systemview none none

The only required change is to add a new view directive with the following OID root:


view systemview included .1.3.6.1

Starting, Stopping, Restarting the SNMP Agent
You can use the demon executable to manually start, stop, restart, and check the status of the process:


sudo /etc/init.d/snmpd stop
sudo /etc/init.d/snmpd start
sudo /etc/init.d/snmpd restart
sudo /etc/init.d/snmpd status

You will probably want to add the snmpd demon process to the startup script for run levels 1, 2, 3, and 5. You can accomplish this by using chkconfig:


sudo chkconfig --add snmpd
sudo chkconfig --levels 1235 snmpd on
chkconfig --add snmpd

This will start the net-snmpd agent in the event of a server reboot (expected or otherwise).

Further Reading:

If you would like to gain an in depth understanding the Net-SNMP agent configuration files, I encourage you to read the man page:

man snmpd.conf

There are also a number of resources available at the main project webpage http://net-snmp.org.