Skip to content

Instantly share code, notes, and snippets.

@jgram925
Last active June 15, 2019 17:52
Show Gist options
  • Save jgram925/435dd292e25d7f71428297c35859768b to your computer and use it in GitHub Desktop.
Save jgram925/435dd292e25d7f71428297c35859768b to your computer and use it in GitHub Desktop.
LibreNMS Setup.md

LibreNMS is a network management system used to centralize monitoring of all network assets.

Setup

Follow the instructions provided HERE to setup the service.

Scanning for IP Devices

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
  1. Edit the config.php file to add the subnets you wish to scan.

     sudo nano /opt/librenms/config.php
    
  2. Add the subnets to the config file. (example code below)

     $config['nets'][] = '192.168.0.0/24';
    
     $config['nets'][] = '172.2.4.0/22';
    
  3. Save the file and run this script.

     /opt/librenms/snmp-scan.py
    

Config for Adding Devices

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
  1. Install snmpd using the command below.

     sudo apt-get install snmpd
    
  2. Modify the snmpd.conf file (replace nano with whatever editor you prefer).

     sudo nano /etc/snmp/snmpd.conf
    
  3. 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
    
  4. Add view under 'Access Control'

     view   all         included   .1   
    
  5. Change the line:

     rocommunity public  default    -V systemonly
    

    To:

     rocommunity public default    -V all
    
  6. 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>
    
  7. Restart snmpd and enable

     sudo systemctl restart snmpd
    
     sudo systemctl enable snmpd
    
  8. Add the device in LibreNMS using the IPv4 address. Using the community name public

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment