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

Bug with RRD filename in hobbitsvc.cgi with trends (missing graphs from common RRD file)



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@= (at) RRDFN@:temp:AVERAGE
        LINE2:p (at) RRDIDX@# (at) 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@= (at) RRDFN@:humidity:AVERAGE
        LINE2:p (at) RRDIDX@# (at) 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 Baldwin - IT Unit
Australian Sports Commission          www.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


-------------------------------------------------------------------------------------
Keep up to date with what's happening in Australian sport visit http://www.ausport.gov.au

This message is intended for the addressee named and may contain confidential and privileged information. If you are not the intended recipient please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you receive this message in error, please delete it and notify the sender.
-------------------------------------------------------------------------------------