Install and configure Smokeping on Ubuntu 12.04 LTS

Currently I’m designing a network for a customer. To ground my design I also need some network statistics like bandwidth usage and latency in the current network.

Despite some big payed network monitoring packets, I had to install some free opensource monitoring packets to get the statistics I needed.
For latency monitoring I chose “Smokeping” based on the RRD tool and written by Tobi Oetiker & Niko Tyni.
The installation and configuration was pretty straight forward on Linux. I also tried installing it on Windows (the customer is primarily focused on Windows), but after several hours of troubleshooting I gave up and switched to Ubuntu linux.
Even though the installation was easy, I wrote a blogpost about it for my own future reference and maybe it is useful for others too.
  • First install a Linux distribution, I used Ubuntu
  • For the ease of installation, use the “sudo su” commando
  • Install the following packets: “aptitude install smokeping curl libauthen-radius-perl libnet-ldap-perl libnet-dns-perl libio-socket-ssl-perl libnet-telnet-perl libsocket6-perl libio-socket-inet6-perl apache2”
  • The smokeping configuration files can be found in “etc/smokeping/config.d”
  • Before use u need make some configuration changes:

“nano /etc/smokeping/config.d/General”

*** General ***

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

# Please edit this to suit your installation
owner = <name>
contact =” email@email.com”
cgiurl =” http://<your ip or dns name>/cgi-bin/smokeping.cgi”
mailhost =” smtp.email.com”
syslogfacility =” local0″
concurrentprobes =” no ”

Make sure that mailhost contains the primary MX for your email domain

“nano /etc/smokeping/config.d/Alerts”

*** Alerts ***
to = me@email.com
from = smokeping@email.com
“nano /etc/smokeping/config.d/Targets”

remark = Welcome to the SmokePing website of ‘Example Company’

<output omitted>

+ Local

menu = Local
title = Local Network

++ LocalMachine

menu = Local Machine
title = This host
host = localhost

Save your changes by using “ctrl + X”

now restart the smokeping service:

“/etc/init.d/smokeping restart”
You can reach smokeping byhttp://<ip or dns>/cgi-bin/smokeping.cgi” and the output will look like this:

Advertisements

