#How the LibreNMS was moved.
#On Old server
cd /opt
mysql_dump -u root -p librenms > librenms-2019-02-18.sql
tar cf librenms librenms.2019-02-18.tar
#Copy the files over to the new server
#New Server
root@librenms:/opt# tar xf librenms.2019-02-18.tar
#I did run github-remove -d to clean up some files that didn’t belong
mysql -u root -p < librenms-2019-02-18.sql
Enter password:
#Update the MariaDB granting all privilegs to librenms
root@librenms:/opt/librenms# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 1720
Server version: 10.1.38-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04
Copyright © 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
MariaDB [(none)]> GRANT ALL PRIVILEGES ON librenms.* TO ‘librenms’@‘localhost’;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]> quit
Bye
Validated that librenms sql user has access to the database and can select data from the users table
librenms@librenms:~/logs$ mysql -u librenms -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 1974
Server version: 10.1.38-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04
Copyright © 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
MariaDB [(none)]> use librenms
MariaDB [librenms]> select count() from devices;
±---------+
| count() |
±---------+
| 241 |
±---------+
1 row in set (0.00 sec)
#Set the permissions
chown -R librenms:librenms /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/
#Ran Validate on the new servers
#--------------------------------
librenms@librenms:~$ ./validate.php
Component |
Version |
LibreNMS |
1.39-83-g3ce1faa49b |
DB Schema |
251 |
PHP |
7.2.15-0ubuntu0.18.04.1 |
MySQL |
10.1.38-MariaDB-0ubuntu0.18.04.1 |
RRDTool |
1.7.0 |
SNMP |
NET-SNMP 5.7.3 |
====================================
[OK] Composer Version: 1.8.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] You have not set sql_mode=’’ in your mysql config.
[FIX] Set sql-mode=’’ in your mysql config file in the [mysqld] section.
[OK] Database schema correct
[FAIL] The poller (librenms) has not completed within the last 5 minutes, check the cron job.
[FAIL] The poller (Librenms2) has not completed within the last 5 minutes, check the cron job.
[WARN] Some devices have not been polled in the last 5 minutes. You may have performance issues.
[FIX] Check your poll log and see: XXXXXXXXXXXXXXXXX/Support/Performance/
Devices:
208.xxx.222.8
10.249.12.6
10.249.12.78
10.249.12.10
10.249.15.10
10.249.29.10
10.249.28.10
10.249.28.51
10.249.14.10
10.250.1.35
10.250.1.36
172.16.5.10
172.16.5.58
172.16.5.50
172.16.5.52
and 221 more…
[FAIL] Discovery has not completed in the last 24 hours.
[FIX] Check the cron job to make sure it is running and using discovery-wrapper.py
[WARN] Your install is over 24 hours out of date, last update: Tue, 22 May 2018 17:16:17 +0000
[FIX] Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.
librenms@librenms:~$
Since the validate looked good except for the poller in the last 5 mins and sql mode. I ran daily
librenms@librenms:~$ ./daily.sh
Updating to latest codebase FAIL
sh: 1: /usr/sbin/sendmail: not found
*** Please tell me who you are.
Run
git config --global user.email “XXXXXXXXXXXXXX”
git config --global user.name “Your Name”
to set your account’s default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got ‘librenmsXXXXXXXXX.(none)’)
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK
#Fix the git error
ibrenms@librenms:~$ git config --global user.email “e*****@**"
librenms@librenms:~$ git config --global user.name "E”
librenms@librenms:~$ ./daily.sh
Updating to latest codebase OK
Updating Composer packages OK
Updated from 3ce1faa49b to 6966fc1b2a OK
Updating SQL-Schema
OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK
librenms@librenms:~$
#Ran Daily again just to make sure everything was updated… Probably not needed
librenms@librenms:~$ ./daily.sh
Updating to latest codebase OK
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK
#Validated the config
librenms@librenms:~$ ./validate.php
Component |
Version |
LibreNMS |
1.48.1-67-g6966fc1b2a |
DB Schema |
2019_01_16_195644_add_vrf_id_and_bgpLocalAs (131) |
PHP |
7.2.15-0ubuntu0.18.04.1 |
MySQL |
10.1.38-MariaDB-0ubuntu0.18.04.1 |
RRDTool |
1.7.0 |
SNMP |
NET-SNMP 5.7.3 |
====================================
[OK] Composer Version: 1.8.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[FAIL] The poller (librenms) has not completed within the last 5 minutes, check the cron job.
[FAIL] The poller (Librenms2) has not completed within the last 5 minutes, check the cron job.
[WARN] Some devices have not been polled in the last 5 minutes. You may have performance issues.
[FIX]:
Check your poll log and see: XXXXXXXXXXXXXXXXX/Support/Performance/
Devices:
208.40.222.8
10.249.12.6
10.249.12.78
10.249.12.10
10.249.15.10
10.249.29.10
10.249.28.10
10.249.28.51
10.249.14.10
10.250.1.35
10.250.1.36
172.16.5.10
172.16.5.58
172.16.5.50
172.16.5.52
and 221 more…
[FAIL] Discovery has not completed in the last 24 hours.
[FIX]:
Check the cron job to make sure it is running and using discovery-wrapper.py
#Updated Cron
root@librenms:/opt/librenms# vi /etc/cron.d/librenms
Using this cron file requires an additional user on your system, please see install docs.
33 */6 * * * librenms /opt/librenms/cronic /opt/librenms/discovery-wrapper.py 1
*/5 * * * * librenms /opt/librenms/discovery.php -h new >> /dev/null 2>&1
*/5 * * * * librenms /opt/librenms/cronic /opt/librenms/poller-wrapper.py 16
-
-
-
-
- librenms /opt/librenms/alerts.php >> /dev/null 2>&1
*/5 * * * * librenms /opt/librenms/poll-billing.php >> /dev/null 2>&1
01 * * * * librenms /opt/librenms/billing-calculate.php >> /dev/null 2>&1
*/5 * * * * librenms /opt/librenms/check-services.php >> /dev/null 2>&1
Daily maintenance script. DO NOT DISABLE!
If you want to modify updates:
Switch to monthly stable release: XXXXXXXXXXXXXXXdocs.librenms.XXXXXX/General/Releases/
Disable updates: XXXXXXXXXXXXXXXXdocs.librenms.XXXXXXXXXXXX/General/Updating/
15 0 * * * librenms /opt/librenms/daily.sh >> /dev/null 2>&1
#Restart Cron
root@librenms:/opt/librenms# systemctl status cron
â— cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-02-18 02:26:37 CST; 3s ago
Docs: man:cron(8)
Main PID: 13398 (cron)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/cron.service
└─13398 /usr/sbin/cron -f
Feb 18 02:26:37 librenms systemd[1]: Started Regular background program processing daemon.
Feb 18 02:26:37 librenms cron[13398]: (CRON) INFO (pidfile fd = 3)
Feb 18 02:26:37 librenms cron[13398]: (CRON) INFO (Skipping @reboot jobs – not system startup)