[hobbit] Custom RRD graphs

Thomas tlp-hobbit at holme-pedersen.dk
Sun Dec 3 19:52:54 CET 2006


Hi

I dont know why you would write your own rrdext script when NCV will do 
this for you. Looking at your steps all you need is to send the OUTPUT 
in a seperate line with a blank line in between and then adding a 
NCV_acpu="acpu:GAUGE" to hobbitserver.cfg and all will be done for you.

This is where I always go when ever I have a new graph to make 
http://www.hswn.dk/~henrik/howtograph.txt

Br Thomas

Ger Maguire wrote:
> Folks,
>  
> I'm still having trouble with my graphs. I have turned on the debug 
> mode and I'm getting the following for one of the tests.
> I've even gone so far to do a complete OS install on a new machine 
> with only hobbit to make there was nothing conflicting with it.
>  
> The scripts seem to be working but the rrd files are just not 
> updating. Can anyone see anything wrong ?
>  
> 2006-12-03 12:27:42 Want msg 119403, startpos 128142, fillpos 128142, 
> endpos -1, usedbytes=0, bufleft=400241
> 2006-12-03 12:27:42 hobbitd_rrd: Got message 119403 
> @@status#119403|1165148862.825676|10.8.1.10||fwi-lor-02|acpu|1165150662|green||green|1165065289|0||0||0
> 2006-12-03 12:27:42 startpos 128677, fillpos 128677, endpos -1
> 2006-12-03 12:27:42 -> do_external(fwi-lor-02, acpu)
> 2006-12-03 12:27:42 <- do_external(fwi-lor-02, acpu)
> 2006-12-03 12:27:42 Want msg 119404, startpos 128677, fillpos 128677, 
> endpos -1, usedbytes=0, bufleft=399706
> 2006-12-03 12:27:42 000013787 : Saving msg to file 
> /usr/lib/hobbit/server/tmp/rrd_msg_13787
> 2006-12-03 12:27:42 000013787 : Calling helper script 
> /usr/lib/hobbit/server/ext/rrd-ext.sh fwi-lor-02 acpu 
> /usr/lib/hobbit/server/tmp/rrd_msg_13787
> 2006-12-03 12:27:42 000013787 : Unlinking temp file
>  
> Thanks,
> Ger.
>
> ------------------------------------------------------------------------
> *From:* Ger Maguire [mailto:ger at fwi.ie]
> *Sent:* 30 November 2006 20:17
> *To:* hobbit at hswn.dk
> *Subject:* RE: [hobbit] Custom RRD graphs
>
> I think I have gone through all the steps and have poured over the 
> docs and manpages
>  
> So far:
>  
> 1 Created custom script outputing data to hobbit using status switch
>  
> $BBHOME/bin/bb $BBDISP "status $HOST.$TEST $COLOUR $OUTPUT"
>  
> 2 Created rrd-ext script and have it getting data as per below 
> (numeric vale for catching a % value)
>  
>  
> 3 Modified hobbitserver.cfg
>  
> Added acpu test to TEST2RRD="cpu=la,disk, ... ,acpu"
>  
> Added acpu test to GRAPHS="la,disk, ... ,acpu"
>  
>  
> 4 Modified hobbitlaunch.cfg
>
> [rrdstatus]
>         ENVFILE /usr/lib/hobbit/server/etc/hobbitserver.cfg
>         NEEDS hobbitd
>         CMD hobbitd_channel --channel=status 
> --log=$BBSERVERLOGS/rrd-status.log
>         hobbitd_rrd --rrddir=$BBVAR/rrd 
> --extra-script=/usr/lib/hobbit/server/ext/rrd-ext.sh --extra-tests=acpu
>  
> I haven't modified [rrddata] as I'm sending the data in using the 
> status command but I'll stick it in and see if it makes a difference.
> Added the test itself to hobbitlaunch to run every 5 mins, all works 
> ok pages update in hobbit
>  
> [acpu]
>         ENVFILE /usr/lib/hobbit/server/etc/hobbitserver.cfg
>         NEEDS hobbitd
>         CMD $BBHOME/ext/acpu.sh
>         INTERVAL 5m
>  
> 5 Modified hobbitgraph.cfg with the following
>  
> [acpu]
>         TITLE CPU Utilisation
>         YAXIS % Load
>         DEF:acpu=acpu.rrd:acpu:AVERAGE
>         AREA:acpu#00CC00:Utilisation
>         GPRINT:acpu:LAST: \: %5.1lf%s (cur)
>         GPRINT:acpu:MAX: \: %5.1lf%s (max)
>         GPRINT:acpu:MIN: \: %5.1lf%s (min)
>         GPRINT:acpu:AVERAGE: \: %5.1lf%s (avg)\n
>  
>  
> The rrd files get created in the correct place and the pages in hobbit 
> show the graph but there is just no data being displayed and the 
> timestamp on the acpu.rrd files is showing they are not being updated.
>  
> This is where I'm stumped, the log files don't show any relevant info 
> or messages to point me to anything thats wrong.
>  
> I'm running it on debian sarge distro using the .deb package from 
> sourceforge.
>  
>  
> Ger.
>  
>  
> ------------------------------------------------------------------------
> *From:* Hubbard, Greg L [mailto:greg.hubbard at eds.com]
> *Sent:* 30 November 2006 19:55
> *To:* hobbit at hswn.dk
> *Subject:* RE: [hobbit] Custom RRD graphs
>
> Why bother when Hobbit will use your echo output to do that?
>  
> But there is more to graphing than simply creating the RRD files.  
> Next you have to create graph definitions that will use your new 
> files, and these graphs have to work.  Then you can add your new 
> graphs to the Hobbit server so they will show up with the associated 
> test (TEST2RRD variable) and/or in the trends display.
>  
> You say you see the data being echoed -- are the RRD files not getting 
> created/updated?  Did you add your rrd-ext to the right place on the 
> server?  Did you add it to hobbit-rrd for both data and status messages?
>  
> (or whatever, I am going from dim memory)
>  
> GLH
>
>     ------------------------------------------------------------------------
>     *From:* Ger Maguire [mailto:ger at fwi.ie]
>     *Sent:* Thursday, November 30, 2006 1:44 PM
>     *To:* hobbit at hswn.dk
>     *Subject:* RE: [hobbit] Custom RRD graphs
>
>     Guys, When creating custom scripts, has anyone just used rrdcreate
>     and rrdtool update to directly output the data to the rrd files ?
>      
>     If the the tests are all residing on the one machine and not
>     polling data from other clients is it an easier way to update the
>     graphs as I just can't get the status script to update for me ?
>      
>     Thanks,
>     Ger.
>
>     ------------------------------------------------------------------------
>     *From:* Ger Maguire [mailto:ger at fwi.ie]
>     *Sent:* 29 November 2006 20:13
>     *To:* hobbit at hswn.dk
>     *Subject:* [hobbit] Custom RRD graphs
>
>     Hi folks,
>      
>     I have created a custom script for capturing CPU utilisation from
>     a device and updated all the relevant files but I cannot get my
>     rrd files to update correctly.
>      
>     An initial rrd file gets created but the data does not get input
>     into it.
>      
>     I have created a rrd-ext sript which is running and is capturing
>     the incomming status data and by looking at the /tmp files I can
>     see that the echo outputs are being generated correctly every 5
>     mintes.
>      
>     ----> rrd-ext.sh
>      
>     HOSTNAME="$1"
>     TESTNAME="$2"
>     FNAME="$3"
>      
>     if [ "$TESTNAME" = "acpu" ]
>     then
>             echo "`date`" >> /tmp/hobbit.$HOSTNAME.$TESTNAME
>             echo "$FNAME" >> /tmp/hobbit.$HOSTNAME.$TESTNAME
>             # Analyze the message we got
>             # ACPU=`grep "connected" $FNAME | awk '{print $14}'`
>             ACPU=`grep "The 5" $FNAME | cut -d"(" -f2 | cut -d"." -f1`
>             # The RRD dataset definitions
>             echo "DS:acpu:GAUGE:600:0:100"
>             # The filename
>             echo "acpu.rrd"
>             # The data
>             echo "$ACPU"
>             echo "$ACPU"  >> /tmp/hobbit.$HOSTNAME.$TESTNAME
>     fi
>      
>      
>     The value I want to graph is simply a cpu % counter, have I got
>     the above values and setting correct for this ?
>      
>     Any help or pointers appreciated.
>      
>      
>     Output that this produces is below showing that it is getting the
>     data correctly from the status input.
>      
>     ---> /tmp/hobbit.$HOSTNAME.$TESTNAME
>      
>     Wed Nov 29 19:54:07 GMT 2006
>     /usr/lib/hobbit/server/tmp/rrd_msg_13879
>     14
>     Wed Nov 29 19:59:05 GMT 2006
>     /usr/lib/hobbit/server/tmp/rrd_msg_26569
>     25
>     Wed Nov 29 20:04:07 GMT 2006
>     /usr/lib/hobbit/server/tmp/rrd_msg_2788
>     17
>     Wed Nov 29 20:09:12 GMT 2006
>     /usr/lib/hobbit/server/tmp/rrd_msg_11944
>     9
>      
>      
>     Ger.
>      
>      
>      
>      
>




More information about the Xymon mailing list