Documentation for Smokeping Integration
Install Smokeping
apt-get install smokeping
If so, just edit smokepingâs pathnames.
nano /etc/smokeping/config.d/pathnames
Comment out the first line:
#sendmail = /usr/sbin/sendmail
Exit and save.
Check if the smokeping config file was created for apache2:
ls /etc/apache2/conf-available/
If you donât see smokeping.conf listed, youâll need to create a symlink for it:
ln -s /etc/smokeping/apache2.conf /etc/apache2/conf-available/smokeping.conf
Edit the smokeping config so smokeping knows the hostname itâs running on:
nano /etc/smokeping/config.d/General
Change the cgiurl value to http://yourhost/cgi-bin/smokeping.cgi Modify any other values you wish, then exit and save.
LibreNMS integration
So far this is a relatively normal Smokeping installation; next weâll set up the LibreNMS integration.
Generate the configuration file so Smokeping knows the hosts you have set up for monitoring in LibreNMS.
cd /opt/librenms/scripts/
(echo â+ LibreNMSâ; php ./gen_smokeping.php) > /etc/smokeping/config.d/librenms.conf
Add a cron job so as you add or remove hosts in librenms theyâll get updated with Smokeping.
crontab -e
Add the example cron below; itâs set to run daily at 02:05
05 02 * * * root cd /opt/librenms/scripts && (echo â+ LibreNMSâ; php ./gen_smokeping.php) > /etc/smokeping/config.d/librenms.conf && service smokeping reload >> /dev/null
Exit and save.
Include librenms.conf in smokepingâs config:
nano /etc/smokeping/config
Add the following line at the end:
@include /etc/smokeping/config.d/librenms.conf
Exit and save.
Configure LibreNMS
nano /opt/librenms/config.php
Scroll to the bottom, and paste in the following:
$config[âsmokepingâ][âdirâ] = â/var/lib/smokepingâ;
$config[âsmokepingâ][âintegrationâ] = true;
Exit and save.
Run the following commands:
a2enconf smokeping
a2enmod cgid
service apache2 restart
service smokeping restart
Return to your normal user shell
Exit
Done! You should be able to load the Smokeping web interface at http://yourhost/cgi-bin/smokeping.cgi In LibreNMS, a Ping tab should also appear.
Solutions for Cron Job
However, it is more desirable to set up a cron job which regenerates our list of nodes and adds these into Smokeping. You can add the following to the end of your librenms cron job, e.g.
nano /etc/cron.d/librenms
Ubuntu 16.04 Sample cron (will run daily at 00:05) :
05 00 * * * root (echo â+ LibreNMSâ; php -f /opt/librenms/scripts/gen_smokeping.php) > /etc/smokeping/config.d/librenms.conf && systemctl reload smokeping.service >> /dev/null 2>&1
Ubuntu 16.04 Sample cron (will run after 5 min)
*/5 * * * * root (echo â+ LibreNMSâ; php -f /opt/librenms/scripts/gen_smokeping.php) > /etc/smokeping/config.d/librenms.conf && systemctl reload smokeping.service >> /dev/null 2>&1