Install software dependencies (note that several packages have been excluded from this list that normally would be for the full LibreNMS installation)
apt install acl curl composer fping git mariadb-client mtr-tiny php8.1-{cli,curl,fpm,gd,gmp,mbstring,mysql,snmp,xml,zip} python3-dotenv python3-pymysql python3-redis python3-setuptools python3-systemd python3-pip rrdtool snmp snmpd
Add the librenms
user
useradd librenms -d /opt/librenms -M -r -s "$(which bash)"
Download LibreNMS
cd /opt
git clone https://github.com/librenms/librenms.git
Set Permissions
chown -R librenms:librenms /opt/librenms
chmod 771 /opt/librenms
setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
Install PHP dependencies. Login as the librenms
user for this step.
./scripts/composer_wrapper.php install --no-dev
Now logged in as root
again.
Set timezone in /etc/php/x.x/fpm/php.ini
and /etc/php/x.x/cli/php.ini
date.timezone = America/Denver
Set the system timezone as well
timedatectl set-timezone America/Denver
Enable lnms tab completion
ln -s /opt/librenms/lnms /usr/bin/lnms
cp /opt/librenms/misc/lnms-completion.bash /etc/bash_completion.d/
As the librenms
user
Open the .env
config file
vim .env
Copy the following config section from the MAIN server to the poller. Adjust the DB_HOST
and REDIS_HOST
config accordingly.
The APP_KEY
must be the same on all LibreNMS hosts
APP_KEY=base64:**********************************************
DB_HOST=192.168.20.4
DB_DATABASE=librenms
DB_USERNAME=librenms
DB_PASSWORD=***********************
#-----------------------#
# Redis Configuration #
#-----------------------#
REDIS_HOST=192.168.20.4
REDIS_PORT=6379
REDIS_DB=0
CACHE_DRIVER=redis
Validate the new config (must be run as the librenms
user, inside the home directory)
./validate.php
Install Dependencies
pip3 install -r requirements.txt
As root, setup systemd
cp /opt/librenms/misc/librenms.service /etc/systemd/system/librenms.service && systemctl enable --now librenms.service
Restart LibreNMS on the main server and check the pollers page. If setup correctly, the new poller will show up.