Observium Professional edition – Adding smokeping intergration
Updated 11/12/2014 – Added smokeping cgi link at bottom of post.
Update 12/1/2014 – Adjusted smokeping cgi link at bottom due to Mike Hammett’s feedback. Updated from restart to reload in cron job.
Update 3/7/2014 – Added FastCGI info, Apache 2.4 info
Lets get smokeping integration going.
apt-get install smokeping libapache2-mod-fcgid
We are going to have to make some changes to both apache2 and Observium.
pico /opt/observium/config.php
Add:
//Smokeping $config['smokeping']['dir'] = "/var/lib/smokeping";
Observium has scripts which generate the config. Lets run it and see what it generates.
php /opt/observium/scripts/generate-smokeping.php
*** Targets ***
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to Observium SmokePing
+ Observium
menu = Observium
++ router
host = router
Ok, so lets actually put the config in place.
php /opt/observium/scripts/generate-smokeping.php > /etc/smokeping/config.d/Targets
/etc/init.d/smokeping reload
Let’s get Fast CGI going. Add this to /etc/smokeping/apache2.conf
<Location /smokeping/smokeping.cgi> SetHandler fcgid-script </Location>
Enable CGI
a2enmod cgi
Restart apache
/etc/init.d/apache2 restart
Check back with Observium. Under the device, a little paper airplane between “Ports” and “Inventory” labeled “Ping” should show up. This tab will now be populated with graphs generated by the same rrd files for which smokeping generates it’s graphs with. The graphs look very different and I’m personally disappointed that they don’t match. Fortunately, you can still get to the smokeping interface by visiting:
http://yourip/smokeping/smokeping.cgi
Be aware – If this server is going to be on the internet, you may want to protect smokeping’s pages using an apache realm. There is no other password protection that I’m aware of. You can remove the file from /etc/apache2/config.d/smokeping if you want to disable this.
If you want to generate the smokeping config file you can add the command to cron, but don’t generate it to often as it can lead to gaps in recorded information. Also, if smokeping doesn’t finish in it’s allotted 300 seconds, it can cause gaps in graphs as well.
I wanted a direct link to the actual smokeping page so I’ve been modifying /opt/observium/html/pages/device/latency.inc.php and adding the following line
echo('<a href=/smokeping/smokeping.cgi?target=Observium.' . str_replace(".","_",$device['hostname']) . ' target="_blank">' . $device['hostname'] . ' on Smokeping<a>' );
right after
echo('<table class="table table-striped">');
What sort of guidance do you have on the cron timing?
Is the 300 seconds limitation a smokeping issue or a cron issue?
The 300 second issue is in smokeping. By default it uses 1 process to do all nping probes. It’s a subpar design. What I’ve done is break it up into multiple probes.
+ FPing
binary = /usr/bin/fping
offset = 50%
++ FPing
binary = /usr/bin/fping
offset = 50%
++ FPing1
binary = /usr/bin/fping
offset = 50%
++ FPing2
binary = /usr/bin/fping
offset = 50%
++ FPing3
binary = /usr/bin/fping
offset = 50%
Then use FPingN, instead. I was doing this manually. and had 600 some hosts. Observium will create this file, but with only one probe so when I have to solve this problem on Observium I’ll post the modified script or send a patch in.
As for the cron timing, I’m generating the file once a day in the morning. I’ve also modified it to reload and not restart.
Now colored graphs can be set up in Observium. Patch is sent to the development team, you can take a look (and try to apply it) on http://jira.observium.org/browse/OBSERVIUM-1075
i need help in getting observium browser as i not getting
If you need help join the IRC channel. irc.oftc.net #Observium
Hello,
When I Enable this :
php /opt/observium/scripts/generate-smokeping.php > /etc/smokeping/config.d/Targets
I got bash: /etc/smokeping/config.d/Targets bash permission denied
Have you an idea ?
Thanks,
Check the user you are has permissions to change or make that file. Does the file exist, if not make it.