#!/usr/bin/perl ### Author: Jordi Prats Catala - 2007 ### License to use, modify, and distribute under the GPL ### http://www.gnu.org/licenses/gpl.txt @HPLOGRES=`/sbin/hplog -t`; shift @HPLOGRES; pop @HPLOGRES; for $line (@HPLOGRES) { @values=split(/\s+/,$line); @values=reverse @values; shift @values; #Threshold C shift @values; #Threshold F my $temp=shift @values; $temp=~s/C//ig; shift @values; #Current F shift @values; # Status pop @values; #null pop @values; #ID pop @values; #Type my $description=""; $description.=$_." " for (reverse @values); #some cleaning $description=~s/\W//g; system("/usr/bin/gmetric --name ".$description." --value ".$temp." --type uint16 --units Celcius"); }