[hobbit] Sending data from script to an rrd

Ralph Mitchell ralphmitchell at gmail.com
Wed Oct 18 21:03:33 CEST 2006


On 10/18/06, Rob Munsch <rmunsch at solutionsforprogress.com> wrote:
> > When you add the --extra-script option in the [rrdstatus] block,
>
> Well i'm stuck already.  What file is that block in?  I can't find it in
> 'server.cfg nor 'graph.cfg...

It's in server/etc/hobbitlaunch.cfg

> So something like
>
> echo "DS:cputemp:GAUGE:600:0:U"
> echo "cputemp.rrd"
>
> probably isn't far off after all?

That should do it, yes.  That's the format for the RRD creation, and
the name to create.  If you just want to push out one value, you'd
follow that with:

   echo "$temp"

> > It took me several iterations to get this straight... :)
>
> I bet i beat you! :D

Ahh, if this wasn't a family channel... :)

Note that if you want to push several different columns through this
script, you'll need something that distinguishes between them, then
echo out appropriate RRD names/data.  The hobbitd_rrd program only
runs *one* extra-script to deal with any results you send it...

So, if you're planning on several columns - cputemp, planartemp,
vrd0temp, etc, you'd need to allow for that in the script:

   if [ "$2" = "cputemp"}; then
      ...
   elif [ "$2" = "planartemp" ]; then
      ...
   elif [ "$2" = "vrd0temp" ]; then
      ...
   fi

On the other hand, if you're planning on pushing out all that stuff in
the same status message, you probably should go ahead and add the
extra RRD creation rows right away, and simply echo out zeroes for the
values until you figure out how to extract them:

     echo "DS:cputemp:GAUGE:600:0:U"
     echo "DS:planartemp:GAUGE:600:0:U"
     echo "DS:vrd0temp:GAUGE:600:0:U"
     echo "cputemp.rrd"
     echo "$temp:0:0"

I don't think hobbit_rrd will recreate the rrd if it already exists,
so you'd have to delete it sometime to get it rebuilt with the extra
variables.  Wave bye-bye to your old data...

Ralph



More information about the Xymon mailing list