How to integrate Hobbit and MRTG
list Henrik Størner
I've been playing about with MRTG today, and found out that adding MRTG graphs to the Hobbit set of graphs was a very simple task. Since this is probably something that others can use, I've written up a short description of how to do it: http://www.hswn.dk/hobbit/help/hobbit-mrtg.html The short story is that you can configure MRTG so that it stores its datafiles in RRDtool format directly into the directory where Hobbit looks for all of the other RRD files for a host. So with a "mrtg" entry in the hobbitgraph.cfg file and an extra entry for "mrtg" in hobbitserver.cfg's GRAPHS setting, I've got the MRTG graphs showing up as normal Hobbit graphs on the "trends" page: http://www.hswn.dk/hobbit-cgi/bb-hostsvc.sh?HOSTSVC=fenris,hswn,dk.trends&IP=172.16.10.254&DISPLAYNAME=fenris.hswn.dk (a bit down that page, 3rd and 4th last graphs) The detailed view is here: http://www.hswn.dk/hobbit-cgi/hobbitgraph.sh?host=fenris.hswn.dk&service=mrtg&first=1&count=1&action=menu I did make one simple tweak to the Hobbit code for this - hobbitgraph normally bundles graphs into bunches of 5, which doesn't work well for the MRTG graphs. So I made the "5" configurable so I could get one graph per network interface. I think it's neat :-) Henrik
list Kevin Grady
Nice work henrik. I was just working the bb mrtg script from deadcat, but this looks like a better way to go. Now you just need to get hobbit to make toast in the morning...
▸
On Wed, 23 Mar 2005 17:48:54 +0100, Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> wrote:I've been playing about with MRTG today, and found out that adding MRTG graphs to the Hobbit set of graphs was a very simple task. Since this is probably something that others can use, I've written up a short description of how to do it: http://www.hswn.dk/hobbit/help/hobbit-mrtg.html The short story is that you can configure MRTG so that it stores its datafiles in RRDtool format directly into the directory where Hobbit looks for all of the other RRD files for a host. So with a "mrtg" entry in the hobbitgraph.cfg file and an extra entry for "mrtg" in hobbitserver.cfg's GRAPHS setting, I've got the MRTG graphs showing up as normal Hobbit graphs on the "trends" page: http://www.hswn.dk/hobbit-cgi/bb-hostsvc.sh?HOSTSVC=fenris,hswn,dk.trends&IP=172.16.10.254&DISPLAYNAME=fenris.hswn.dk (a bit down that page, 3rd and 4th last graphs) The detailed view is here: http://www.hswn.dk/hobbit-cgi/hobbitgraph.sh?host=fenris.hswn.dk&service=mrtg&first=1&count=1&action=menu I did make one simple tweak to the Hobbit code for this - hobbitgraph normally bundles graphs into bunches of 5, which doesn't work well for the MRTG graphs. So I made the "5" configurable so I could get one graph per network interface. I think it's neat :-) Henrik
list Henrik Størner
▸
On Wed, Mar 23, 2005 at 11:54:30AM -0500, Kevin Grady wrote:
Nice work henrik. I was just working the bb mrtg script from deadcat, but this looks like a better way to go.
Thanks!
Now you just need to get hobbit to make toast in the morning...
For that specific task, I have a much better solution. Henrik
list Henrik Størner
▸
On Wed, Mar 23, 2005 at 05:48:54PM +0100, Henrik Stoerner wrote:
I've been playing about with MRTG today
A patch against Hobbit RC6 is avaiable at http://www.hswn.dk/beta/postRC6-mrtg.patch This adds the "mrtg" entry to hobbitgraph.cfg, changes the default "GRAPHS" setting in hobbitserver.cfg (just add ",mrtg::1" to the entry in your file), and makes bb-larrdcolumn recognize the "::1" syntax for Hobbit. Install with cd hobbit-4.0-RC6 patch -p0 </tmp/postRC6-mrtg.patch make Then stop Hobbit, do "make install" as root, and start Hobbit. Henrik
list John A. Milburn
▸
-----Original Message----- From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid] Sent: Wednesday, March 23, 2005 11:07 AM To: user-ae9b8668bcde@xymon.invalid Subject: Re: [hobbit] How to integrate Hobbit and MRTG On Wed, Mar 23, 2005 at 05:48:54PM +0100, Henrik Stoerner wrote:
I've been playing about with MRTG today
A patch against Hobbit RC6 is avaiable at http://www.hswn.dk/beta/postRC6-mrtg.patch This adds the "mrtg" entry to hobbitgraph.cfg, changes the default "GRAPHS" setting in hobbitserver.cfg (just add ",mrtg::1" to the entry in your file), and makes bb-larrdcolumn recognize the "::1" syntax for Hobbit. Install with cd hobbit-4.0-RC6 patch -p0 </tmp/postRC6-mrtg.patch make Then stop Hobbit, do "make install" as root, and start Hobbit. Henrik
Will this interfere with bbmrtg.pl?
I am currently using it with mrtg-rrd.cgi to generate graphs as needed.
list Daniel J McDonald
▸
On Wed, 2005-03-23 at 17:48 +0100, Henrik Stoerner wrote:
I've been playing about with MRTG today, and found out that adding MRTG graphs to the Hobbit set of graphs was a very simple task. Since this is probably something that others can use, I've written up a short description of how to do it: http://www.hswn.dk/hobbit/help/hobbit-mrtg.html The short story is that you can configure MRTG so that it stores its datafiles in RRDtool format directly into the directory where Hobbit looks for all of the other RRD files for a host.
That's ok for a few, but it won't scale terribly well. I have over 5000 points that I am currently monitoring with mrtg. I have that broken down into a three tier directory structure (region - site - device), with all of the thresholds and alerting from bbmrtg.pl. Is there a way I can point to my existing rrd directory structure for the graphing bit - which bbmrtg.pl doesn't do terribly well - but still keep my stuff in its nice hierarchy?
list Paul Williamson
user-290ce4e24e19@xymon.invalid 03/23/05 12:37 PM >>>
▸
That's ok for a few, but it won't scale terribly well. I have over 5000 points that I am currently monitoring with mrtg. I have that broken down into a three tier directory structure (region - site - device), with all of the thresholds and alerting from bbmrtg.pl.
I'd agree. If you've got less than ~100 systems/devices, this would be fine. If you want to do much more than that, you'll want a separate hobbitgraph process to handle this.
Is there a way I can point to my existing rrd directory structure for the graphing bit - which bbmrtg.pl doesn't do terribly well - but still keep my stuff in its nice hierarchy?
Sure, leave it up to you to find a way to make things difficult, eh? LOL! I've tried this a couple of way without much luck. I'll be working on it tonight to see if there's a way...there's got to be a way... Paul
list Henrik Størner
▸
On Wed, Mar 23, 2005 at 11:25:43AM -0600, Milburn, John A. wrote:
Will this interfere with bbmrtg.pl? I am currently using it with mrtg-rrd.cgi to generate graphs as needed.
I dont think it will interfere. First, it only triggers if you actually configure MRTG to save the data it collects in an RRD-file in the Hobbit directory. Not something you would do by accident, I think. Second, the way bbmrtg.pl works (as far as I know) is to send a status message that includes links directly to the MRTG-generated graphics. It doesn't use the Hobbit graph-tool. So I don't think there will be any problem in using bbmrtg.pl with Hobbit after this. Henrik
list Henrik Størner
▸
On Wed, Mar 23, 2005 at 11:37:19AM -0600, Daniel J McDonald wrote:
That's ok for a few, but it won't scale terribly well. I have over 5000 points that I am currently monitoring with mrtg. I have that broken down into a three tier directory structure (region - site - device), with all of the thresholds and alerting from bbmrtg.pl.
OK, I haven't user-183fc83ac81e@xymon.invalid in much detail, and it clearly does a lot more than just provide access to the graphs.
▸
Is there a way I can point to my existing rrd directory structure for the graphing bit - which bbmrtg.pl doesn't do terribly well - but still keep my stuff in its nice hierarchy?
Hmm ... well, hobbitgraph.cgi is actually fairly agnostic about what
kind of data it gets. If you've got data in RRDtool format, it should
be possible to generate the graphs with that.
(Note - I just checked the hobbitgraph.cgi man-page, and it's missing
some updates. There's an extra CGI parameter that is needed to
actually make it do something. I'll get that updated).
If you have an RRD file /var/lib/foo/mydata.rrd that you want to
graph, then you call hobbitgraph.cgi with
REQUEST_URI="" \
QUERY_STRING="host=something&service=mydata&graph=hourly&action=view" \
hobbitgraph.cgi --rrddir=/var/lib/foo
Normally when hobbitgraph.cgi runs as a CGI script, REQUEST_URI is
setup automatically.
For this to work, you must have a graph definition in hobbitgraph.cfg
that defines how a "mydata" graph is generated. The "service"
parameter is used as a key into the hobbitgraph.cfg definitions.
Regards,
Henrik