Intergrating Smokeping with LibreNMS


Ive got LibreNMS and Smokeping running on the save server ( Ubuntu 16.04.4 LTS) fine then I read that we can integrate them. Ive got devices on Smokeping Target that are not in LibreNMS and vice versa.

I only want the devices on Smokeping to be shown up on LibreNMS

Any help will be really apprecaited

1 Like

By the way I google this -

Edit my /opt/librenms/config.php and add the following and restart apache but no Ping shows up in Devices sub-tab. Am I missing something ?

Intergration of Smokeping

$config[‘smokeping’][‘dir’] = ‘/var/lib/smokeping’;
$config[‘smokeping’][‘pings’] = 20;

Am running this LibreNMS version

Version|1.41 - Sun Jul 01 2018 09:37:37 GMT+1200|
DB Schema|#253|
Web Server|Apache/2.4.18 (Ubuntu)|

The $config[‘smokeping’][‘dir’] needs to be the directory of the rrd files, so I think you’ll probably want ‘/var/lib/smokeping/rrd’ - libreNMS only shows the tab when it can find the files.

Under var/lib/smokeping there is no rrd folder. I’ve got some other folders under var/lib/smokeping with rrd files in it

So probably I have to have a line each for those rrd files on my librenms config.php file ?

1 Like

I have the same issue. I followed the guide, but I can’t get the ping tab to work and server/cgi-bin/smokeping.cgi just loads the default librenms home page for me.

The $config['smokeping']['dir'] should be the same as the smokeping config datadir.

I ended up moving the smokeping RRD files under the libreNMS folder to get around a RRDCached permissions issue, so in /etc/smokeping/config I have:

datadir = /opt/librenms/rrd/smokeping/rrd

and in LibreNMS config.php:

$config['smokeping']['dir'] = '/opt/librenms/rrd/smokeping/rrd';

I believe I was looking at the wrong tab for “Ping” button. If I browse to Devices>All Devices or Devices>All Devices and I choose the group i.e Network, Firewall, Wireless etc I can see the ping button. However I can see the graphs of all my devices. I want only to see the smokeping graphs of hosts in under my /etc/smokeping/config.d/Targets

Here is my the intergration config on my /opt/librenms/config.php

$config[‘smokeping’][‘dir’] = ‘/var/lib/smokeping’;
$config[‘smokeping’][‘integration’] = true;
$config[‘my smokeping hostname’].

After installation

use this link but note getting smokeping web page

plese help

May not be, but I encountered this when integrating smokeping because my configuration management system had turned the firewall on but I hadn’t allowed an exception.

I run Libre on HTTPS, so the easiest “fix” was to allow Nginx to handle smokeping via HTTP and add the firewall rule. I only go to http://libre/smokeping.cgi though - no cgi-bin.

You should get a ping graph on your device page linking to e.g. https://librenms.your.domain/device/device=26/tab=latency/ but this only appears if LibreNMS can find the smokeping files.

I think the ping link under “All Devices” is just a standard ping not the smokeping integration.

I’m pretty sure the line $config['smokeping_server_hostname']. under the smokeping integration docs is incorrect, there’s no such option for the smokeping integration - but you will still require $config['smokeping']['integration'] = true;

Can you post the general section of your smokeping config?

General section of my smokpeing is as follows:

*** General ***

owner = My company
contact = my email address
mailhost = localhost

NOTE: do not put the Image Cache below cgi-bin

since all files under cgi-bin will be executed … this is not

good for images.

cgiurl = http://localhost/smokeping/smokeping.cgi

specify this to get syslog logging

syslogfacility = local5

each probe is now run in its own process

disable this to revert to the old behaviour

concurrentprobes = no

@include /etc/smokeping/config.d/pathnames

OK this is what i have on my smokeping integration configuration on /opt/librenms/config.php file

$config[‘smokeping’][‘dir’] = ‘/var/lib/smokeping’;
$config[‘smokeping’][‘integration’] = true;
$config[‘smokeping’][‘pings’] = 20;

Any help will be really appreciated

Sorry, the bit I was looking for (the paths configured in smokeping) must be in this config file?

This is the configuration of pathnames - /etc/smokeping/config.d/pathnames

sendmail = /usr/sbin/sendmail
imgcache = /var/cache/smokeping/images
imgurl = …/smokeping/images
datadir = /var/lib/smokeping
piddir = /var/run/smokeping
smokemail = /etc/smokeping/smokemail
tmail = /etc/smokeping/tmail
dyndir = /var/lib/smokeping/__cgi

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
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

Hi @Sachin_Sharma

Is this the same from here -

Do note that I already got smokeping and librenms working fine from the same server. I want to integrate the existing smokeping to libreNMS