User Tools

Site Tools


archive:centos_install_snmp

Setting up SNMP on CentOS

Enable simple SNMP read only access to all mibs

Install SNMP

yum install net-snmp net-snmp-utils

Enable snmp on reboot

systemctl enable snmpd

SNMP configuration

We will start with the smallest config file possible which will enable read only access to all mibs available for a single community.

First move the shipped config file to another location

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

Now reate a new empty config file.

touch /etc/snmp/snmpd.conf

In the configuration vi we just created we only need 1 line. So Edit the config file

vi /etc/snmp/snmpd.conf

And insert the following

rocommunity cylkimecdook
skipNFSInHostResources true

SNMP minimize logging

Snmp will do a huge amount of logging every time you poll, if you poll every 3 mins this can result in quite some log. We can reduce it like this.

vi /etc/sysconfig/snmpd

Add the following line

OPTIONS="-LS0-3d"
systemctl restart snmpd

Local Test

You can test if SNMP is working by doing a local snmpwalk

snmpwalk -v 2c -c password -O e 127.0.0.1

You should get an output from SNMP with all the mibs available.

archive/centos_install_snmp.txt · Last modified: 24/11/2023 12:40 by Allan