Xymon Mailing List Archive search

reporting

10 messages in this thread

list Larry Barber · Wed, 7 Nov 2007 14:19:08 -0600 ·
What would it take to get the availability and snapshot reports to behave
the same way the event log, configuration and  metrics report do when
invoked from other than the top page? That is, when invoked from a given
page only the servers listed on that page, or below, would be included in
the report. I work in a data center that has several different customers who
would like to use these reports, but we cannot let them since they would be
able to view data for other peoples machines.

Thanks,
Larry Barber
list Henrik Størner · Wed, 7 Nov 2007 23:38:30 +0100 ·
quoted from Larry Barber
On Wed, Nov 07, 2007 at 02:19:08PM -0600, Larry Barber wrote:
What would it take to get the availability and snapshot reports to behave
the same way the event log, configuration and  metrics report do when
invoked from other than the top page? That is, when invoked from a given
page only the servers listed on that page, or below, would be included in
the report. I work in a data center that has several different customers who
would like to use these reports, but we cannot let them since they would be
able to view data for other peoples machines.
It would take some major reworking of the report generator, which is the
same program that generates the regular Hobbit overall status webpages.
This is the absolutely oldest part of Hobbit (it dates back to version
1.0 of Hobbit's predecessor, bbgen) - 5 years old on Nov 22nd.

In my "master plan" I would like to rip out these static webpages, and
have everything generated dynamically, which would make this a very
simple thing to do.

Meanwhile, what I've done at work - we have the exact same issue as You
do - is to pre-generate reports with daily, weekly and monthly
availability figures. Thanks to some Apache group-access controls I can
then restrict peoples access to only those pages that they are allowed
to see - it goes like this:

<DirectoryMatch /var/lib/hobbit/www/periodic/(daily|weekly|monthly)/.*/Customer1>
   Require group admins customer1
</DirectoryMatch>

"admins" is ourselves, we can access everything. "customer1" is an
Apache group, which then holds the web logins that the customer uses.

Combined with putting these menu items in the "menu_items.js" file

  ['Daily Availability', 'http://hobbit.foo.com/hobbit-cgi/bb-datepage.sh?type=day';],
  ['Weekly Availability', 'http://hobbit.foo.com/hobbit-cgi/bb-datepage.sh?type=week';],
  ['Monthly Availability', 'http://hobbit.foo.com/hobbit-cgi/bb-datepage.sh?type=month';],

you get the result than when you pick one of these pre-built availability
reports from a web page, you're automatically directed to the same
customer page.


Henrik
list Larry Barber · Wed, 7 Nov 2007 17:07:11 -0600 ·
Thanks, that sounds workable.

Larry
quoted from Henrik Størner

On Nov 7, 2007 4:38 PM, Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> wrote:
On Wed, Nov 07, 2007 at 02:19:08PM -0600, Larry Barber wrote:
What would it take to get the availability and snapshot reports to
behave
the same way the event log, configuration and  metrics report do when
invoked from other than the top page? That is, when invoked from a given
page only the servers listed on that page, or below, would be included
in
the report. I work in a data center that has several different customers
who
would like to use these reports, but we cannot let them since they would
be
able to view data for other peoples machines.
It would take some major reworking of the report generator, which is the
same program that generates the regular Hobbit overall status webpages.
This is the absolutely oldest part of Hobbit (it dates back to version
1.0 of Hobbit's predecessor, bbgen) - 5 years old on Nov 22nd.

In my "master plan" I would like to rip out these static webpages, and
have everything generated dynamically, which would make this a very
simple thing to do.

Meanwhile, what I've done at work - we have the exact same issue as You
do - is to pre-generate reports with daily, weekly and monthly
availability figures. Thanks to some Apache group-access controls I can
then restrict peoples access to only those pages that they are allowed
to see - it goes like this:

<DirectoryMatch
/var/lib/hobbit/www/periodic/(daily|weekly|monthly)/.*/Customer1>
  Require group admins customer1
</DirectoryMatch>

"admins" is ourselves, we can access everything. "customer1" is an
Apache group, which then holds the web logins that the customer uses.

Combined with putting these menu items in the "menu_items.js" file

 ['Daily Availability', '

http://hobbit.foo.com/hobbit-cgi/bb-datepage.sh?type=day'<http://hobbit.foo.com/hobbit-cgi/bb-datepage.sh?type=day%27>;
],
 ['Weekly Availability', '
http://hobbit.foo.com/hobbit-cgi/bb-datepage.sh?type=week'<http://hobbit.foo.com/hobbit-cgi/bb-datepage.sh?type=week%27>;
],
 ['Monthly Availability', '
http://hobbit.foo.com/hobbit-cgi/bb-datepage.sh?type=month'<http://hobbit.foo.com/hobbit-cgi/bb-datepage.sh?type=month%27>;
quoted from Henrik Størner
],

you get the result than when you pick one of these pre-built availability
reports from a web page, you're automatically directed to the same
customer page.


Henrik

list Colin Coe · Thu, 26 Mar 2015 09:35:56 +0800 ·
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?

Thanks

CC
list Japheth Cleaver · Thu, 26 Mar 2015 14:27:51 -0700 ·
quoted from Colin Coe

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
list Colin Coe · Fri, 27 Mar 2015 09:59:53 +0800 ·
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
quoted from Japheth Cleaver


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
list Japheth Cleaver · Sun, 29 Mar 2015 20:37:14 -0700 ·
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
quoted from Colin Coe


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
list Jeremy Laidman · Mon, 30 Mar 2015 16:37:05 +1100 ·
quoted from Japheth Cleaver
On 30 March 2015 at 14:37, J.C. Cleaver <user-87556346d4af@xymon.invalid> wrote:
For the start and end options to rrdtool, it's actually expecting unix
epoch timestamps.
Actually, rrdgraph also has pretty good parsing, not necessarily requiring
epoch-times.  For example you can say:

   -s "end-1week" -e "now-2d"

meaning "from 2 days ago to one week before then".

and

  -s "-1week" -e "s+2d"

meaning "from 1 week ago to 2 days after then".  ("s"="start"; "e"="end";
"-1week" = "now-1week").

Can also specify dates in human-readable form as long as they comply with
the AT-STYLE time specification:

https://oss.oetiker.ch/rrdtool/doc/rrdfetch.en.html#IAT_STYLE_TIME_SPECIFICATION

I think the only error in this:

rrdtool fetch $I MAX -r 900 -s "12am Mar 1" -e "12am Mar 27" | egrep

is that you specified "12am" instead of "12:00am" and didn't specify a
year.  So try "12:00am Mar 1 2015" for your start time.  If you don't
specify a time of day, the year doesn't seem to be required, and I would
expect would default to the current year.

J
list Japheth Cleaver · Mon, 30 Mar 2015 09:13:20 -0700 ·
quoted from Jeremy Laidman

On Sun, March 29, 2015 10:37 pm, Jeremy Laidman wrote:
On 30 March 2015 at 14:37, J.C. Cleaver <user-87556346d4af@xymon.invalid> wrote:
For the start and end options to rrdtool, it's actually expecting unix
epoch timestamps.
Actually, rrdgraph also has pretty good parsing, not necessarily requiring
epoch-times.  For example you can say:

   -s "end-1week" -e "now-2d"

meaning "from 2 days ago to one week before then".

and

  -s "-1week" -e "s+2d"

meaning "from 1 week ago to 2 days after then".  ("s"="start"; "e"="end";
"-1week" = "now-1week").

Can also specify dates in human-readable form as long as they comply with
the AT-STYLE time specification:

https://oss.oetiker.ch/rrdtool/doc/rrdfetch.en.html#IAT_STYLE_TIME_SPECIFICATION

I think the only error in this:

rrdtool fetch $I MAX -r 900 -s "12am Mar 1" -e "12am Mar 27" | egrep

is that you specified "12am" instead of "12:00am" and didn't specify a
year.  So try "12:00am Mar 1 2015" for your start time.  If you don't
specify a time of day, the year doesn't seem to be required, and I would
expect would default to the current year.

J
Nifty! I stand corrected... Had no idea RRDtool's date parsing was that
advanced :)


-jc
list Colin Coe · Tue, 31 Mar 2015 05:16:19 +0800 ·
Many thanks guys, thanks a lot of good info.

CC
quoted from Japheth Cleaver

On Tue, Mar 31, 2015 at 12:13 AM, J.C. Cleaver <user-87556346d4af@xymon.invalid> wrote:

On Sun, March 29, 2015 10:37 pm, Jeremy Laidman wrote:
On 30 March 2015 at 14:37, J.C. Cleaver <user-87556346d4af@xymon.invalid> wrote:
For the start and end options to rrdtool, it's actually expecting unix
epoch timestamps.
Actually, rrdgraph also has pretty good parsing, not necessarily requiring
epoch-times.  For example you can say:

   -s "end-1week" -e "now-2d"

meaning "from 2 days ago to one week before then".

and

  -s "-1week" -e "s+2d"

meaning "from 1 week ago to 2 days after then".  ("s"="start"; "e"="end";
"-1week" = "now-1week").

Can also specify dates in human-readable form as long as they comply with
the AT-STYLE time specification:

https://oss.oetiker.ch/rrdtool/doc/rrdfetch.en.html#IAT_STYLE_TIME_SPECIFICATION

I think the only error in this:

rrdtool fetch $I MAX -r 900 -s "12am Mar 1" -e "12am Mar 27" | egrep

is that you specified "12am" instead of "12:00am" and didn't specify a
year.  So try "12:00am Mar 1 2015" for your start time.  If you don't
specify a time of day, the year doesn't seem to be required, and I would
expect would default to the current year.

J
Nifty! I stand corrected... Had no idea RRDtool's date parsing was that
advanced :)


-jc