This guide focus on adding devices to LibreNMS tool for monitoring. Assuming that you have a working setup for LibreNMS monitoring tool, if not, follow the below guide.

For a demo purpose, we will install and configure SNMP on the client servers (Linux machines), and then will configure LibreNMS to collect data’s from clients via SNMP protocol.

Install SNMP:

Use the following command to install SNMP package.

### CentOS 7 / RHEL 7 ###
yum -y install net-snmp

### Ubuntu 16.04 ###
apt-get -y install snmpd

Configure SNMP:

Edit the SNMP configuration file.

vi /etc/snmp/snmpd.conf

Update the snmpd.conf with the below details.

Below is the minimal SNMP configuration recommended by LibreNMS. If you have custom SNMP configuration present on the client server, then just update below lines with existing configurations, otherwise, delete snmpd.conf file and create it again with below content.

# Change "libre" to your preferred SNMP community string

com2sec readonly default libre

group MyROGroup v2c readonly

view all included .1 80

access MyROGroup "" any noauth exact all none none

# Update your location here

syslocation [51.7520,-1.2577]
syslocation Oxford, United Kingdom
syscontact IT Admin <admin@optusnet.local>

# Distro Detection

extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro

Install distro script to get OS information on LibreNMS.

curl -o /usr/bin/distro https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro
chmod +x /usr/bin/distro

Restart snmpd service.

systemctl restart snmpd

Enable snmpd service on system boot.

systemctl enable snmpd

Ensure snmpd listens on all network interface or on a particular interface which is accessible to LibreNMS.

netstat -antup | grep -i 161

Output:

udp 0 0 0.0.0.0:161 0.0.0.0:* 25268/snmpd

Adding devices to LibreNMS:

Login into LibreNMS monitoring tool.

To add any device, go to Devices –> Add Device.

Enter Hostname, SNMP version (v2c – leave the default), port number (161), and community name

As recommended in LibreNMS setup, we will add localhost (LibreNMS server) as a first device.

Wait for few minutes to let LibreNMS collects data of the newly added device.

Polling for newly added device happens every five minutes, and discovery of all device happens every six hours.

Repeat same steps to add all of your network devices and servers. You can list out the added devices by going to Devices –> All Devices.

LibreNMS is a great tool and has maximum capabilities for monitoring server and network devices. Don’t miss to explore all the possibilities of LibreNMS.

Pin It on Pinterest

Share This