<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
So i took your simpler way of getting the graph, however then i
realized that the alerts that were being generated were still based on
load -- is there any way to configure hobbit to turn red/yellow based
on cpu utilization % rather than load?<br>
<br>
thanks again for all your help, your dedication to OSS is inspiring!<br>
<br>
Adam<br>
<br>
Henrik Stoerner wrote:
<blockquote cite="mid20050927212317.GA7086@hswn.dk" type="cite">
  <pre wrap="">On Mon, Sep 26, 2005 at 01:58:37PM -0500, Adam Scheblein wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Recently i have been trying to create a custom script that grabs cpu 
utilization percentage, however when i try to get it to graph, it will 
not work...  I have read the man page for hobbitd_rrd as well as the 
message thread "custom RRD data" in the hobbit mailing list archives, 
however i still cannot get it to work.

Here is my client script:
    </pre>
  </blockquote>
  <pre wrap=""><!---->[snip]
  </pre>
  <blockquote type="cite">
    <pre wrap="">$BB $BBDISP "status $MACHINE.$TEST $COLOR `date` - $STATUS Used CPU: $USED_CPU"
    </pre>
  </blockquote>
  <pre wrap=""><!---->
This sends a one-line status report with the text
green Tue Sep 27 23:11:49 CEST 2005 - ok Used CPU: 15

  </pre>
  <blockquote type="cite">
    <pre wrap="">Here is my feeder script on the server side:
    </pre>
  </blockquote>
  <pre wrap=""><!---->[snip]
  </pre>
  <blockquote type="cite">
    <pre wrap="">       # Analyze the message we got
       cpu2=grep "^OK - " $FNAME | awk '{ print $11 }'
    </pre>
  </blockquote>
  <pre wrap=""><!---->
This line looks for "OK" at the beginning of a line (but it is
in the middle of the line, and in lowercase). So it probably won't
find anything, and $cpu2 will be blank.


If you do want to use an extension script for this, I'd suggest
sending in the status message like this:

$BB $BBDISP "status $MACHINE.$TEST $COLOR `date` - $STATUS 
Used CPU: $USED_CPU"

i.e. split it on two lines, and have just the "Used CPU: X"
on a line by itself. Then your feeder script should be

     cpu2=grep "^Used CPU:" $FNAME | awk '{ print $3 }'


However, there's a simpler way of getting the same result.
Assuming you already have the vmstat data - e.g. from the Hobbit
client, or by running the BB client with the LARRD add-on - 
you can leverage those data and generate the same graph by 
changing the [la] graph definition in your hobbitgraph.cfg
to this:

[la]
        TITLE CPU Utilitization
        YAXIS % Used
        -u 100
        -r
        DEF:cpu_idl=vmstat.rrd:cpu_idl:AVERAGE
        CDEF:pbusy=100,cpu_idl,-
        LINE2:pbusy#00CC00:% CPU busy
        GPRINT:pbusy:LAST: \: %5.1lf (cur)
        GPRINT:pbusy:MAX: \: %5.1lf (max)
        GPRINT:pbusy:MIN: \: %5.1lf (min)
        GPRINT:pbusy:AVERAGE: \: %5.1lf (avg)\n

This determines the CPU busy percentage as (100 - idle %).


Regards,
Henrik


To unsubscribe from the hobbit list, send an e-mail to
<a class="moz-txt-link-abbreviated" href="mailto:hobbit-unsubscribe@hswn.dk">hobbit-unsubscribe@hswn.dk</a>


  </pre>
</blockquote>
<br>
</body>
</html>