Thursday, January 2, 2014

What is SNMP? and its Configuration ?


SNMP :-   Simple Network Management  Protocol.

SNMP is useful to figure out whats exactly happening from  Device on Network.

SNMP is a agent which runs on Device and It will helps to monitor hardware/memory/CPU status in System . It will gather the information and sent to to management console .
port number for SNMP is 161.

[root@linuxtechnotes ~]# netstat -aunt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:199               0.0.0.0:*                   LISTEN
tcp        0      0 192.168.150.129:54189       23.59.189.83:80             ESTABLISHED
tcp        1      1 192.168.150.129:54188       23.59.189.83:80             LAST_ACK
tcp        0      0 192.168.150.129:22          192.168.150.1:53360         ESTABLISHED
tcp        0      0 :::22                       :::*                        LISTEN
tcp        0      0 ::1:631                     :::*                        LISTEN
tcp        0      0 ::1:25                      :::*                        LISTEN
udp        0      0 0.0.0.0:161                 0.0.0.0:*
udp        0      0 0.0.0.0:68                  0.0.0.0:*
udp        0      0 0.0.0.0:631                 0.0.0.0:*
[root@linuxtechnotes ~]#



Configuration file  :- /etc/snmp/snmpd.conf

what is the debug file for SNMP ?

for 5.x Linux servers its :- /etc/sysconfig/snmpd.options
For 6x :-   /etc/sysconfig/snmpd

Below you can see default debug file for 6x Linux servers.

[root@linuxtechnotes ~]# cat /etc/sysconfig/snmpd
# snmpd command line options
# OPTIONS="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid"
[root@linuxtechnotes ~]#


Incase if you notice lot of udp connection in syslog and if you want to suppress, try to change the debug level to 5 and restart the snmpd deamon.


[root@linuxtechnotes ~]# cat /etc/sysconfig/snmpd
# snmpd command line options
OPTIONS="-LS0-5d -Lf /dev/null -p /var/run/snmpd.pid"
[root@linuxtechnotes ~]#
[root@linuxtechnotes ~]# service snmpd restart
Stopping snmpd:                                            [  OK  ]
Starting snmpd:                                            [  OK  ]
[root@linuxtechnotes ~]#