Monitoring a Linux server with SNMP
In this tutorial, we're assuming that your Centreon platform is installed and running well, and that you have at least a Centreon IT 100 Edition that provides Centreon Plugin Packs (your license is already set up).
On the Linux server you want to monitor
The first step is to activate and configure an SNMP agent on your monitored host. Please refer to the documentation of your Linux distribution to know how to configure the SNMP agent.
Find below a minimalist snmpd.conf/net-snmp configuration file:
- replace agentaddress line by the appropriate address of the interface which snmpd listens on
- replace my-snmp-community by the correct value for your environment.
- Add the line view centreon included .188.8.131.52 to have access to all information in the MIB required by the plugin
# sec.name source community
com2sec notConfigUser default my-snmp-community
# Second, map the security name into a group name:
# groupName securityModel securityName
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
# Third, create a view for us to let the group have rights to:
# Make at least snmpwalk -v 1 localhost -c public system fast again.
# name incl/excl subtree mask(optional)
view centreon included .184.108.40.206
view systemview included .220.127.116.11.2.1.1
view systemview included .18.104.22.168.22.214.171.124.1
# Finally, grant the group read-only access to the systemview view.
# group context sec.model sec.level prefix read write notif
access notConfigGroup "" any noauth exact centreon none none
access notConfigGroup "" any noauth exact systemview none none
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. Use the following commands for recent distributions:
systemctl restart snmpd
systemctl enable snmpd
The target server must be reachable from the Centreon Poller on the UDP/161 SNMP port.
On the poller
Connect to your poller using SSH and install the Linux SNMP plugin (see the monitoring procedure for the Linux SNMP Plugin Pack for more information):
yum install centreon-plugin-Operatingsystems-Linux-Snmp
On the central server
In the web interface, go to Configuration > Plugin Packs and install the Linux SNMP Plugin Pack:
Configure the host and deploy the configuration
Go to Configuration > Hosts > Hosts and click on Add:
Fill in the following information:
- The name of the server (1)
- A description of the server (2)
- Its IP address (3)
- The SNMP version and community (4)
- Select the poller that will monitor your Linux server (keep "Central" if you have no other poller) (5)
Click on + Add a new entry in the Templates field (6), then select the OS-Linux-SNMP-custom template (7) from the list:
Click on Save (8). Your equipment has been added to the list of hosts:
Go to Configuration > Services > Services by host. A set of indicators has been created automatically.
You can also use the shortcut beside the host's name to go directly to Configuration > Services > Services by host. The list will be filtered by the name of the host:
Go to Monitoring > Resources Status and select All from the Resource status filter. At first, the resources appear with the status Pending, which means that no checks have been executed yet:
After a few minutes, the first results of the monitoring appear:
If not all services are in an OK state, check what causes the error and fix the problem.