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.
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?
Do I need to disable anything on the remote servers (Apache etc.) seeing as those servers will now only be used for polling?
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?
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.
Will I need to add the remote devices to the main server once all is connected or will they automatically “share” them?
redis-cli → INFO (this will show version number etc)
MONITOR (this will show traffic)
Change redis server IP.
a. Navigate to /etc/redis
b. Nano redis.conf
i. Set server IP as bind address
c. Restart redis service
redis-cli -h host_IP
a. INFO
Nano .env and add
a. REDIS_HOST=192.168.100.10
b. REDIS_PORT=6379
c. REDIS_DB=0
d. CACHE_DRIVER=redis
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
No need for Memcached
Navigate to /etc/mysql/mariadb.conf.d
a. Nano 50-server.cnf and Change
b. Change bind-address to main server IP
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
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
Install LibreNMS as per normal (no need to continue process from MySQL or Apache setup, don’t forget cron!!)
Nano .env and copy paste main server .env and change DB_HOST IP, also make sure NODE_ID is unique!!!
APP_KEY=base64:somelongrandomcodefrominstallation
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