Skip to content
This repository
Browse code

Fixed issue when speed > 99, also addded options to monitor multiple …

…cpu's e system zones
  • Loading branch information...
commit fe24045cd40f2e2ff3140d91afc74fb069bb4eb8 1 parent 62d4383
Pmoranga authored May 04, 2012
18  plugins/environment/hplog_f-a-hp-proliant-server-fans-speed
@@ -5,8 +5,8 @@ if [ "$1" == "config" ] ; then
5 5
 	echo "graph_vlabel speed"
6 6
 	echo "graph_category environment"
7 7
 	echo "graph_info This graph shows the speed of the system fans"
8  
-	echo 'processor_zone_fan.label Processor Zone fan speed'
9  
-	echo 'system_board_fan.label System Board fan speed'
  8
+
  9
+	hplog -f | perl -ne 'if ( m/(System|Processor)/) { $t=lc($1); $count[$t]++; print $t."_".$count[$t] . ".label " . $t . " fan speed $count[$t] \n"  }'
10 10
 	exit 0
11 11
 fi
12 12
 
@@ -14,15 +14,5 @@ fi
14 14
 #1  Var. Speed   Processor Zone  Normal     N/A     Low    ( 10)
15 15
 #2  Var. Speed   System Board    Normal     N/A     Low    ( 10)
16 16
 
17  
-/sbin/hplog -f | ( while read a b c d e f g h i j k l m
18  
-do
19  
-	if [ "$d" == "Processor" ] ; then
20  
-		echo -n "processor_zone_fan.value "
21  
-		echo $j | sed 's/)//'
22  
-	elif [ "$d" == "System" ] ; then
23  
-		echo -n "system_board_fan.value "
24  
-		echo $j | sed 's/)//'
25  
-	fi
26  
-	
27  
-done
28  
-)
  17
+
  18
+hplog -f | perl -ne 'if ( m/(System|Processor)/) { $t=lc($1); $count[$t]++; m/\( *(\d+)\)/; print $t."_".$count[$t] . " " . $1 . "\n"  }'

0 notes on commit fe24045

Please sign in to comment.
Something went wrong with that request. Please try again.