librenms

librenms is a replacement to cacti, it is easier to configure, install and discovers your SNMP devices. before you begin, please ensure that your devices have snmp enabled and the rocommunity string is there, the default rocommunity string is normally set to public as its string.

jump straight to…

ssh commands required
majority of the ssh commands requires nano or vim. my choice of a terminal editor would be nano. to find out more how to use nano, visit the following page to get the basics.

look out for notes
notes are placed in the guides, these markers requires your attention.

report inaccuracies and errors
if something in this guide is inaccurate, wrong, or outdated, report it by scanning the qr code.


⚡ [preparing your synology to house librenms]

⚠️ important: default login for phpmyadmin is username: root (there is no password) you will need to set a password for your root account.


👨🏻‍💻 [setting up librenms in docker]

  1. ssh into your synology box with root access and execute the following commands

     mkdir /volume1/docker/librenms/logs
    
     mkdir /volume1/docker/librenms/rrd
  2. next step is to login to your phpmyadmin and create the librenms database

  3. in the phpmyadmin gui create a new db called librenms

  4. click on the db and add a user to the librenms db. the username will be called librenms as well.

  5. assign full rights to the db for user librenms

  6. now ssh into your synology with root access and enter the following in sequence.

     docker run \
         -d \
         -p 8668:80 \
         -e DB_HOST=YOURSYNOLOGYIP \
         -e DB_NAME=librenms \
         -e DB_USER=librenms \
         -e DB_PASS=YOURLIBRENMSUSERPASSWORD \
         -e PUID=0 -e PGID=101 \
         -e TZ=Asia/Singapore \
         -e BASE_URL=http://YOURSYNOLOGYIP:8668 \
         -e POLLERS=16 \
         -v /volume1/docker/librenms/logs:/opt/librenms/logs \
         -v /volume1/docker/librenms/rrd:/opt/librenms/rrd \
         --name librenms \
         jarischaefer/docker-librenms   
  7. now, librenms docker has been installed on your device

  8. login to your synology gui and access docker.

  9. activate the librenms container and click on details.

  10. navigate to terminal > create > bash

  11. run the following commands to inject the schema into the db

    cd /opt/librenms/
    php build-base.php
  12. you should see the following output:

    -- Updating database schema
    000 -> 001 ... done.
    001 -> 002 ... done.
    002 -> 003 ... done.
    003 -> 004 ... done.
    004 -> 005 ... done.
    005 -> 006 ... done (0 errors).
    006 -> 007 ... done (0 errors).
    ...
    144 -> 145 ... done (0 errors).
    145 -> 146 ... done (0 errors).
    -- Done
  13. setting up the super account by entering the following in the librenms bash:

    php adduser.php USERNAME PASSWORD 10 EMAIL@DOMAIN.COM
  14. to wrap it up, execute this:

    php validate.php
  15. access your librenms and login at http://synology-ip:8668


👨🏻‍💻 [timezone issues]

🗣 note: one last thing to do is to have the timezone for docker’s VM synchronised to your synology’s timezone. To do so, execute the following in the librenms bash:

ln -sf /usr/share/zoneinfo/Asia/Singapore /etc/localtime this would ensure that the graphs plotted have the correct time displayed on them.


👨🏻‍💻 [mysql issues]

🗣 note: if you have issues adding devices, logon to your myphpadmin gui, access your librenms database, select all tables and drop the tables.

logon to Synology and access the bash for librenms and then run:

  php /opt/librenms/build-base.php 

👨🏻‍💻 [mysql password errors]

  1. if you’re facing errors with librenms and your mysql, where it states that the following error:

     Access denied for user 'librenms'@'172.168.x.x' (using password: NO)
  2. you will need to logon to your synology > docker > librenms > details > terminal > create > bash and execute the following:

     vim /opt/librenms/config.php
  3. followed by the changing of the db_pass to your mysql database password.

     $config['db_pass'] = 'P@ssw0rd';

👨🏻‍💻 [librenms environment]

🗣 note: in the event that your docker container should get updated. There’s two possibilities to resolve it.

since the reinstall is already covered, we will attempt to input all the ENV settings into docker.

  1. logon to your synology and check that the librenms container has not started.

  2. click on the librenms > edit > environment

  3. enter the following variables and values

     variable          value
     DB_HOST           SYNOLOGYIP
     DB_NAME           librenms
     DB_USER           librenms
     DB_PASS           MYSQLLIBRENMSPASSWORD
     PUID              0
     PGID              101
     TZ                Asia/Singapore
     BASE_URL          http://synologyip:8668
     POLLER            16
  4. save and exit and attempt to restart.