[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] rrdtool from private scripts
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] rrdtool from private scripts
- From: "Ralph Mitchell" <ralphmitchell (at) gmail.com>
- Date: Wed, 18 Oct 2006 12:56:11 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=B9GzU0UBiTxtTtNOWRsX4r6v1qZx6S7qZV1zmQZiL79/x9MvWrODBq/KXD9LxXTVCS0TO/6ogwt0GGKKoerwgrv08nXMGUxlhhLl0JD107sD6H4Xk1Dw7JWES8FJPAmS3j/f+5rDvYuu9c0RbUrzP/1nsFFBghtPxw6PFNcOIsE=
- References: <64402.10.0.0.1.1161193350.squirrel@www.tumfatig.net> <453661BE.7030409@solutionsforprogress.com>
On 10/18/06, Rob Munsch <rmunsch (at) solutionsforprogress.com> wrote:
ipmitool sensor | grep Temp | awk -F\| '{print $1,$2,$3,$4}' >
$BBTMP/cputemp.$host
cpu_temp=`tail -n 4 $BBTMP/cputemp.$host |head -n 1 | awk '{print $2}'
|sed 's/\..*//g'`
Is there a compelling reason not to fold the above into one line:
temp=`ipmitool sensor | tail -n 4 | head -n 1 | awk '{ print $3 }'`
# Ok, we have the temp in degrees as an integer.
# Now to see if it's Very Bad.
if temp > 130
then
Does this bit work?? I get:
./ipmi.sh: line 22: temp: command not found
and an empty file called '130'. This works for me:
if [ $temp -gt 130 ]
then
The simplest way to graph it would be to have the message read something like:
cpu temp : $temp
then follow the instructions in the "Custom Graphs" entry from the
Help dropdown. You already have the first part - collecting the data.
If you use NCV, the above line would go into the RRD as cputemp,
because it takes everything before the colon and strips out spaces to
make the name, then takes the rest of the line as the number. That
probably a gross over-simplification... :)
Ralph