How to configure Smokeping alerts


SmokePing keeps track of your network latency:

  • Best of breed latency visualisation.
  • Interactive graph explorer.
  • Wide range of latency measurement plugins.
  • Master/Slave System for distributed measurement.
  • Highly configurable alerting system.
  • Live Latency Charts with the most ‘interesting’ graphs.
  • Free and OpenSource Software written in Perl written by Tobi Oetiker, the creator of MRTG and RRDtool

Another great feature of smokeping is the ability to write your own Alert rules and them have smokeping email when a rule is fired. Very useful 😀 The guide for this is taken from an Ubuntu 10.04 server but the config should be pretty much the same on any *nix (some linux versions contain all these elements in a single config file).

First off we write our rules in /etc/smokeping/config.d/Alerts. I only use two rules at the moment for basic checking/alerting. Not the use of edgetrigger. This means a rule only send alerts when its state changes I.e one email to report the fault raised and one to report cleared. If you dont use this a mail will be sent every 5 minutes when the rule is triggering.

*** Alerts ***
# This is an Alias on the machine
to = smokealert@localhost
from =

# This rule checks for 3 periods (3 * 5min default) where
# the rtt is >70ms
type = rtt
# in milli seconds
pattern = >70,>70,>70
edgetrigger = yes
comment = On backup circuit maybe?

# This rule checks for one period (1 * 5mins) of >60% loss
type = loss
# in percent
pattern = >60%
edgetrigger = yes
comment = Massive loss for 5 mins

From the rules above I send Alerts to a local alias. This is so I can easily send mails to multiple mailboxes. I do this by editing the aliases file vi /etc/aliases adding the line below then running the newaliases command to register the aliase

smokealert: :include:/etc/smokeping/config.d/userstoalert

Then I have a file with an email address on each line at /etc/smokeping/config.d/userstoalert. So e.g.


Now just edit the Targets and apply the rules to the hosts you want /etc/smokeping/config.d/Targets.

++ Google
menu = Google
title =
host =
alerts = hostdown

++ m00nie
menu = m00nie
title = m00nie
host =
alerts = rttdetect,hostdown

Now simply restart the smokeping service (service smokeping restart) and your good to go 🙂

Example of an email alert received.

Thu Jul 5 02:28:17 2012

Alert “hostdown” was raised for

> 60%

Data (old –> now)
loss: 0%, 0%, 0%, 100%
rtt: 21ms, 22ms, 21ms, U

Massive loss for 5 mins

m00nie 😀


  • I use smokeping and it works great. But I want to translate the mail text, because phrases like
    “[SmokeAlert] offline is active on Server1”
    doesnt sound good.

    Do you know where to find these text for editing them? Regards from Frankfurt, Germany

  • Hi Christian

    Sorry its not something I’ve ever done but if there is a “comment = blah” you can configure for each alert that might include a description your looking for. If you do find what your looking for it would be good to know 🙂


  • Hola, muy bueno el articulo.
    He logrado hacer funcionar el server, pero no puedo lograr que envíe un mail ante una alerta. He configurado todo lo posible y nada. Podrás ayudarme?

  • Hi Esteban

    Might be worth checking the mail log which is probably /var/log/maillog for any info that might help debug mail problems? 🙂


  • Gracias por la respuesta.
    En mi Debian existe /var/log/mail.err,.info, .log, .warn, pero estan vacíos.
    “tSmoke –testamail” envía exitosamente un email a la casilla configurada en “Alerts”
    /var/log/messages muestra alertas desplegadas por smokeping.
    Sin embargo smokeping –debug devuelve “no match” para cada target, aunque haya alarma.
    ¿Alguna idea?

  • Esteban,

    Me ocurria lo mismo y pensaba que era un error, pero en realidad lo que esta diciendo es que no hay alerta para ese target.


  • Gracias por contestar Jorge, lo que ocurre es que efectivamente hay alarmas evidentes, pero el debug no los ve, y por tanto no me manda el mail.

  • Hi Tommy

    Edgetrigger just means you get a mail/alert on a state change e.g. from no fault -> fault or fault -> no fault would send an alert/mail. Of you dont configure edgetrigger you get an alert/mail every 5mins!
    Hope that helps



  • Kamil, not necessarily, you can have “groups” in smokeping and setup the alerts there instead of each host. In you Targets file, you can have:
    + Internet
    menu = Internet
    title = Internet
    alerts = rttdetect,hostdown

    ++ Host1
    menu = My 1st host
    title = My 1st host
    host =

    ++ Host2
    menu = My 2nd host
    title = My 2nd host
    host =

    Then the alerts defined in the group “Internet” will apply on “Host1” and “Host2”.

  • Hi,
    I meet one problem. When I change server host name I always got duplicated mail alert with the same content. One is from old server host name and one more is from new server host name. I have tried clear and reconfigure for mail alert but no lucky. Any one know to how to fix it, pls help me?

    Here is example:

    1. Old server host name:
    2. New server host name:

    with the same content.

    I am looking forward to hearing from you soon. Many thanks

  • Hi,

    I meet one problem. When I changed my server host name to new server host name I always got duplicated mail alert, one from old server host name and one more from new server host name with the same content. I really need solution for that. Anyone know how to fix it, pleas help me?

    Here is example:
    1. old server host name:
    2. new server host name:
    with the same content.

    I am looking forward to hearing from you soon. Many thanks.


  • Hey m00nie,

    Thanks for the advise. I’ve alerting configured, thresholds and and receiving mail when they are triggered etc. Wondering though if it’s possible to mail Person A if host X has packet loss and Person B is host Y has packet loss. Doesn’t seem to be possible from the Alerts file and wondering if it can be done for specific hosts in the targets file?

    Thanks in Advance,

Leave a Reply

Your email address will not be published. Required fields are marked *