[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [hobbit] Help with NCV graph




Hi all, I have a ext script that runs on the central hobbit server and
reports NTP offsets for all clients.

It outputs to a column called ntp and looks like:

Tue Jan 26 10:01:12 CST 2010

NTP Info (/usr/sbin/ntptrace -n ip_addr)
NTP server is up OK Clock Offset: (-0.000296)

Ip_addr: stratum 2, offset -0.000296, synch distance 0.035976

So I added ntp=ncv to TEST2RRD and ntp to GRAPHS and added the line
NCV_ntp="Offset:GAUGE,*:NONE" in the hobbitserver.cfg

I also created a graph entry in hobbitgraph.cfg, see definition below:
[ntp]
        TITLE NTP accuracy
        YAXIS Offset (us)
        DEF:offset=ntp.rrd:Offset:AVERAGE
        LINE2:Offset#FF0000:Offset (us)
        COMMENT:\n
        GPRINT:Offset:LAST: \: %7.6lf us (cur)\n
        GPRINT:Offset:MAX: \: %7.6lf us (max)\n
        GPRINT:Offset:MIN: \: %7.6lf us (min)\n
        GPRINT:Offset:AVERAGE: \: %7.6lf us (avg)\n

and then I restarted hobbit.

The problem is, I'm not getting any RRDs. I see the graph link on the
page, but with a white box and red x, meaning no graph to display.
Can anyone point me in the right direction as to what I'm doing wrong
regarding getting this data to dump to an rrd file?
In the RRD you refer to Offset, while there is no such name in the status message. Moreover, the value is written between parenthesis. In the manpage it says:

The "ncv" module will automatically detect all occurrences of a "NAME : value" or "NAME = value" string in a status message, and generate an RRD file holding all of the name/value data found in the message. The colon- or equal-sign must be present - if there is only whitespace, this module will fail.

In case of NCV, I replace all occurrances of ":" and "=" by ":" respectively "=". It wil give you more freedom in formatting the status message, without NCV misinterpreting it as a value to be recorded. You could place the actual value in HTML comment, causing it not to be shown. Rewriting the message above results in:

Tue Jan 26 10:01:12 CST 2010

NTP Info (/usr/sbin/ntptrace -n ip_addr)
NTP server is up OK
Ip_addr: stratum 2, offset -0.000296, synch distance 0.035976

<!--
Offset : -0.000296
-->

Regards,
 Wim Nelis



*******************************************************************************************************
The NLR disclaimer (http://www.nlr.nl/emaildisclaimer) is valid for NLR e-mail messages.
*******************************************************************************************************