Enabling SNMP On Cent OS / RHEL

Author Topic: Enabling SNMP On Cent OS / RHEL  (Read 2111 times)


  • Guest
Enabling SNMP On Cent OS / RHEL
« on: April 20, 2013, 11:58:45 PM »
Enabling SNMP On Cent OS / RHEL

Setting up SNMP (Simple Network Management Protocol) on a CentOS machine is a very quick and easy process.
First we will install SNMP itself by running the following command:

Code: [Select]
yum install net-snmp
Once you have SNMP installed we will want to install the configuration utility for SNMP. The configuration utility allows you to easily configure SNMP for both the community string, SNMP version and basic security.

Code: [Select]
yum install net-snmp-utils
Once you have the configuration tool installed you will be ready to run it:

Code: [Select]
snmpconf -g basic_setup
As you run through the configuration utility it will present you with many options; depending on how you have your monitoring setup you will need to choose the options that work for you.

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

Command to do the above:

Code: [Select]
mv /root/snmpd.conf /etc/snmp/
Once you have moved your configuration file over you will be ready to restart SNMP.

Code: [Select]
service snmpd restart
The last thing you may want to do (optional) is to have SNMP start with the server at boot time. If you do not run the following command you will need to manually start SNMP after a reboot.

Code: [Select]
chkconfig snmpd on
At this point you should be set to go, however if you are running a firewall on the server you will need to open port 161 for UDP & TCP traffic to allow SNMP to be accessed from your remote monitor.

ref: http://www.servernoobs.com/enabling-snmp-on-centos-rhel/