<div dir="ltr"><div dir="ltr">Hola. </div><div dir="ltr">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.<div>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.</div><div><br></div><div>rrdtool graph x -s -$TIEMPO -e now DEF:v=$FILE_RRD:median:AVERAGE VDEF:vm=v,AVERAGE PRINT:vm:%lf | tail -n 1</div><div><br>Eso te da el rtt, multiplicalo por 1000 para tenerlo en milisegundos.</div><div><br></div><div>rrdtool graph x -s -$TIEMPO -e now DEF:v=$FILE_RRD:loss:AVERAGE VDEF:vm=v,AVERAGE PRINT:vm:%lf | tail -n 1 </div><div><br></div><div>Eso te da el packet loss.</div><div><br></div><div>La variable TIEMPO va en el formato 1h, 2h, 1d, etc y FILE_RRD es el fichero rrd usualmente /var/lib/smokeping/.....</div><div><br></div><div>Espero te sirva de algo.</div><div><br></div><div>Saludos</div><div><br></div><div><br></div><div> <br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, 5 Nov 2018 at 12:46, Gregory Sloop <<a href="mailto:gregs@sloop.net">gregs@sloop.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<span style="font-family:'Courier New';font-size:9pt">So, I had an odd case in the last couple of weeks.<br>
<br>
Pretext:<br>
---<br>
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.<br>
<br>
[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.]<br>
<br>
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. <br>
<br>
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.]<br>
<br>
Problem/solution:<br>
---<br>
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.<br>
<br>
Yet, I'm a total hack when it comes to coding. So, I need all the help I can get.<br>
<br>
I'm wanting to tweak a Nagios plug-in that uses the smokeping RRD's so that it queries average latencies.<br>
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?]<br>
<br>
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.<br>
<br>
---<br>
Or perhaps someone has a better idea, that gets at the same general problem.<br>
<br>
TIA!<br>
-Greg</span></div>_______________________________________________<br>
smokeping-users mailing list<br>
<a href="mailto:smokeping-users@lists.oetiker.ch" target="_blank">smokeping-users@lists.oetiker.ch</a><br>
<a href="https://lists.oetiker.ch/cgi-bin/listinfo/smokeping-users" rel="noreferrer" target="_blank">https://lists.oetiker.ch/cgi-bin/listinfo/smokeping-users</a><br>
</blockquote></div>