All HowTo's Linux Redhat, Fedora and CentOS Linux

Nagios Part 2 | Configure an SNMP CentOS 7 Client

This is a multi-part series of Nagios articles all focused on configuring a complete Nagios monitored network. Find all related articles here.

I’ve written about this before but times have changed and CentOS 7 is slightly different to CentOS 6. This article explains how to configure a very basic (minimal) SNMPd server on CentOS 7. When it comes to security and SNMP, make sure you change the community name from “public” to something secret and change the firewall to reject all but approved sources and destinations.

Install the packages:

yum install net-snmp*

Update the “/etc/snmp/snmpd.conf” file to look like the following. Perhaps backup your existing config file first. Just in case.

com2sec AgixUser      default         public
group   ConfigGroup     v2c             AgixUser
view    AllView         included        .1
access  ConfigGroup     ""      any     noauth  exact   AllView      none    none

Where “public” should be changed to something random and hard to guess.

Restart the SNMPd service:

systemctl restart snmpd

Open the firewall port “udp/161”.

-A INPUT -p udp --dport 161 -s 1.2.3.4/32 -j ACCEPT

Where “1.2.3.4” is the IP address of the Nagios server or whatever central server you’re using.

And you’re done. Test it with the following command. You should get plenty of output.

snmpwalk -v2c -c public 192.168.1.2

Where “192.168.1.2” is the IP address of the client (the machine you want to monitor).

Leave a Reply

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