Install smokeping on Raspbian

From KlavoWiki
Jump to navigationJump to search

Install

apt-get -y install smokeping sendmail sipsak


cgi script

a2enmod cgi

smokeping web

vi /etc/smokeping/apache2.conf

add

DirectoryIndex smokeping.cgi

example

<Directory "/usr/share/smokeping/www">
    Options FollowSymLinks
    DirectoryIndex smokeping.cgi
</Directory>

enable web

ln -s /etc/smokeping/apache2.conf /etc/apache2/sites-enabled/smokeping.conf

redirection

If you want to redirect your root web site to /smokeping

vi /var/www/html/index.html

An example is here.

<html>
<head>  <meta http-equiv="refresh" content="0; url=/smokeping" /> </head>
<body></body>
</html>

Config Files

Location

/etc/smokeping/config.d/

Alerts

This is simple enough. The email address to send alerts to and the from address.

/etc/smokeping/config.d/Alerts

Database

/etc/smokeping/config.d/Database

Smokeping has a default of 5 minute averages which I don't like. I changed mine to be 1 minute averages.

1 ping every 5 seconds.

step     = 60
pings    = 12

General

Very general stuff here. Owner, email and SMTP server.

/etc/smokeping/config.d/General

Presentation

This is how the graphs look and the default displaying of graphs.

I didn't like the default at all. I defaulted mine to be 1 Hour, 6 Hours, 1 Day, 30 Days and 1 Year.

/etc/smokeping/config.d/Presentation
"Last 1 Hour"     1h
"Last 6 Hours"    6h
"Last 1 Day"      1d
"Last 1 Week"     7d
"Last 30 Days"    30d
"Last 1 Year"     365d

I also changed the summary graphs to be double the height for easier reading.

+ overview

width = 600
height = 100
range = 6h

Slaves

I haven't played with or understand this as yet.

/etc/smokeping/config.d/Slaves

Targets

/etc/smokeping/config.d/Targets

This for me was the hardest to understand. The official example page is here. Let me start at the top of the file and try to explain each section.

Use the default probe of FPing. You can change the probe to be different for each host. Example sipsak can be use to test SIP servers.

*** Targets ***

probe = FPing

This information is displayed on the home page of smokeping.

menu = Top
title = Network Latency Grapher
remark = SmokePing website for my network. Authorised access only.


The first line will represent the URL. Example myserver.com/smokeping/?target=Menu1
The second line will represent the name of the menu item on the web page.
The third line will be a title of the graphs within this menu.

+ Menu1
menu = Menu
title = Description


This next section will ping each node.

The first line will represent the URL. Example myserver.com/smokeping/?target=Menu1.Item1
The second line will represent the name of the menu item on the wen page.
The third line will be a title of the graphs within this menu.
The fourth line will allow an email to be sent if there is any loss based on the configuration of the Alerts file.
the fifth line is only if you are not using the default probe otherwise this line is not required.
The sixth line is the host to ping. You can use IP or FQDN.

++ Item1
menu = Node1
title = Title Name
alerts = smoeloss
probe = SipSak
host = google.com

Structure

  • You can only have one probe define globally.
  • You can only define one menu, title and remark for the landing page of smokeping.
  • The menu structure is:
+url
menu
title

++ url
menu
title
host

++ url
menu
title
host
.
.
.
+url (New menu structure)
title

++ url
menu
title
host

++ url
menu
title
host
.
.
.
and so forth

This is the basics of Targets. There is a lot more that you can do. Refer to the documentation for more information.

Probes

If you have added additional probes you will need to add them to smokeping here.

As I added sipsak I need to add the following.

/etc/smokeping/config.d/Probes
+ SipSak
binary = /usr/bin/sipsak

rrd files

/var/lib/smokeping/

enable changes

Reboot or restart apache and smokeping

systemctl restart apache2
systemctl restart smokeping

Notes

I installed sipsak so I can do a sip ping rather than an ICMP ping to SIP servers. There are other modules you can install like DNS, HTTP, HTTPS, SSH, CISCO and others. Refer to smokeping probes.

I noticed the latency was 1 to 10 ms higher when using application probes. Probably because it takes that bit long for a reply to come form the application.

Documentation

http://oss.oetiker.ch/smokeping/doc/