6 Responses to Install and configure Smokeping on Ubuntu 12.04 LTS

  1. Hi, first, thank you so much for your post it got me pointed in the right direction. However, I ran into a small issue, when I configured a specific location I’m getting an error that I can’t seem to find via google. I’m curious if you have ever seen anything like this, or can point me in the right direction.

    ERROR: opening ‘/var/lib/smokeping/TWC/100_Maiden_Ln.rrd’: No such file or directory
    /var/cache/smokeping/images/TWC/100_Maiden_Ln_last_10800.png
    –start
    -10800
    –height
    200
    –width
    600
    –title
    Last 3 Hours
    –rigid
    –upper-limit
    1.2e-06
    –lower-limit
    0
    –vertical-label
    Seconds
    –imgformat
    PNG
    –color
    SHADEA#ffffff
    –color
    SHADEB#ffffff
    –color
    BACK#ffffff
    –color
    CANVAS#ffffff
    DEF:ping1=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping1:AVERAGE
    DEF:ping2=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping2:AVERAGE
    DEF:ping3=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping3:AVERAGE
    DEF:ping4=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping4:AVERAGE
    DEF:ping5=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping5:AVERAGE
    DEF:ping6=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping6:AVERAGE
    DEF:ping7=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping7:AVERAGE
    DEF:ping8=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping8:AVERAGE
    DEF:ping9=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping9:AVERAGE
    DEF:ping10=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping10:AVERAGE
    DEF:ping11=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping11:AVERAGE
    DEF:ping12=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping12:AVERAGE
    DEF:ping13=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping13:AVERAGE
    DEF:ping14=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping14:AVERAGE
    DEF:ping15=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping15:AVERAGE
    DEF:ping16=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping16:AVERAGE
    DEF:ping17=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping17:AVERAGE
    DEF:ping18=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping18:AVERAGE
    DEF:ping19=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping19:AVERAGE
    DEF:ping20=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:ping20:AVERAGE
    CDEF:cp1=ping1,1.2e-06,LT,ping1,INF,IF
    CDEF:cp2=ping2,1.2e-06,LT,ping2,INF,IF
    CDEF:cp3=ping3,1.2e-06,LT,ping3,INF,IF
    CDEF:cp4=ping4,1.2e-06,LT,ping4,INF,IF
    CDEF:cp5=ping5,1.2e-06,LT,ping5,INF,IF
    CDEF:cp6=ping6,1.2e-06,LT,ping6,INF,IF
    CDEF:cp7=ping7,1.2e-06,LT,ping7,INF,IF
    CDEF:cp8=ping8,1.2e-06,LT,ping8,INF,IF
    CDEF:cp9=ping9,1.2e-06,LT,ping9,INF,IF
    CDEF:cp10=ping10,1.2e-06,LT,ping10,INF,IF
    CDEF:cp11=ping11,1.2e-06,LT,ping11,INF,IF
    CDEF:cp12=ping12,1.2e-06,LT,ping12,INF,IF
    CDEF:cp13=ping13,1.2e-06,LT,ping13,INF,IF
    CDEF:cp14=ping14,1.2e-06,LT,ping14,INF,IF
    CDEF:cp15=ping15,1.2e-06,LT,ping15,INF,IF
    CDEF:cp16=ping16,1.2e-06,LT,ping16,INF,IF
    CDEF:cp17=ping17,1.2e-06,LT,ping17,INF,IF
    CDEF:cp18=ping18,1.2e-06,LT,ping18,INF,IF
    CDEF:cp19=ping19,1.2e-06,LT,ping19,INF,IF
    CDEF:cp20=ping20,1.2e-06,LT,ping20,INF,IF
    DEF:loss=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:loss:AVERAGE
    CDEF:smoke1=cp1,UN,UNKN,cp20,cp1,-,IF
    AREA:cp1
    STACK:smoke1#dddddd
    CDEF:smoke2=cp2,UN,UNKN,cp19,cp2,-,IF
    AREA:cp2
    STACK:smoke2#cacaca
    CDEF:smoke3=cp3,UN,UNKN,cp18,cp3,-,IF
    AREA:cp3
    STACK:smoke3#b7b7b7
    CDEF:smoke4=cp4,UN,UNKN,cp17,cp4,-,IF
    AREA:cp4
    STACK:smoke4#a4a4a4
    CDEF:smoke5=cp5,UN,UNKN,cp16,cp5,-,IF
    AREA:cp5
    STACK:smoke5#919191
    CDEF:smoke6=cp6,UN,UNKN,cp15,cp6,-,IF
    AREA:cp6
    STACK:smoke6#7e7e7e
    CDEF:smoke7=cp7,UN,UNKN,cp14,cp7,-,IF
    AREA:cp7
    STACK:smoke7#6b6b6b
    CDEF:smoke8=cp8,UN,UNKN,cp13,cp8,-,IF
    AREA:cp8
    STACK:smoke8#585858
    CDEF:smoke9=cp9,UN,UNKN,cp12,cp9,-,IF
    AREA:cp9
    STACK:smoke9#454545
    CDEF:smoke10=cp10,UN,UNKN,cp11,cp10,-,IF
    AREA:cp10
    STACK:smoke10#323232
    DEF:median=/var/lib/smokeping/TWC/100_Maiden_Ln.rrd:median:AVERAGE
    CDEF:ploss=loss,20,/,100,*
    VDEF:avmed=median,AVERAGE
    CDEF:mesd=median,POP,avmed,0,/
    GPRINT:avmed:median rtt\: %.1lf %ss avg
    GPRINT:median:MAX:%.1lf %ss max
    GPRINT:median:MIN:%.1lf %ss min
    GPRINT:median:LAST:%.1lf %ss now
    COMMENT:0.0 ms sd
    GPRINT:mesd:AVERAGE:%.1lf %s am/s\l
    LINE1:median#202020
    GPRINT:ploss:AVERAGE:packet loss\: %.2lf %% avg
    GPRINT:ploss:MAX:%.2lf %% max
    GPRINT:ploss:MIN:%.2lf %% min
    GPRINT:ploss:LAST:%.2lf %% now\l
    COMMENT:loss color\:
    CDEF:me0=loss,-1,GT,loss,0,LE,*,1,UNKN,IF,median,*
    CDEF:meL0=me0,6e-09,-
    CDEF:meH0=me0,0,*,6e-09,2,*,+
    AREA:meL0
    STACK:meH0#26ff00:0
    CDEF:me1=loss,0,GT,loss,1,LE,*,1,UNKN,IF,median,*
    CDEF:meL1=me1,6e-09,-
    CDEF:meH1=me1,0,*,6e-09,2,*,+
    AREA:meL1
    STACK:meH1#00b8ff:1/20
    CDEF:me2=loss,1,GT,loss,2,LE,*,1,UNKN,IF,median,*
    CDEF:meL2=me2,6e-09,-
    CDEF:meH2=me2,0,*,6e-09,2,*,+
    AREA:meL2
    STACK:meH2#0059ff:2/20
    CDEF:me3=loss,2,GT,loss,3,LE,*,1,UNKN,IF,median,*
    CDEF:meL3=me3,6e-09,-
    CDEF:meH3=me3,0,*,6e-09,2,*,+
    AREA:meL3
    STACK:meH3#5e00ff:3/20
    CDEF:me4=loss,3,GT,loss,4,LE,*,1,UNKN,IF,median,*
    CDEF:meL4=me4,6e-09,-
    CDEF:meH4=me4,0,*,6e-09,2,*,+
    AREA:meL4
    STACK:meH4#7e00ff:4/20
    CDEF:me10=loss,4,GT,loss,10,LE,*,1,UNKN,IF,median,*
    CDEF:meL10=me10,6e-09,-
    CDEF:meH10=me10,0,*,6e-09,2,*,+
    AREA:meL10
    STACK:meH10#dd00ff:10/20
    CDEF:me19=loss,10,GT,loss,19,LE,*,1,UNKN,IF,median,*
    CDEF:meL19=me19,6e-09,-
    CDEF:meH19=me19,0,*,6e-09,2,*,+
    AREA:meL19
    STACK:meH19#ff0000:19/20
    COMMENT: \l
    HRULE:0#000000
    COMMENT:probe\: 20 ICMP Echo Pings (56 Bytes) every 300s
    COMMENT:end\: Wed Apr 24 11\:54\:14 2013\j

    Let me know if you need any additional information.

    I’m also running Ubuntu and installed Smokeping using your commands outlined in the post.

    Thank you for your help

  2. Vero says:

    Thanks! Very easy howto 🙂

  3. On Ubuntu 13.10 there is a fix that needs to be applied otherwise the graphic images are not displayed.

    I go this from http://www.gattis.org/Work-and-Tech/service-monitoring-and-security/monitoring/smokeping

    # Install smokeping and sendmail (the latter is required to be present because of a smokeping bug)
    sudo apt-get install smokeping sendmail

    # Link in the smokeping apache config (apache2 was installed above as a req for smokeping)
    cd /etc/apache2/conf-available
    sudo ln -s ../../smokeping/apache2.conf smokeping.conf

    # Enable the config and mod_cgi
    sudo a2enconf smokeping
    sudo a2enmod cgid

    service apache2 reload

  4. Ryan Millavec says:

    This helped me a lot. Thank you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: