Xymon Mailing List Archive search

Change graphing on Trends link

8 messages in this thread

list David Gilmore · Mon, 30 Jan 2006 11:47:18 -0500 ·
Is it possible to change the graphing on the trends link to 1 week instead
of 48 hrs?  Or is it possible to have multiple graphs on this page?
 
David Gilmore
Consultant
Stenhouse Consulting, LLC.
X Traverse St
Providence, RI   XXXXX
XXX.XXX.XXXX
XXX.XXX.XXXX (fax)
list David Gilmore · Mon, 30 Jan 2006 16:18:47 -0500 ·
I should have been a clearer in my post here.  When clicking on the graph in
the Trends page, is there a way to change the default historical times?
Instead of 48 hrs, 12 days, 48 days, and 576 days, can the graphs be set to
24 hrs, 7 days, 30 days, 365 days?
 
Thanks,
 
Dave
 

From: hobbit-return-5459-david=user-9e293dd11111@xymon.invalid
[mailto:hobbit-return-5459-david=user-9e293dd11111@xymon.invalid] On Behalf
Of David Gilmore
Sent: Monday, January 30, 2006 11:47 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] Change graphing on Trends link
quoted from David Gilmore


Is it possible to change the graphing on the trends link to 1 week instead
of 48 hrs?  Or is it possible to have multiple graphs on this page?
 
David Gilmore
Consultant
Stenhouse Consulting, LLC.
X Traverse St
Providence, RI   XXXXX
XXX.XXX.XXXX
XXX.XXX.XXXX (fax)
list Ralph Mitchell · Tue, 31 Jan 2006 01:13:10 -0600 ·
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
quoted from David Gilmore


On 1/30/06, David Gilmore <user-70507ff7198d@xymon.invalid> wrote:
I should have been a clearer in my post here.  When clicking on the graph in
the Trends page, is there a way to change the default historical times?
Instead of 48 hrs, 12 days, 48 days, and 576 days, can the graphs be set to
24 hrs, 7 days, 30 days, 365 days?

Thanks,

Dave
list David Gilmore · Wed, 1 Feb 2006 16:25:01 -0500 ·
Ralph,

I gave your suggestion a shot today, and just when I think I am making
progress learning Linux, I get slapped in the face.  I found the
hobbitgraph.c and made the changes as you outlined below.  I then went to
the parent directory (hobbit-4.1.2p1) and ran make, but it errored out with
error:2.  I checked the mod date on the hobbitgraph.cgi file and it was
still set to the date that I originally compiled the program.  I am running
Hobbit on FC4.  Any suggestions?

Thanks,

Dave
 
-----Original Message-----
From: hobbit-return-5463-david=user-9e293dd11111@xymon.invalid [mailto:hobbit-return-5463-david=stenhouseconsulting.com at hswn.
dk] On Behalf Of Ralph Mitchell
Sent: Tuesday, January 31, 2006 2:13 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Clarification: Change graphing on Trends link
quoted from Ralph Mitchell

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


On 1/30/06, David Gilmore <user-70507ff7198d@xymon.invalid> wrote:
I should have been a clearer in my post here.  When clicking on the > graph in the Trends page, is there a way to change the default historical times?
Instead of 48 hrs, 12 days, 48 days, and 576 days, can the graphs be > set to
24 hrs, 7 days, 30 days, 365 days?

Thanks,

Dave
list Ralph Mitchell · Wed, 1 Feb 2006 20:34:10 -0600 ·
Hmmm.  All I can think of is that I made the changes in the original
tree that I installed hobbit from, just a few weeks ago.  I'd already
done all the configuration steps and installed a working hobbit server
from that tree, then went back and made the graph changes, then re-ran
make.

Were you working from a just-unpacked hobbit tree??  That might
account for your problem.  Other than that, I don't know why it would
be different.  I'm working from 4.1.2p1 too.

Ralph
quoted from David Gilmore


On 2/1/06, David Gilmore <user-70507ff7198d@xymon.invalid> wrote:
Ralph,

