Xymon Mailing List Archive search

Reporting

list Japheth Cleaver
Sun, 29 Mar 2015 20:37:14 -0700
Message-Id: <user-d71b6419a38c@xymon.invalid>

For the start and end options to rrdtool, it's actually expecting unix
epoch timestamps. That's probably why you're getting NaN.

The original command below was using GNU date to print out the timestamps
(it has some surprisingly smart heuristics for interpreting human-readable
date time phrases) as epochs using "+%s"

[@localhost /]$ date +%s
1427686424
[@localhost /]$ date +%s --date="1 week ago"
1427081625

Substitute the appropriate values there and I think what you have should
work. (If you're doing this via script instead of a one-liner, I'd just
set an earlier variable for them.)


HTH,

-jc


On Thu, March 26, 2015 6:59 pm, Colin Coe wrote:
Hi and many thanks for this.

Just trying to fit this to my needs, I actually just want a text
report, no graphs so I've changed it to:

for I in `ls -1 TAB*/tcp.conn.rrd`; do
echo `dirname $I`
rrdtool fetch $I MAX -r 900 -s "12am Mar 1" -e "12am Mar 27" | egrep
-v "nan|^ *sec$|^$"
done

Now, I know from looking at the graphs in Xymon that most of the TAB*
devices have a "MAX" value, however "rrdtool fetch" says that at every
interval, the value is "not a number".

Any ideas what I'm doing wrong?

Thanks

CC


On Fri, Mar 27, 2015 at 5:27 AM, J.C. Cleaver <user-87556346d4af@xymon.invalid>
wrote:

On Wed, March 25, 2015 6:35 pm, Colin Coe wrote:
Hi all

I've been asked to report on the usage of some devices (Windows 7
tablet computers).  I have not installed any agents but I've had them
in the hosts.cfg file for a couple of months.

All I need is to report on which devices have a 'conn' max of 0ms over
7, 14 and 28 days.

Any ideas how I can get this info in text format?
Well, it's definitely not *pretty*, but this (taken mostly from:
http://stackoverflow.com/questions/15964917/get-a-max-number-in-a-certain-period-from-a-rrd-file)
seemed to get the output needed from the raw RRD files:


[rhel6-x86-64 rrd]# for i in `ls */tcp.conn.rrd` ; do  echo -n "${i} " ;
rrdtool graph x -s `date +%s --date="1 week ago"` DEF:v=${i}:sec:MAX
VDEF:vm=v,MAXIMUM PRINT:vm:%lf ; done | perl -pe 's/0x0\s/= /sg' | sort
-nr -k 3
centos3-i386.build/tcp.conn.rrd = 0.264434
b.resolvers.Level3.net/tcp.conn.rrd = 0.135559
centos4-i386.build/tcp.conn.rrd = 0.126232
rhel5-i386.build/tcp.conn.rrd = 0.118713
google-public-dns-a.google.com/tcp.conn.rrd = 0.063940
ns1.google.com/tcp.conn.rrd = 0.063380
a.resolvers.Level3.net/tcp.conn.rrd = 0.049894
google-public-dns-b.google.com/tcp.conn.rrd = 0.035567
rhel5-x86-64.build/tcp.conn.rrd = 0.016195

etc...

That's a list of everything, then just filter out numerically as needed.
(Uses GNU date, but can be substituted with any epoch start/end points.)


This is definitely an area where Xymon could use some improvement. The
hostgraphs.cgi(1) script is a start, but there's a lot at the display
layer that could be done to gather interesting data from RRD for
searching, filtering, and report presentation.


HTH,

-jc