<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
That would be cool.  It would require users to learn about the RRD
definition options, but at least they wouldn't have to code and compile
their own C module.  Would it also create a default entry for them in
hobbitgraph.cfg, or would they have to learn those options as well?<br>
<br>
The plugin system sounds cool...any chance it will make it into an RC
before 4.0 final?<br>
<br>
-Charles<br>
<br>
<br>
Henrik Stoerner wrote:
<blockquote cite="mid20050204225104.GA7201@hswn.dk" type="cite">
  <pre wrap="">On Fri, Jan 28, 2005 at 04:47:27AM -0700, Charles Jones wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Speaking of this, it sure would be nice to have some sort of plugin 
system, or something for easily creating custom graphs. I can think of 
many uses for simple one-element graphs (temperature, emails sent per 
day, etc).
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Sounds reasonable. I've found a way of doing this that keeps as much
as possible of the RRD handling in Hobbit, and makes it easy to use
custom scripts (written in your favourite scripting language) to
process a message and pick out the interesting data you want to put
into a graph.

Basically, you tell hobbitd_larrd which status- or data-messages are
handled by an external script, and what the script is. Your script
is then called when such a message arrives, and is fed the status
message in a file. In return, the script must output the RRD
definitions for the data you want to store, a filename for the RRD
file, and the values.

E.g. if you have a message like

   green Weather in Copenhagen is FAIR

   Temperature: 6
   Wind: 4
   Humidity: 72

and you want to track these, then this script would do:

   #!/bin/sh

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

   # Analyze the message we got
   TEMP=`cat $FNAME | grep "^Temperature:" | awk '{print $2}'
   WIND=`cat $FNAME | grep "^Wind:" | awk '{print $2}'
   HMTY=`cat $FNAME | grep "^Humidity:" | awk '{print $2}'

   # The RRD dataset definition
   echo "DS:temperature:GAUGE:600:-30:50"
   echo "DS:wind:GAUGE:600:0:U"
   echo "DS:humidity:GAUGE:600:0:100"

   # The filename
   echo "weather.rrd"

   # The data
   echo "$TEMP:$WIND:$HMTY"

   exit 0


Does that seem like a usable plug-in facility ?

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