How to install snmp in centos/debian

In centos

yum install net-snmp-utils

In debian

apt-get install snmpd

Take a Backup of Original Configuration file and Create a new one

cd /etc/snmp
mv snmp.conf snmp.bk
mcedit snmp.conf

Create a new config file from scratch

agentAddress udp:192.0.0.xxx:161
rocommunity  public 192.0.0.0/24
syslocation  "MysqlServer, unit1"

Now Restart the snmpd server

In Centos

/etc/init.d/snmpd start

In Debian

 /etc/init.d/snmpd start

Check if snmp server is running or not (From the server itself)

 pgrep snmpd
19946
snmpwalk -v1 -cpublic 192.0.0.ip-of-server

Leave a Reply

*