[smokeping-users] Pointers at code

Alessandro Palermo ok.aless at gmail.com
Mon Nov 5 17:10:16 CET 2018


Hola.
Hace un tiempo atrás tuve la necesidad de sacar reportes de algunas
métricas desde smokeping. Ya había algo hecho en algunos foros, pero nada
encajaba con lo que quería.
Te paso las funciones que utilice para obtener el average del rtt y packet
loss por ejemplo, no encontre de donde saque esta información y la verdad
fue hace bastante tiempo.

rrdtool graph x -s -$TIEMPO -e now DEF:v=$FILE_RRD:median:AVERAGE
VDEF:vm=v,AVERAGE PRINT:vm:%lf | tail -n 1

Eso te da el rtt, multiplicalo por 1000 para tenerlo en milisegundos.

rrdtool graph x -s -$TIEMPO -e now DEF:v=$FILE_RRD:loss:AVERAGE
VDEF:vm=v,AVERAGE PRINT:vm:%lf | tail -n 1

Eso te da el packet loss.

La variable TIEMPO va en el formato 1h, 2h, 1d, etc y FILE_RRD es el
fichero rrd usualmente /var/lib/smokeping/.....

Espero te sirva de algo.

Saludos











On Mon, 5 Nov 2018 at 12:46, Gregory Sloop <gregs at sloop.net> wrote:

> So, I had an odd case in the last couple of weeks.
>
> Pretext:
> ---
> In short, a particular host [it was the client's router] suddenly went
> into a state of VERY HIGH latency. Like 600-1000ms of latency. It stayed
> that way for days/weeks. Since most of my clients internet connections are
> essentially consumer grade connections and usage is pretty variable - I've
> tended to set the latency thresholds really high.
>
> [I don't actually send alerts on latency with smokeping, I do that with
> Nagios/OMD. But you'll see how that applies in a bit.]
>
> Even then, I've got the current latency thresholds set really high -
> because if the client starts uploading a huge set of files, latency is
> going to go through the roof, and I don't want alerts about "normal"
> conditions - especially if they're limited in duration. That big upload
> that lasts two hours is "normal." I don't want to get alerts about it. But
> if latency goes from 20ms to 60ms for 24 hours, then that would be worth
> knowing about.
>
> But there's no way to trigger in smokeping or Nagios on *average* data,
> only, really, on instantaneous measurements. [And yes I understand the
> triggers in smokeping are far more capable than those in Nagios - but even
> then, they still only get a small way there, IMO.]
>
> Problem/solution:
> ---
> So, where this brings me is that I realize that using the smokeping data,
> I could pull *average* latency over say 4/6/10/40 hours. That would be way
> more useful. Nagios could grab instantaneous latencies over say 4 hours,
> but not averages.
>
> Yet, I'm a total hack when it comes to coding. So, I need all the help I
> can get.
>
> I'm wanting to tweak a Nagios plug-in that uses the smokeping RRD's so
> that it queries average latencies.
> Is there someone [Tobi!?!] who could point me at some code that shows me
> how to query the RRD to get average latencies? [A particular
> file+line-number in the current source, perhaps?]
>
> And as I think about it more, average packet-loss and jitter would
> probably be really interesting things to look at too - not just latency.
>
> ---
> Or perhaps someone has a better idea, that gets at the same general
> problem.
>
> TIA!
> -Greg
> _______________________________________________
> smokeping-users mailing list
> smokeping-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/smokeping-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.oetiker.ch/pipermail/smokeping-users/attachments/20181105/c2f1fa32/attachment.html>


More information about the smokeping-users mailing list