How do I enable SNMP on a CentOS Linux host so that I can monitor system metrics (CPU, memory, diskspace) with EventSentry?

Article ID: 282
Category: Heartbeat Monitoring
Applies to: All Versions
Updated: 2019-09-04

Run the following commands in the terminal:

  1. Update all packages: sudo yum check-update
  2. Install SNMP: yum -y install net-snmp

Next we need to configure multiple entries in the snmpd.conf, there is a manual page located here (link to http://net-snmp.sourceforge.net/docs/man/snmpd.conf.html) which contains information for additional configuration options.

  1. (Optional) Install Nano: sudo yum -y install nano
  2. Edit snmpd.conf with text editor of your choice, we will be using nano: sudo nano /etc/snmp/snmpd.conf
  3. Configure com2sec: com2sec ESUser 127.0.0.1 public
    -Change "public" to your community name
  4. com2sec ESUser 0.0.0.0/0 public
    -Change "public" to your community name
    -Change the IP to your server or network
  5. Configure group: group ESGroup v1 ESUser
  6. group ESGroup v2c ESUser
  7. Configure view: view all included .1
  8. Configure access: access ESGroup "" any noauth exact all none none
  9. Restart the SNMPD service: sudo systemctl restart snmpd
  10. Configure SNMPD to start on boot: chkconfig snmpd on

Example Config:

com2sec ESUser 127.0.0.1 NixKB
com2sec ESUser 0.0.0.0/0 NixKB
group ESGroup v1 ESUser
group ESGroup v2c ESUser
view all included .1
access ESGroup "" any noauth exact all none none

Note: It is recommend to setup firewall rules in order to allow only authorized IP ranges to connect to the SNMP daemon.