[hobbit] Custom graphs: Changing default "Last 48 hours" timeframe

Haertig, David F (Dave) haertig at avaya.com
Wed May 30 20:58:01 CEST 2007


Thanks.  I can handle the C modifications.  Looks like the default
graphing options are hardcoded, and apply to all graphs.  The defaults
seem a bit odd ... I like your 24h, 7d, 30d, 365d ones better.  I assume
the 576d original max default value goes hand-in-hand with some
hardcoded default used to set up the RRD data file.

While it might be nice to change the graphs with config settings rather
than code changes, it sure is convenient the way Hobbit does all the
setup for you without you really having to learn much about rrdtools.
If I had to pick flexibility or convenience in this matter, I'd vote for
keeping Hobbit's convenience the way it is.

Don't know if I'll actually go and modify the C code.  It would be very
easy to do, but it complicates future Hobbit upgrades, especially if
support of what I do is inherited by someone else later, and that person
doesn't happen to be a coder.

Thanks!

-----Original Message-----
From: David Gilmore [mailto:david at stenhouseconsulting.com] 
Sent: Wednesday, May 30, 2007 12:26 PM
To: hobbit at hswn.dk
Subject: RE: [hobbit] Custom graphs: Changing default "Last 48 hours"
timeframe

David,

Not sure if this helps you, but I change my graphs to reflect 24h, 7d,
30d, and 365d using this info below:

I don't know if that could be done in a config file, but it certainly
can be done by altering the source. Take a look at
hobbitd/hobbitgraph.c. Near the top there's a bunch of defines that tell
rrdtool how to select the data:
#define HOUR_GRAPH "e-48h"
#define DAY_GRAPH "e-12d"
#define WEEK_GRAPH "e-48d"
#define MONTH_GRAPH "e-576d"
"e-48h" means "end-of-data minus 48 hours", which is the start of the
range, the end of the range being the end of the data. Change those
numbers to whatever suits you best - i.e. e-24h, e-7d, e-30d & e-365d.
You'll also want to look further down for blocks like this:
if (strcmp(val, "hourly") == 0) {
period = HOUR_GRAPH;
persecs = 48*60*60;
gtype = strdup(val);
glegend = "Last 48 Hours";
}
and fix those up. I guess that would be:
persecs = 24*60*60;
and
glegend = "Last 24 Hours";
for the 24 hour graph. Similarly for DAY_GRAPH, WEEK_GRAPH &
MONTH_GRAPH. Go back up to the main source directory and re-run make,
then copy hobbitd/hobbitgraph.cgi over to hobbit's server/bin directory.
Seems to work fine for me - I might even keep it like this... :) Ralph
Mitchell

Regards,

David


-----Original Message-----
From: Haertig, David F (Dave) [mailto:haertig at avaya.com]
Sent: Wednesday, May 30, 2007 2:18 PM
To: hobbit at hswn.dk
Subject: [hobbit] Custom graphs: Changing default "Last 48 hours"
timeframe

I need to look at my custom graphs with a higher resolution (shorter
timeframe) than the default "Last 48 hours".

I tried the changes below in hobbitgraph.cfg (appended ":start=end-4h"
to the DEF entries), but this didn't make any difference.  I was
attempting to get a "Last 4 hours" display.

...
[recent]
        TITLE Incoming Cases
        YAXIS Count
        DEF:five=recent.rrd:five:AVERAGE:start=end-4h
        DEF:ten=recent.rrd:ten:AVERAGE:start=end-4h
        DEF:fifteen=recent.rrd:fifteen:AVERAGE:start=end-4h
        DEF:twenty=recent.rrd:twenty:AVERAGE:start=end-4h
...

I also tried "end=start+4h", not expecting that to give me what I
wanted, but as a test to see if I could get a four hour window
displayed.  This directive appeared to be ignored as well.  The display
always shows "Last 48 hours".

To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe at hswn.dk



To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe at hswn.dk



More information about the Xymon mailing list