SNMP Configuration on LINUX/CENTOS

To monitor Linux/Centos host systems with Nagios using SNMP you have to install net snmp packages that are used to communicate between nagios server and linux host systems.  SNMP is associate degree methodology of observance. Network devices, servers are commonly preferred to put in with dedicated agents on the right track machines.
First, you have to install the net-snmp package on the Linux/Centos machine. Login to the Linux machine as root user and configure snmp on linux by following the step-by-step process. Installation and configuration of SNMP on linux/Centos:

Step 1 : Installation of net snmp.
Step 2 : Edit SNMP configuration file.
Step 3 : Edit firewall setting.
Step 4 : Check communication between server and host.

To start the configuration of snmp on linux machine follow the process:

Step 1 : Install net-snmp packages

#yum install net-snmp

Step 2 : Edit snmp.conf file in /etc/snmp/

#cd /etc/snmp

#vi snmpd.conf

Add these commands at the end of the file:

com2sec local     localhost           solutions
com2sec local           solutions
group MyRWGroup v1         local
group MyRWGroup v2c        local
group MyRWGroup usm        local
view all    included  .1                               80
access MyRWGroup “”      any       noauth    exact  all    all    none
pass . /usr/bin/ucd5820stat

save and restart snmpd services

#/etc/init.d/snmpd restart

Step 3 : Edit your firewall setting on host linux machine

#iptables –IINPUT –p udp –destination-port 161 –j ACCEPT

#/etc/init.d/iptables save

Some linux machines may also need to add ipadress of the nagios server to allow the host file located at (/etc/hosts.allow)

Start snmp daemon services

#chkconfig snmpd on

#/etc/init.d/snmpd start

Step 4 : Now login on the linux server (.i.e.nagios server) and check snmp configuration is completed correctly.
Check the snmp communication between nagios server and linux host

#cd /usr/local/nagios/libexec

Syntax to check services:

Syntax:- ./check_ping -H <host_address> -w <wrta>,<wpl>%% -c <crta>,<cpl>%% [-p packets] [-t timeout] [-L]
Syntax:-./check_load -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15
Syntax:- ./check_imap -H host -p port [-w warn_time] [-c crit_time] [-s send] [-e expect] [-W wait] [-t to_sec] [-v]

./check_ping -H -w 2,7%% -c 10,20%% -t 20

./check_load -w 30,60%%  -c 40,80%%

./check_imap -H -p 22 -w 10 -c 3 -s 5 -e 6 -W 8 -t 60

For more detail you can watch video and also subscribe for more Videos :


Leave a Reply

Your email address will not be published. Required fields are marked *

87 − = 81