Enabling SNMP On CentOS / RHEL

Setting up SNMP (Simple Network Management Protocol) on a CentOS machine is a very quick and easy process and I often forget so here’s a quickie on how.

Install the SNMP daemon by running the following command:

yum install net-snmp

Once SNMP is installed you want to install the configuration utility. I always forget this. It makes it easy to configure SNMP for both the community string,  SNMP version and basic security.

yum install net-snmp-utils

Once the configuration tool is installed, run it:

snmpconf -g basic_setup

As you run through the configuration utility it will present you with many options. Depending on how you have your remote monitoring setup (Cacti/Nagios) you will need to choose the options that work for you.

Once done, you will need to copy the configuration file to the correct directory. In most cases it will need to be moved from “/root/snmpd.conf” to “/etc/snmp/snmpd.conf” – You will need to overwrite the existing conf file in the /etc/snmp/ directory.

mv /root/snmpd.conf /etc/snmp/

Once the configuration file has been moved over you can restart SNMP.

service snmpd restart

The last thing you need to do is have SNMP start at boot time. If you do not run the following command you will need to manually start SNMP after a reboot.

chkconfig snmpd on

At this point you should be set. If for some reason you are running the firewall will need to open port 161 for UDP & TCP traffic to allow SNMP to be accessed remotely.

Author: Helicopter Jeff

I'm a vinyl decal cutting and designing, Astrophotography and general photography capturing, RC helicopter/quad copter pilot, Arduino and Raspberry Pi hardware/software developer, network, scripting and troubleshooting ninja living in the metro NY area. I am passionate about my hobbies so much I do them for a living. There's nothing better than getting paid to do what you love.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s