Installing and using Net-SNMP

You can install Net-SNMP in Centos with the command:

sudo yum install net-snmp-utils net-snmp

In Ubuntu / Debian like this:

sudo apt-get install snmp snmpd

Make a copy of the standard configuration file just in case:

sudo mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.default

Next, for example, in the nano text editor open the configuration (Ctrl+X to exit, y/n to save or cancel changes):

sudo nano /etc/snmp/snmpd.conf

And open access to snmp for localhost and the specified subnet (where public is a community, rocommunity defines read-only access, rwcommunity reads and writes):

rocommunity public  localhost
rocommunity public 192.168.1.0/24

Restart snmpd to apply the configuration changes:

sudo service snmpd restart

Run the test from the local server or the above subnet:

snmpwalk -v 1 -c public 127.0.0.1

See also:
Linux snmp OIDs

Leave a Reply