[hobbit] Custom RRDs

Stuffle, David dstuffle at deltafaucet.com
Tue May 10 14:55:38 CEST 2005


Andy France wrote:
> "Stuffle, David" wrote on 10/05/2005 02:15:48:
> 
>>> "Stuffle, David" wrote on 07/05/2005 03:35:47:
>>> 
>>>> I have created a custom RRD script and it been working
>>> fine.  Any host
>>> that
>>>> sends a "license" column status with a line containing
>>>> "In Use: x" will
>>> get
>>>> the license usage (x) graphed.  But, for some reason
>>>> it won't work on a
>>> host
>>>> I have that has a hostname of "license".  RRD file
>>>> gets created, but it's all "nan" values.  Could having
>>>> the exact same hostname, Dataset name,
>>> and
>>>> column name cause it not to work?  The only other
>>>> difference in this host
>>> is
>>>> it's a Windows machine instead of Unix, but the status
>>>> sent to Hobbit is
>>> the
>>>> same so I can't see that it would matter.  Thanks!
>>> 
>>>> ~~~~~~~~~~~~~~
>>>> David Stuffle
>>>> Delta Faucet Company
>>> 
>> Andy France wrote:
>>> It sounds to me like you are picking up the status line
>>> rather than the data line. 
>>> 
>>> Check your RRD script again... if you are
>>> grepping/awking for a line containing license you may
>>> need to narrow your criteria :-) 
>>> 
>>> It may be as simple as adding "tail -1" to make sure
>>> you only get the last occurence. 
>>> 
>>> HTH,
>>> Andy.
>>> 
>>> 
>> I have verified I am getting the right data from the
>> status by redirecting the script to a file.  Somewhere
>> between grepping the license count and putting it in the
>> RRD file it gets lost.  I'm figuring it must be because
>> the hostname is the same as the DS name.  Any other host
>> I plug in to it works fine.  Thanks 
> 
> If you post the script and message content either here or
> directly to me, I'd be happy to take a look :-)
> 

Thanks!  Here is the script: (if the format gets messed up, I also attached
a file with the same contents)
---------------
#!/bin/sh

# Input parameters: Hostname, testname (column), and messagefile
HOSTNAME="$1"
TESTNAME="$2"
FNAME="$3"

if [ "$TESTNAME" = "license" ]
then
        # Analyze the message we got
        InUse=`grep "In Use" $FNAME | cut -d : -f 2 | sed "s/ //"`
        
        # The RRD dataset definitions
        echo "DS:license:GAUGE:600:0:U"
   
        # The filename
        echo "license.rrd"

        # The data
        echo "$InUse"

        # Added for debugging purposes
        if [ "$HOSTNAME" = "license" ]
        then
                echo $HOSTNAME, $TESTNAME, $FNAME >>license_test.txt
                echo "$InUse" >>license_test.txt
                cat $FNAME >>license_test.txt
        fi
fi


The output from the debugging part (license_test.txt) looks like this:
--------------
license, license, /usr/local/hobbit/server/tmp/rrd_msg_27159
8 
status license.license green Tue 05/10/2005- 7:37:41.18 
Pro/Engineer Wildfire 2 Licenses 
-------------------------------- 
Total licenses available: 31 
                  In Use: 8 


And here's the RRD definition:
--------------
[license]
        TITLE License Utilization
        YAXIS Used Licenses
        DEF:avg=license.rrd:license:AVERAGE
        LINE2:avg#@COLOR@:Used Licenses
        GPRINT:avg:LAST: \: %5.0lf (cur)
        GPRINT:avg:MAX: \: %5.0lf (max)
        GPRINT:avg:MIN: \: %5.0lf (min)
        GPRINT:avg:AVERAGE: \: %5.0lf (avg)\n


Two other hosts are sending license statuses and they're graphing fine.
Just this "license" hostname is not.  The graph shows up and the rrd file is
getting updated, but with no values.

Thanks again!!

~~~~~~~~~~~~~~
David Stuffle                       dstuffle at deltafaucet.com
Delta Faucet Company                (317) 571-4301


This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
Please note that any views or opinions presented in this email are solely
those of the author and do not necessarily represent those of the company.
Finally, the recipient should check this email and any attachments for the
presence of viruses. The company accepts no liability for any damage caused
by any virus transmitted by this email.
  

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: license_graphing_problem.txt
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20050510/ee7014fe/attachment.txt>


More information about the Xymon mailing list