Unix-Linux

Install and configure SNMP on Linux

Posted On Tháng Ba 29, 2017 at 6:45 chiều by / Chức năng bình luận bị tắt ở Install and configure SNMP on Linux


Install and configure SNMP on RHEL or CentOS
yum -y install net-snmp
yum -y install net-snmp-utils


vi /etc/snmp/snmpd.conf
rocommunity public xxx.xxx.xxx.xxx
xxx.xxx.xxx.xxx is ip monitor tool

service snmpd restart
chkconfig snmpd on

SNMP Monitoring on Ubuntu
$ sudo apt-get install snmpd

Create a backup file of snmpd.conf original file that we will edit later

$ sudo mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.ori

Create the new snmpd.conf file

$ sudo vim /etc/snmp/snmpd.conf

Add the file with these lines

rocommunity public
syslocation “Your Location”
syscontact admin@domain.com

Then edit the /etc/default/snmpd file

$ sudo vim /etc/default/snmpd

Disable this line below by adding # in front of the line

#SNMPDOPTS=’-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid’

And add a new line

SNMPDOPTS=’-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf’

Restart the SNMPD service

$ sudo /etc/init.d/snmpd restart
* Restarting network management services