Skip to main content

Linux SNMP

Overview​

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged in a Linux distribution.

Plugin-pack assets​

Monitored objects​

This Plugin-Pack provides assets to monitor all types of Linux based systems with a SNMP server enabled:

  • Centos
  • Redhat
  • Debian
  • Ubuntu
  • ...

Discovery rules​

Rule nameDescription
App-Protocol-SNMP-HostDiscoveryDiscover Linux box based upon Sysdesc value by scanning a subnet

Collected Metrics​

In addition to modes and metrics described here, it is also possible to monitor the following indicators:

  • CPU detailed: Advanced monitoring of the CPU (User, Nice, Idle, ...)
  • Process state: State of one or several processes running on the server. It's also possible to check CPU and Memory utilization of a specific process.
  • TCP connection: Check number of TCP connections. [State:listen, closeWait, ...][type: ipv4, dns, ...] [service]
  • Uptime: Elapsed time since the last reboot
Metric nameDescription
cpu.utilization.percentageCPU utilization. Unit : %
core.cpu.utilization.percentagePer Core CPU utilization. Unit : %

Prerequisites​

To monitor a Linux based device, the SNMP service must be installed and configured. Most of Linux distributions rely on net-snmp.

net-snmp server configuration​

A detailed documentation on how-to configure SNMP is available in the documentation of each Linux distribution.

Find below a minimalist snmpd.conf / net-snmp config file (replace my-snmp-community by the relevant value).

com2sec notConfigUser  default       my-snmp-community
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view centreon included .1.3.6.1
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
access notConfigGroup "" any noauth exact centreon none none
access notConfigGroup "" any noauth exact systemview none none
includeAllDisks 10%

The SNMP server must be restarted each time the configuration is modified. Also make sure that the SNMP server is configured to automatically start on boot.

Network flow​

The target server must be reachable from the Centreon Poller on the UDP/161 SNMP port.

Installation​

  1. Install the Linux SNMP Centreon Plugin on every poller expected to monitor the devices:
yum install centreon-plugin-Operatingsystems-Linux-Snmp
  1. Install the 'OS-Linux-SNMP' Centreon Plugin-Pack on the "Configuration > Plugin packs > Manager" page

Host configuration​

When adding a new Linux host into Centreon, make sure to fill the Snmp Version and Snmp Community fields.

When using snmp v3, set extra SNMP parameters in the SNMPEXTRAOPTIONS macro.

ObligatoireNomDescription
SNMPEXTRAOPTIONSConfigure your own SNMPv3 credentials combo

FAQ​

How do I run my plugin through the CLI and what do the main parameters stand for ?​

Once you've installed the plugin, you can test it logging with centreon-engine user:

/usr/lib/centreon/plugins//centreon_linux_snmp.pl \
--plugin=os::linux::snmp::plugin \
--mode=cpu \
--hostname=10.30.2.114 \
--snmp-version='2c' \
--snmp-community='linux_ro' \
--verbose

This check monitors CPU utilization (--mode=cpu) of a Linux server. The server's IP address is 10.30.2.114 (--hostname=10.30.2.114). SNMP version 2 is used and the community is linux_ro (--snmp-community='linux_ro').

All available modes with the plugin can be displayed with:

/usr/lib/centreon/plugins//centreon_linux_snmp.pl \
--plugin=os::linux::snmp::plugin \
--list-mode

The available options for a mode can be displayed using the --help parameter:

/usr/lib/centreon/plugins//centreon_linux_snmp.pl \
--plugin=os::linux::snmp::plugin \
--mode=cpu \
--help

UNKNOWN: SNMP GET Request : Timeout​

If you get this message, you're probably facing one of theses issues:

  • Your SNMP server isn't started or misconfigured
  • An external device is blocking your request (firewall, ...)

UNKNOWN: SNMP GET Request : Cant get a single value.​

This message generally means that SNMP privileges are not wide enough for the mode/plugin to work properly.

If it only happens on the Inodes mode, make sure the following directive is set in the SNMP server configuration file:

includeAllDisks 10%