pcp
[Top] [All Lists]

Re: pmie rule using shell?

To: pcp@xxxxxxxxxxx
Subject: Re: pmie rule using shell?
From: Nathan Scott <nathans@xxxxxxx>
Date: Mon, 21 Jul 2003 14:09:49 +1000
In-reply-to: <20030719212237.GA26066@xxxxxxxxx>
References: <20030719212237.GA26066@xxxxxxxxx>
Sender: pcp-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.3i
On Sat, Jul 19, 2003 at 11:22:37PM +0200, Jan-Frode Myklebust wrote:
> Hi, 
> 
> I have a Sensorsoft <http://sensorsoft.com/> thermometer connected 
> to my serial port, and dump temperature readings to a rrd-database
> every 5 minute. 
> 
> Is it possible to make a pmie rule similar to the pcp/examples/pmie/ENVIRON
> example that reads the last entry from the rrd-database via shell-commands 
> instead of the environ.temp metric, and raises an alert if the temperature
> is rising?
> 
> The command to get the last temperature entry would be something like:
> 
>       rrdtool fetch scomtemp.rrd MAX -r 900 -s -10|grep -v nan|tail -1|awk 
> '{print $2+0}'
> 
> Can I use this directly in pmie, or will I have to write a PMDA?
> 

You should write a PMDA (else I don't see the point in using pmie,
you could just use perl/sh/...).  I'd recommend that your PMDA also
query the serial port directly to avoid the additional delay you'd
otherwise be inserting for your 5-minutely dump to rrd, and you can
also then use pmlogger to store the data directly into a PCP archive
(and hence run pmie with the -a option as well).  If you did that,
I don't think there would be a need to use rrd (you would have both
live and archived access to your data using the same tools, which is
one of the great things about PCP).

cheers.

-- 
Nathan

<Prev in Thread] Current Thread [Next in Thread>