[Xymon] Problem adding GRAPHS in xymonserver.cfg (known bug?)

SebA spah at syntec.co.uk
Mon Dec 12 12:48:22 CET 2011


Hi David,
 
Many thanks for your response.  I can confirm that your work-around for this
issue works.  I touched a file, and the CGI script now displays the new
graph. :)  Maybe this requirement should be documented in the page I
referenced below?  I think this could be a neat feature as it means that the
graph does not appear for all hosts...  But I would like it (my modified
version of the disk1 graph) ideally on the disk status page for this host
(in addition to the standard disk graph).  Any ideas on how to do that?

Kind regards, 

SebA
  


  _____  

From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of
David Baldwin
Sent: 12 December 2011 01:27
To: SebA
Cc: xymon at xymon.com
Subject: Re: [Xymon] Problem adding GRAPHS in xymonserver.cfg (known bug?)


SebA, 

On the latest version of Xymon trunk, I cannot get the GRAPHS= feature in
xymonserver.cfg to work as I would hope, following the instructions listed
here:
http://www.xymon.com/xymon/help/howtograph.html
If I add disk1 so it becomes:
GRAPHS="la,disk,disk1,<... lots more ...>,xymonproxy,xymond
the disk1 graph does not show up on the trends page.  However, I know the
disk1 graph works, because I can view it by manipulating the URL generated
when I click on the disk graph.  And I know the xymonserver.cfg file is
being read OK, because if I change disk to disk1 in the original line, the
disk graph disappears altogether.  What's wrong?


A problem I found a while ago with graphs in trends is that you need to have
directory entries of the form 'disk1.*.rrd' (wildcard matching) - note they
do not need to be the actual RRD files, since the graph drawing uses the
FNPATTERN line in the graph definition to find the correct ones. Try doing a
'touch disk1.foo.rrd' in the rrd directory for the host you are trying to
get the disk1 graphs into the trends column for.

Below is a summary I compiled of the issues in May 2009 (apologies for
old-style pathnames).

I am building a range of graphs with devmon collecting RRD data. Some

RRD files contain multiple datasets with different units - e.g.

temperature and humidity.



I want all the graphs to appear in the trends column. Finally, after a

lot of stuffing around with different combinations, it appears that the

following conditions are required:



** RRD file name must exist starting with the graph/"service" name

* graph name must be listed in GRAPHS variable in hobbitserver.cfg

* doesn't matter if graph name is listed in TEST2RRD or not



So for the following graphs to work I created symlinks to env.*.rrd from

humidity.*.rrd - e.g.

# ls -l

total 120

-rw-rw-r--  1 hobbit hobbit 38536 May 20 15:49 env.Rack2-Front.rrd

-rw-rw-r--  1 hobbit hobbit 38536 May 20 15:49 env.Rack5(XRAID)-Rear.rrd

lrwxrwxrwx  1 root   root      19 May 20 14:29 humidity.Rack2-Front.rrd

-> env.Rack2-Front.rrd

lrwxrwxrwx  1 root   root      25 May 20 14:29

humidity.Rack5(XRAID)-Rear.rrd -> env.Rack5(XRAID)-Rear.rrd

-rw-rw-r--  1 hobbit hobbit 19552 May 20 15:48 tcp.conn.rrd



In fact, I found it was sufficient just to 'touch' the RRD filename to

create an empty file - the graph CGI script uses the correct definition

and finds the specified RRD file.



Section of hobbitgraphs.cfg

[env]

        FNPATTERN env\.(.+).rrd

        TITLE Temperature

        YAXIS Celsius

        DEF:p at RRDIDX@=@RRDFN@:temp:AVERAGE

        LINE2:p at RRDIDX@#@COLOR@:@RRDPARAM@

        GPRINT:p at RRDIDX@:LAST: \: %5.1lf (cur)

        GPRINT:p at RRDIDX@:MAX: \: %5.1lf (max)

        GPRINT:p at RRDIDX@:MIN: \: %5.1lf (min)

        GPRINT:p at RRDIDX@:AVERAGE: \: %5.1lf (avg)\n



[humidity]

        FNPATTERN env\.(.+).rrd

        TITLE Humidity

        YAXIS Percent

        DEF:p at RRDIDX@=@RRDFN@:humidity:AVERAGE

        LINE2:p at RRDIDX@#@COLOR@:@RRDPARAM@

        GPRINT:p at RRDIDX@:LAST: \: %5.1lf (cur)

        GPRINT:p at RRDIDX@:MAX: \: %5.1lf (max)

        GPRINT:p at RRDIDX@:MIN: \: %5.1lf (min)

        GPRINT:p at RRDIDX@:AVERAGE: \: %5.1lf (avg)\n



It took me a while to work out a testing harness for debugging the CGI

script, but I came up with the following shell script:



. /usr/lib/hobbit/server/etc/hobbitcgi.cfg

HOST=$1

SERVICE=trends

env REQUEST_URI=/hobbit-cgi/bb-hostsvc.sh?HOST=${HOST}\&SERVICE=$SERVICE

SCRIPT_NAME=/hobbit-cgi/bb-hostsvc.sh

QUERY_STRING=HOST=${HOST}\&SERVICE=$SERVICE REQUEST_METHOD=GET

/usr/lib/hobbit/server/bin/hobbitsvc.cgi $CGI_SVC_OPTS --debug



The debug output would show me the rrd files as they were found, and

allowed me to pin down that the graph name had to match the start of the

RRD filename.



There's probably a few bugs in all of this. It would be nice not to have

to create the RRD filenames by hand.



Thanks, David.


David.

-- 

David Baldwin - Senior Systems Administrator (Datacentres + Networks)

Information and Communication Technology Services

Australian Sports Commission          http://ausport.gov.au

Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616

david.baldwin at ausport.gov.au          Leverrier Street Bruce ACT 2617



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20111212/a7063476/attachment.html>


More information about the Xymon mailing list