Archived community.zenoss.org | full text search
Skip navigation
Currently Being Moderated

Smokepingish Latency Graphs

VERSION 1 
Created on: Sep 14, 2009 11:21 AM by Noel Brockett - Last Modified:  Sep 14, 2009 11:21 AM by Noel Brockett
Okay, here's how to get some better latency graphs in zenoss. You can get something like:






This has only been tested on Ubuntu 7.10, and will probably need some tweaking to work on other platforms. Don't blame me if it doesn't work for you, just learn how to use sed and fix it accordingly.

Here's how you do it:

  1. Create a new template, give it a name.
  2. Create a new Datasource of "command" type. 
    • Set the Event Class to "/Cmd"
    • Set the Command Template as: /bin/ping -n -q -c 3 $devname | sed -n -e '/loss/p' -e '/rtt/p' | sed -e 's/.*\([0-9].*.% packet loss\).*/PING OK|loss=\1/;s/[0-9] received//;s/%//;s/, //;s/packet loss//' -e 's/rtt min\/avg\/max\/mdev = /min=/;s/ ms//;s/\// avg=/;s/\// max=/;s/\// mdev=/' | sed '/$$/ {;N;s/\n//}'

      EDIT by Crosse: I'll leave the above command in case my version doesn't work for everyone, but I noticed that it doesn't take into account duplicate replies (for instance, each node in a Microsoft NLB cluster will respond if you ping the cluster VIP). I needed to modify the command above to take into account the extra text when dupes are found: /bin/ping -n -q -c 3 $devname | sed -n -e '/loss/p' -e '/rtt/p' | sed -e 's/\(.*\),.*\+[0-9].*duplicates\(.*\)/\1\2/' | sed -e 's/.*\([0-9].*.% packet loss\).*/PING OK|loss=\1/;s/[0-9] received//;s/%//;s/, //;s/packet loss//' -e 's/rtt min\/avg\/max\/mdev = /min=/;s/ ms//;s/\// avg=/;s/\// max=/;s/\// mdev=/' | sed '/$$/ {;N;s/\n//}'

      Just FYI, in case this helps anyone else.

  3. You may want to change the -c flag to something higher if you want to send out more pings and get a more informative graph. Just make sure you can handle the extra load!
  4. Add the following Datapoints, leaving the default options for everything 
    • avg
    • min
    • max
    • mdev
    • loss
  5. Go to the top level of your template.
  6. Add a new Graph Defintion and give it a name (i.e. Latency).
  7. Set Units to ms and click on save
  8. Add Graph Points for each Datapoint (except loss), and change the graph views if you want to.
  9. Create another graph for Packet Loss.
  10. Bind the template to some device classes and watch the graphs grow!



As per request, I use the following settings for the graph points on the first graph above:

  1. 0) round trip average - area, #FF4500
  2. 1) round trip max - area, #FFA07A
  3. 2) mean deviation - line with width of 2,#010101
  4. 3) round trip min - area, #CD1200

Comments (3)