Menu Close

How to configure SNMP client on Linux server (Debian like)

The article describes just the simplest running configuration and how to run SNMPd agent on Linux OS.

 

Firstly, we need to install SNMP deamon

apt-get install snmpd

Then backup config file and create new

mv /etc/snmp/snmpd.conf  /etc/snmp/snmpd.conf.orig
touch /etc/snmp/snmpd.conf

Write basic information into the new /etc/snmp/snmpd.conf file

rocommunity  public_string
syslocation  Server room
syscontact  admin@email.com

Note: the file have to be precisely named snmpd.conf, other name, for example snmp.conf does not work

Then edit /etc/default/snmpd for new configuration file and set listen on all interfaces

Change line from:

# snmpd options (use syslog, close stdin/out/err).
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'

To:

# snmpd options (use syslog, close stdin/out/err).
#SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'

As a last step, restart SNMP daemon:

/etc/init.d/snmpd restart
Rate this post

Leave a Reply

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.