LibreNMS is a network management system used to centralize monitoring of all network assets.
Follow the instructions provided HERE to setup the service.
NOTE: python-ipaddress must be installed, use command below
sudo apt-get install snmp snmp-mibs-downloader
sudo apt-get install python-ipaddress
sudo apt-get update
-
Edit the
config.php
file to add the subnets you wish to scan.sudo nano /opt/librenms/config.php
-
Add the subnets to the config file. (example code below)
$config['nets'][] = '192.168.0.0/24'; $config['nets'][] = '172.2.4.0/22';
-
Save the file and run this script.
/opt/librenms/snmp-scan.py
Some devices have the port 161 closed which blocks the SNMP scan, click HERE for examples on how to configure them to add them manually or through another scan.
Linux Server Example source
-
Install snmpd using the command below.
sudo apt-get install snmpd
-
Modify the snmpd.conf file (replace nano with whatever editor you prefer).
sudo nano /etc/snmp/snmpd.conf
-
Comment IPv4 line and uncomment both IPv4 & IPv6 line. Should look like below.
#agentAddress udp:127.0.0.1:161 agentAddress udp:161,udp6:[::1]:161
-
Add view under 'Access Control'
view all included .1
-
Change the line:
rocommunity public default -V systemonly
To:
rocommunity public default -V all
-
Change the lines below to provide server description. Make sure to keep the variables 'syslocation' & 'syscontact'
syslocation Rack, Room, Building, City, Country [GPSX,Y] syscontact Your Name <your@email.address>
-
Restart snmpd and enable
sudo systemctl restart snmpd sudo systemctl enable snmpd
-
Add the device in LibreNMS using the IPv4 address. Using the community name
public