I gave your suggestion a shot today, and just when I think I am making
progress learning Linux, I get slapped in the face.  I found the
hobbitgraph.c and made the changes as you outlined below.  I then went to
the parent directory (hobbit-4.1.2p1) and ran make, but it errored out with
error:2.  I checked the mod date on the hobbitgraph.cgi file and it was
still set to the date that I originally compiled the program.  I am running
Hobbit on FC4.  Any suggestions?

Thanks,

Dave
list David Gilmore · Wed, 1 Feb 2006 22:03:17 -0500 ·
Being the newb that I am, I think I just realized what I might have done
wrong.  I created a hobbit account and ran the installation configure and
make as hobbit, make install under su.  But I have been logging in as root
on the system so that I could edit the config files and scripts.  Maybe that
is why the make failed?  I was working from the same tree.

Dave
 
-----Original Message-----
From: hobbit-return-5487-david=user-9e293dd11111@xymon.invalid [mailto:hobbit-return-5487-david=stenhouseconsulting.com at hswn.
dk] On Behalf Of Ralph Mitchell
Sent: Wednesday, February 01, 2006 9:34 PM
quoted from Ralph Mitchell
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Clarification: Change graphing on Trends link

Hmmm.  All I can think of is that I made the changes in the original tree that I installed hobbit from, just a few weeks ago.  I'd already done all the configuration steps and installed a working hobbit server from that tree, then went back and made the graph changes, then re-ran make.

Were you working from a just-unpacked hobbit tree??  That might account for your problem.  Other than that, I don't know why it would be different.  I'm working from 4.1.2p1 too.

Ralph


On 2/1/06, David Gilmore <user-70507ff7198d@xymon.invalid> wrote:
Ralph,

I gave your suggestion a shot today, and just when I think I am making > progress learning Linux, I get slapped in the face.  I found the > hobbitgraph.c and made the changes as you outlined below.  I then went > to the parent directory (hobbit-4.1.2p1) and ran make, but it errored > out with error:2.  I checked the mod date on the hobbitgraph.cgi file > and it was still set to the date that I originally compiled the > program.  I am running Hobbit on FC4.  Any suggestions?

Thanks,

Dave
list Ralph Mitchell · Wed, 1 Feb 2006 22:09:12 -0600 ·
That's possible.  You might have a file now owned by root that make
can't update.  Personally, I created the hobbit userid, went through
the entire installation process as root, then set up a startup script
that su's to hobbit to start the server.
quoted from David Gilmore

Ralph


On 2/1/06, David Gilmore <user-70507ff7198d@xymon.invalid> wrote:
Being the newb that I am, I think I just realized what I might have done
wrong.  I created a hobbit account and ran the installation configure and
make as hobbit, make install under su.  But I have been logging in as root
on the system so that I could edit the config files and scripts.  Maybe that
is why the make failed?  I was working from the same tree.

Dave
list David Gilmore · Thu, 2 Feb 2006 16:29:05 -0500 ·
Ralph,

That was it!  Thanks for the help.

Dave
 
-----Original Message-----
From: hobbit-return-5489-david=user-9e293dd11111@xymon.invalid [mailto:hobbit-return-5489-david=stenhouseconsulting.com at hswn.
dk] On Behalf Of Ralph Mitchell
Sent: Wednesday, February 01, 2006 11:09 PM
quoted from Ralph Mitchell
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Clarification: Change graphing on Trends link

That's possible.  You might have a file now owned by root that make can't update.  Personally, I created the hobbit userid, went through the entire installation process as root, then set up a startup script that su's to hobbit to start the server.

Ralph


On 2/1/06, David Gilmore <user-70507ff7198d@xymon.invalid> wrote:
Being the newb that I am, I think I just realized what I might have > done wrong.  I created a hobbit account and ran the installation > configure and make as hobbit, make install under su.  But I have been > logging in as root on the system so that I could edit the config files > and scripts.  Maybe that is why the make failed?  I was working from the same tree.

Dave