[hobbit] Re: Custom RRD graphs
Dan Vande More
bigdan at gmail.com
Mon Nov 14 15:08:00 CET 2005
Oh man, I can't believe I missed that when you asked me. I almost
suffered from the same problem, too. You are right, those underscores
are not allowed and stripped out. You should be able to update your
rrd ds to not have underscores by exporting to xml (rrdtool dump
foo.rrd > foo.xml), search and replace, import from xml (rrdtool
restore foo.xml foo.rrd) to rrd.
On 11/14/05, Rich Smrcina <rsmrcina at wi.rr.com> wrote:
> OK, I think I've found the problem. The NCV routine strips out anything
> that isn't a letter or a number from the column name.
>
> I found this message in the log:
>
> 2005-11-13 22:01:21 RRD error updating
> /home/hobbit/data/rrd/vm1/pg_util.rrd from 192.168.201.1: unknown DS
> name 'pgutil'
>
> Dan Vande More wrote:
> > On 11/12/05, Rich Smrcina <rsmrcina at wi.rr.com> wrote:
> >
> >>Dan Vande More wrote:
> >>
> >>>Custom graphing (with ncv) is really a two step process. The first and
> >>>most important is collecting the data into an rrd, which is simple and
> >>>done by adding your COLUMNNAME=ncv to TEST2RRD and correctly passing
> >>>data back to hobbit:)
> >>>I used "rrdtool dump foo.rrd > tmp.xml" to verify that it was actually
> >>>collecting some data.
> >>>
> >>
> >>My rrd file isn't even being updated. That leads me to believe that
> >>something in the configuration process is missing or wrong.
> >
> >
> > Ok, I'll share how I "debugged" hobbit, but only if you promise not to
> > laugh. I'm a seek and destroy debugger, so I add printfs inside of
> > loops I think should be executed, and if they're not executed, I'll
> > find out why. Since this isn't perl, it's not as easy as 'print "I'm
> > executing loop foo...\n"'. Fortunately, Henrick has made it almost as
> > easy. Instead of print/printf/sprintf, hobbit has an errprintf
> > function that works quite handily.
> >
> > My recommendations are these:
> >
> > #1. Get into your hobbit source directory, I'd assume something like:
> > /home/hobbit/hobbit-4.1.2.
> > #2. Put a line in hobbitd/do_rrd.c on or about line 250 (Which is
> > where you see the if and else ifs, you want to be _above_ these. My
> > line is something like:
> >
> > ***
> > if (strcmp(id, "ncv") == 0) errprintf("hostname %s,
> > testname %s qualifies for an ncv with id %s\n", hostname, testname,
> > id);
> > ***
> > Note: There's a strcmp(id, ncv) later on, but it won't affect this test.
> >
> > #3. Now, assuing your TEST2RRD is working, hobbit will log that (more
> > on that later). A bit further down in do_rrd.c, if it matches ncv, it
> > will pass that on to a function appropriately named do_ncv_rrd(). Now,
> > edit hobbitd/rrd/do_ncv.c and add a line on our about line 32 that
> > says something like:
> >
> > ***
> > errprintf("hostname %s testname %s msg %s made ncv\n", hostname, testname, msg);
> > ***
> > (Just to know you got inside of the do_ncv function.)
> >
> > #4. On our about line 58, which is clearly after it assigns name &
> > value (From your msg: 'name : value' or 'name = value'), add a line
> > like:
> >
> > ***
> > errprintf("hostname %s testname %s msg %s had name/value of %s : %s",
> > hostname, testname, msg, name, value);
> > ***
> >
> > #5. Re-compile hobbit so these changes take effect. My line was something like:
> > ***
> > sudo make clean && sudo make && sudo make install && sudo rm
> > /var/log/hobbit/rrd-status.log && sudo -u hobbit
> > /home/hobbit/server/hobbit.sh stop && sudo -u hobbit
> > /home/hobbit/server/hobbit.sh start
> > **
> >
> > Ok, that's it. If any of your steps didn't log all of those messages,
> > it didn't make it that far. Troubleshoot these backwards. Now,
> > errprintf seems smart enought to know which module it's running under,
> > so it will log to the appropriate modules' log. In this case, you'll
> > find these messages under /var/log/hobbit/rrd-status.log. Look for the
> > tests you're running and if these lines show up in that log file.
> >
> > If I were any smarter, I would have made some kinda "if
> > (defined(debug_ncv)) errprintf(foo)" lines around these three (or
> > more) areas and submitted the diffs to the project for inclusion, but
> > alas, I was too hurried.
> >
> > If you get stuck or have questions, just ask.
> >
> > Good luck.
> >
> > Dan
> >
> >
> >
> >>>I would venture to guess that as long as your test/column names stay
> >>>the same, there will be no problems in switching from --extra-tests to
> >>>ncv.
> >>>
> >>>The second step, of course, is actually graphing it using data from
> >>>the rrd. I found this to be the most difficult step, if only because I
> >>>skim documentation - I don't read unless I'm desperate. Again, I'm
> >>>going out on a limb to say as long as your datasources/testnames/Y
> >>>values are all the same, your graph configuration should work post-ncv
> >>>conversion.
> >>>
> >>>Good luck
> >>>
> >>
> >>Thanks.
> >>
> >>
> >>>Dan
> >>>
> >>
> >>--
> >>Rich Smrcina
> >>VM Assist, Inc.
> >>Main: (262)392-2026
> >>Cell: (414)491-6001
> >>Ans Service: (360)715-2467
> >>rich.smrcina at vmassist.com
> >>
> >>Catch the WAVV! http://www.wavv.org
> >>WAVV 2006 - Chattanooga, TN - April 7-11, 2006
> >>
> >>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
> >
> >
> >
>
> --
> Rich Smrcina
> VM Assist, Inc.
> Main: (262)392-2026
> Cell: (414)491-6001
> Ans Service: (360)715-2467
> rich.smrcina at vmassist.com
>
> Catch the WAVV! http://www.wavv.org
> WAVV 2006 - Chattanooga, TN - April 7-11, 2006
>
> To unsubscribe from the hobbit list, send an e-mail to
> hobbit-unsubscribe at hswn.dk
>
>
>
More information about the Xymon
mailing list