-----Original Message-----
From: Christoph Schug [mailto:user-cd3e90ddf801@xymon.invalid]
Sent: Wednesday, November 16, 2011 4:31 AM
To: Root, Paul
Cc: xymon at xymon.com
Subject: Re: [Xymon] graphing.
On Tue, 15 Nov 2011 18:24:36 -0600, "Root, Paul"
<user-76fdb6883669@xymon.invalid>
wrote:
So, now however, I'm lost on the actual graph creation. I don't
understand
the GPRINT lines at all, are they putting in legend or min/max
history?
Or
is it defining the scale of the graph. And I'm not too sure about the
DEF
line either, what's the keyword AVERAGE saying there? The data is
all
integer, number of events, do I sti
I basically just stole the lines from hobbitd since that's the same
sort
of
data.
[nfmsgw]
TITLE NFMS Gateway Events
YAXIS Unprocessed Events
DEF:events=nfmsgw.rrd:Events:AVERAGE
LINE2:events#00CCCC:Unprocessed Events
GPRINT:events:LAST: \: %5.1lf (cur)
GPRINT:events:MAX: \: %5.1lf (max)
GPRINT:events:MIN: \: %5.1lf (min)
GPRINT:events:AVERAGE: \: %5.1lf (avg)\n
Most of the graph definition isn't Xymon specific at all but gets
simply
passed to the RRD library. The GPRINT stuff just adds you some
additional
lines of text into the graph. See
http://oss.oetiker.ch/rrdtool/doc/rrdgraph_graph.en.html for details.
This
is done several times for the same variable ("value") using different
Consolidation Functions. According to
http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html there is
"AVERAGE": the average of the data points is stored
"MIN": the smallest of the data points is stored
"MAX": the largest of the data points is stored
"LAST": the last data points is used
From cosmetic point of view for example you might want to change the
"%5.1lf" to "%5.0lf" all except AVERAGE as you stated that you're
dealing
with integers only.
I found it easiest and quickest to trace down errors in the graph
definition by just reproducing the stuff on command line. You only need
to
transform the "TITLE" and "YAXIS" tags into "--title" and
"--vertical-label" command line arguments to "rrdtool graph". If the
RRD
file is not in your current working directory just specify the path to
it,
if there are any @COLOR@ magic thing (which is not the case in yours)
then
replace them with something suitable in RGB notations, e.g. "0000ff" or
"00ff00".
In you case that would be something like
$ rrdtool graph /var/tmp/mygraph.png -a PNG \
--title 'NFMS Gateway Events' --vertical-label 'Unprocessed Events' \
'DEF:events=/path/to/nfmsgw.rrd:Events:AVERAGE' \
'LINE2:events#00CCCC:Unprocessed Events' \
'GPRINT:events:LAST: \: %5.1lf (cur)' \
'GPRINT:events:MAX: \: %5.1lf (max)' \
'GPRINT:events:MIN: \: %5.1lf (min)' \
'GPRINT:events:AVERAGE: \: %5.1lf (avg)\n'
(Note: when doing so, rrdtool graph is pretty picky about whitespace,
so be
sure to have the single quote directly before GPRINT and not some space
in
between)
If something is wrong, rrdtool should give you an error which might be
more
helpful than anything from the logs.