From 87d227f923da9205082e7167b13935ba089af8bd Mon Sep 17 00:00:00 2001 From: thepacmanfan Date: Fri, 4 Dec 2015 00:28:23 -0600 Subject: [PATCH 1/4] Update Smokeping.md --- doc/Extensions/Smokeping.md | 115 ++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/doc/Extensions/Smokeping.md b/doc/Extensions/Smokeping.md index 902b14f2a5..7f8a315819 100644 --- a/doc/Extensions/Smokeping.md +++ b/doc/Extensions/Smokeping.md @@ -43,3 +43,118 @@ $config['own_hostname'] ``` You should now see a new tab in your device page called ping. + + + + +Install and integrate Smokeping [Debian/Ubuntu] + +> This guide assumes you have already installed librenms, and you installed apache2 in the process. Tested with Ubuntu 14.04 and Apache 2.4. + +Nearly everything we do will require root, and at one point we'll encounter a problem if we just use sudo, so we'll just switch to root at the beginning... + +```bash +sudo su - +``` + +### Install Smokeping ### + +```bash +apt-get install smokeping +``` + +At the end of installation, you may have gotten this error: `ERROR: /etc/smokeping/config.d/pathnames, line 1: File '/usr/sbin/sendmail' does not exist` + +If so, just edit smokeping's pathnames. + +```bash +nano /etc/smokeping/config.d/pathnames +``` + +Comment out the first line: + +```bash +#sendmail = /usr/sbin/sendmail +``` + +Exit and save. + +Check if the smokeping config file was created for apache2: + +```bash +ls /etc/apache2/conf-available/ +``` + +If you don't see `smokeping.conf` listed, you'll need to create a symlink for it: + +```bash +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: + +```bash +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. + +```bash +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. + +```bash +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: +```bash +nano /etc/smokeping/config +```bash + +Add the following line at the end: +`@include /etc/smokeping/config.d/librenms.conf` +Exit and save. + +### Configure LibreNMS ### + +```bash +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: +```bash +a2enconf smokeping +a2enmod cgid +service apache2 restart +service smokeping restart +``` + +Switch back to your regular user account + +```bash +su librenms +``` + +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. From a27b3c7e9ca28b523491e663a034516b97a5ab4e Mon Sep 17 00:00:00 2001 From: thepacmanfan Date: Fri, 4 Dec 2015 00:29:15 -0600 Subject: [PATCH 2/4] Update Smokeping.md --- doc/Extensions/Smokeping.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Extensions/Smokeping.md b/doc/Extensions/Smokeping.md index 7f8a315819..589c75e6a6 100644 --- a/doc/Extensions/Smokeping.md +++ b/doc/Extensions/Smokeping.md @@ -47,7 +47,7 @@ You should now see a new tab in your device page called ping. -Install and integrate Smokeping [Debian/Ubuntu] +### Install and integrate Smokeping [Debian/Ubuntu] ### > This guide assumes you have already installed librenms, and you installed apache2 in the process. Tested with Ubuntu 14.04 and Apache 2.4. From 4f4d9fc4fc793079394c802e69e4b6186c071198 Mon Sep 17 00:00:00 2001 From: thepacmanfan Date: Sat, 5 Dec 2015 00:58:17 -0600 Subject: [PATCH 3/4] Update Smokeping.md --- doc/Extensions/Smokeping.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/doc/Extensions/Smokeping.md b/doc/Extensions/Smokeping.md index 589c75e6a6..f4fea4bb8c 100644 --- a/doc/Extensions/Smokeping.md +++ b/doc/Extensions/Smokeping.md @@ -118,16 +118,24 @@ 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` + +```bash +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: ```bash nano /etc/smokeping/config -```bash +``` Add the following line at the end: -`@include /etc/smokeping/config.d/librenms.conf` + +```bash +@include /etc/smokeping/config.d/librenms.conf +``` + Exit and save. ### Configure LibreNMS ### @@ -138,9 +146,12 @@ nano /opt/librenms/config.php Scroll to the bottom, and paste in the following: -`$config['smokeping']['dir'] = '/var/lib/smokeping'; +```bash +$config['smokeping']['dir'] = '/var/lib/smokeping'; $config['smokeping']['integration'] = true; -Exit and save.` +``` + +Exit and save. Run the following commands: ```bash From 914f8d2596e2503c157e8c0aab1f4d3930b34900 Mon Sep 17 00:00:00 2001 From: thepacmanfan Date: Sat, 5 Dec 2015 01:30:34 -0600 Subject: [PATCH 4/4] Update Smokeping.md --- doc/Extensions/Smokeping.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Extensions/Smokeping.md b/doc/Extensions/Smokeping.md index f4fea4bb8c..7c0703471c 100644 --- a/doc/Extensions/Smokeping.md +++ b/doc/Extensions/Smokeping.md @@ -161,10 +161,10 @@ service apache2 restart service smokeping restart ``` -Switch back to your regular user account +Return to your normal user shell ```bash -su librenms +exit ``` Done! You should be able to load the Smokeping web interface at `http://yourhost/cgi-bin/smokeping.cgi`