Creating Distributed Poller Setup From Multiple LibreNMS Servers

Hi All

I’ve currently got 7 x LibreNMS servers running on 7 different sites and I’m toying with the idea of going the distributed poller route in order to simplify maintenance and the number of dashboards I have to check. Each server monitors between 40 to 250 sites. I’ve got VPNs set up to all sites already and all servers can see one another.

Apart from struggling a bit to “follow” the setup docs I also have a few questions.

  1. Currently I load host names in the hosts file for each server, would I have to continue doing this for each server as well as loading them all on the main server to continute using hostnames?
  2. Do I need to disable anything on the remote servers (Apache etc.) seeing as those servers will now only be used for polling?
  3. I see the 3 main ways of connecting the servers are memcached, redis or sql locks but there is nothing about what to configure for sql locks. Does that just work or does it need to be configured?
  4. Is there a guide somewhere that gives simple steps as to what to go through for distributed setup? I’ve read the docs a few times now and started making notes but it feels like I’m reading it in Greek.
  5. Will I need to add the remote devices to the main server once all is connected or will they automatically “share” them?

Thanks,
R

Main Server

  1. sudo apt install redis-server
  2. Enable/start service
  3. redis-cli → INFO (this will show version number etc)
    MONITOR (this will show traffic)
  4. Change redis server IP.
    a. Navigate to /etc/redis
    b. Nano redis.conf
    i. Set server IP as bind address
    c. Restart redis service
  5. redis-cli -h host_IP
    a. INFO
  6. Nano .env and add
    a. REDIS_HOST=192.168.100.10
    b. REDIS_PORT=6379
    c. REDIS_DB=0
    d. CACHE_DRIVER=redis
  7. Enable distributed polling in config.php … Add
    a. $config[‘distributed_poller’] = true;
    b. $config[‘distributed_poller_name’] = php_uname(‘n’);
    c. $config[‘distributed_poller_group’] = ‘0’; Set this according Poller Group
  8. No need for Memcached
  9. Navigate to /etc/mysql/mariadb.conf.d
    a. Nano 50-server.cnf and Change
    b. Change bind-address to main server IP
  10. Allow remote access to MySQL
    a. Mysql - u root -p
    b. CREATE USER ‘librenms’@‘192.168.99.249’ IDENTIFIED BY ‘your_password’;
    c. GRANT ALL PRIVILEGES ON librenms.* TO ‘librenms’@‘192.168.99.249’;
    d. FLUSH PRIVILEGES;
    e. Do this for all IP ranges that will be connecting
  11. Configure rrdcached
    a. Navigate to /etc/default
    b. Nano rddcached and set
    DAEMON=/usr/bin/rrdcached
    DAEMON_USER=librenms
    DAEMON_GROUP=librenms
    WRITE_THREADS=4
    WRITE_TIMEOUT=1800
    WRITE_JITTER=1800
    BASE_PATH=/opt/librenms/rrd/
    JOURNAL_PATH=/var/lib/rrdcached/journal/
    PIDFILE=/run/rrdcached.pid
    SOCKFILE=/run/rrdcached.sock
    SOCKGROUP=librenms
    BASE_OPTIONS="-B -F -R -l 0:42217 "
    c. chown librenms:librenms /var/lib/rrdcached/journal/
    d. systemctl restart rrdcached.service
    e. Nano config.php and set
    i. $config[‘rrdcached’] = “192.168.100.10:42217”;

Poller

  1. Install LibreNMS as per normal (no need to continue process from MySQL or Apache setup, don’t forget cron!!)
  2. Nano .env and copy paste main server .env and change DB_HOST IP, also make sure NODE_ID is unique!!!
    APP_KEY=base64:somelongrandomcodefrominstallation

DB_HOST=192.168.100.10
DB_DATABASE=librenms
DB_USERNAME=librenms
DB_PASSWORD='your_password’

REDIS_HOST=192.168.100.10
REDIS_PORT=6379
REDIS_DB=0
CACHE_DRIVER=redis

  1. ./validate.php and check setup
  2. Enable distributed polling in config.php
    a. Nano config.php and set
    i. $config[‘rrdcached’] = “192.168.100.10:42217”;
    ii. $config[‘distributed_poller’] = true;
    iii. $config[‘distributed_poller_name’] = php_uname(‘n’);
    iv. $config[‘distributed_poller_group’] = ‘0’; Set this according Poller Group

Allow these ports through Firewall

  1. 42217 - TCP : RRDCached
  2. 3306 - TCP : DB
  3. 6379 - TCP : redis
3 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.