Configure SNMP on Linux Ubuntu and Redhat

Configure SNMP on Linux Ubuntu and Redhat

Configure SNMP on Debian or Ubuntu

To install SNMP agent (snmpd) on a Debian-based system, run the following command:

apt-get install snmpd

Then edit its configuration of /etc/snmp/snmpd.conf file.

#  Listen for connections from the local system only
agentAddress udp:161
#rocommunity public  localhost
rocommunity ReadOnlyPassw  default    -V systemonly
#sysLocation    Sitting on the Dock of the Bay
#sysContact     Me <[email protected]>

Save the config file and restart snmpd.

root@server:~# service snmpd restart

Configure SNMP on RHEL or CentOS

To install SNMP toolson RHEL based systems run the following command:

yum install net-snmp net-snmp-utils

Then edit /etc/snmp/snmpd.conf file.

Restart service and add to startup:

root@server:~# service snmpd restart
root@server:~# chkconfig snmpd on

Testing SNMP

SNPM can be tested with snmpwalk command:

[root@localhost ~]# snmpwalk -c public  localhost -v1

Example output:

snmp

SNMP v3

SNMP v3 can be tested with next example command:

snmpwalk -u snmpv3user -A snmpv3pass -a MD5 -l authnoPriv 127.0.0.1 -v3

 

arstech

Leave a Reply