[hobbit] Hobbit Average Data
Henrik Stoerner
henrik at hswn.dk
Mon Nov 26 22:22:01 CET 2007
On Mon, Nov 26, 2007 at 02:49:27PM -0600, James Wade wrote:
> I've got some folks here that want to keep data all the time.
> ie. They don't want to use a Round Robin Database that averages
> the data over time. They want the 5 minute data forever.
>
> I know we can get into a debate as to the reality of this, but
> it's want the performance team here wants. If hobbit can't do it,
> they want me to use sar and input to another database.
>
> Is there a way to do this with Hobbit?
Not out-of-the-box, but doing it wouldn't require a lot of work.
I assume you want to store the data that Hobbit normally extracts
and puts into the RRD files ? I.e. you want to save e.g. just the
current utilisation of the /home filesystem (96%, usually), and not
the full status message ?
In that case, you will want to make some changes to the
hobbit-4.2.0/hobbitd/do_rrd.c file, specifically the
"create_and_update_rrd()" routine in there. This function handles ALL of
the RRD updating, so it is the place you want to put your code to grab
the RRD data and save somewhere permanent. In that routine, it ends up
calling the rrd_update() function in the RRD library:
result = rrd_update(pcount, updparams);
"updparams" is a table of "pcount" strings, which are really the same
strings that you would feed into an "rrd update" command that you run
from the commandline. See the rrdupdate(1) man-page - Hobbit always
uses the "-t" option to specify which datasets are being updated and the
sequence in which the datavalues is provided (for RRD files that contain
more than one set of data).
The simplest solution is probably to setup a pipe to a child process,
and then write a line with the RRD filename, the template and the data
to that pipe - the child process can then take care of splitting the
data into individual records, and store them in the database.
Henrik
More information about the Xymon
mailing list