From 8439151d77411b16357925b735d2466218e19434 Mon Sep 17 00:00:00 2001 From: xavier renaut Date: Fri, 22 Jun 2012 01:37:09 -0400 Subject: [PATCH 1/3] moved hplog_* to sensors --- .../hplog_f-a-hp-proliant-server-fans-speed | 0 .../hplog_t-a-hp-proliant-server-temperatures | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename plugins/{environment => sensors}/hplog_f-a-hp-proliant-server-fans-speed (100%) rename plugins/{environment => sensors}/hplog_t-a-hp-proliant-server-temperatures (100%) diff --git a/plugins/environment/hplog_f-a-hp-proliant-server-fans-speed b/plugins/sensors/hplog_f-a-hp-proliant-server-fans-speed similarity index 100% rename from plugins/environment/hplog_f-a-hp-proliant-server-fans-speed rename to plugins/sensors/hplog_f-a-hp-proliant-server-fans-speed diff --git a/plugins/environment/hplog_t-a-hp-proliant-server-temperatures b/plugins/sensors/hplog_t-a-hp-proliant-server-temperatures similarity index 100% rename from plugins/environment/hplog_t-a-hp-proliant-server-temperatures rename to plugins/sensors/hplog_t-a-hp-proliant-server-temperatures From f51bde4ba7341f6bba1a4624404acdb7866294a3 Mon Sep 17 00:00:00 2001 From: xavier renaut Date: Fri, 22 Jun 2012 01:39:30 -0400 Subject: [PATCH 2/3] added virtual fan - used on blades --- plugins/sensors/hplog_f-a-hp-proliant-server-fans-speed | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/sensors/hplog_f-a-hp-proliant-server-fans-speed b/plugins/sensors/hplog_f-a-hp-proliant-server-fans-speed index f4765f01..37dcac3f 100755 --- a/plugins/sensors/hplog_f-a-hp-proliant-server-fans-speed +++ b/plugins/sensors/hplog_f-a-hp-proliant-server-fans-speed @@ -3,16 +3,19 @@ if [ "$1" == "config" ] ; then echo "graph_title HP server fan speed" echo "graph_vlabel speed" - echo "graph_category environment" + echo "graph_category sensors" echo "graph_info This graph shows the speed of the system fans" - hplog -f | perl -ne 'if ( m/(System|Processor)/) { $t=lc($1); $count[$t]++; print $t."_".$count[$t] . ".label " . $t . " fan speed $count[$t] \n" }' + hplog -f | perl -ne 'if ( m/(System|Processor|Virtual)/) { $t=lc($1); $count[$t]++; print $t."_".$count[$t] . ".label " . $t . " fan speed $count[$t] \n" }' exit 0 fi #ID TYPE LOCATION STATUS REDUNDANT FAN SPEED #1 Var. Speed Processor Zone Normal N/A Low ( 10) #2 Var. Speed System Board Normal N/A Low ( 10) +#6 Var. Speed System Board Normal Yes Low ( 13) +#ID TYPE LOCATION STATUS REDUNDANT FAN SPEED +# 1 Var. Speed Virtual Normal N/A Low ( 19) -hplog -f | perl -ne 'if ( m/(System|Processor)/) { $t=lc($1); $count[$t]++; m/\( *(\d+)\)/; print $t."_".$count[$t] . " " . $1 . "\n" }' +hplog -f | perl -ne 'if ( m/(System|Processor|Virtual)/) { $t=lc($1); $count[$t]++; m/\( *(\d+)\)/; print "${t}_$count[$t].value $1\n" }' From a8f7b9030f61336656806f8421a0aeba3c92c21c Mon Sep 17 00:00:00 2001 From: xavier renaut Date: Fri, 22 Jun 2012 01:40:50 -0400 Subject: [PATCH 3/3] brand new, perl based, hplog_t-a-hp-proliant-server-temperatures plugin which will automatically graph any number of sensors. --- .../hplog_t-a-hp-proliant-server-temperatures | 134 +++++++++++++----- 1 file changed, 95 insertions(+), 39 deletions(-) diff --git a/plugins/sensors/hplog_t-a-hp-proliant-server-temperatures b/plugins/sensors/hplog_t-a-hp-proliant-server-temperatures index d7696f5f..75994559 100755 --- a/plugins/sensors/hplog_t-a-hp-proliant-server-temperatures +++ b/plugins/sensors/hplog_t-a-hp-proliant-server-temperatures @@ -1,43 +1,99 @@ -#!/bin/bash +#!/usr/bin/perl -w -if [ "$1" == "config" ] ; then - echo "graph_title HP server temperatures" - echo "graph_vlabel celsius" - echo "graph_category environment" - echo "graph_info temperatures read using hpscan" - echo "processor_zone.label Processor zone temperature" - echo "io_zone.label I/O zone temperature" - echo "processor0.label Processor 0 temperature" - echo "processor1.label Processor 1 temperature" - echo "psu_bay.label PSU bay temperature" - exit 0 -fi +=head hplog_t + +DL 380 G6 +ID TYPE LOCATION STATUS CURRENT THRESHOLD + 1 Basic Sensor Ambient Normal 68F/ 20C 105F/ 41C + 2 Basic Sensor CPU (1) Normal 104F/ 40C 179F/ 82C + 3 Basic Sensor CPU (2) Normal 104F/ 40C 179F/ 82C + 4 Basic Sensor Memory Board Normal 105F/ 41C 188F/ 87C + 5 Basic Sensor Memory Board Normal 105F/ 41C 188F/ 87C + 6 Basic Sensor Memory Board Normal 100F/ 38C 188F/ 87C + 7 Basic Sensor Memory Board Normal 98F/ 37C 188F/ 87C + 8 Basic Sensor Pwr. Supply Bay Normal 123F/ 51C 194F/ 90C + 9 Basic Sensor Pwr. Supply Bay Normal 105F/ 41C 149F/ 65C +10 Basic Sensor I/O Zone Normal 125F/ 52C 194F/ 90C +11 Basic Sensor I/O Zone Normal 114F/ 46C 158F/ 70C +12 Basic Sensor I/O Zone Normal 131F/ 55C 194F/ 90C +13 Basic Sensor I/O Zone Normal ---F/---C 158F/ 70C +14 Basic Sensor I/O Zone Normal ---F/---C 158F/ 70C +15 Basic Sensor I/O Zone Normal ---F/---C 158F/ 70C +16 Basic Sensor I/O Zone Normal ---F/---C 158F/ 70C +17 Basic Sensor I/O Zone Normal ---F/---C 158F/ 70C +18 Basic Sensor I/O Zone Normal ---F/---C 158F/ 70C +19 Basic Sensor Processor Zone Normal 95F/ 35C 158F/ 70C +20 Basic Sensor Processor Zone Normal 95F/ 35C 158F/ 70C +21 Basic Sensor Processor Zone Normal 105F/ 41C 176F/ 80C +22 Basic Sensor Processor Zone Normal 102F/ 39C 176F/ 80C +23 Basic Sensor I/O Zone Normal 118F/ 48C 170F/ 77C +24 Basic Sensor Memory Board Normal 109F/ 43C 158F/ 70C +25 Basic Sensor Memory Board Normal 98F/ 37C 158F/ 70C +26 Basic Sensor Memory Board Normal 98F/ 37C 158F/ 70C +27 Basic Sensor I/O Zone Normal ---F/---C 158F/ 70C +28 Basic Sensor I/O Zone Normal ---F/---C 158F/ 70C +29 Basic Sensor System Board Normal 109F/ 43C 140F/ 60C +30 Basic Sensor I/O Zone Normal 168F/ 76C 230F/110C + + +=cut + +use strict; + + + + +open (HPLOGT,"/sbin/hplog -t |"); +#open (HPLOGT,"; +close HPLOGT; +my %hplog; + +#print "@hplog_t"; + +if($ARGV[0] and $ARGV[0] eq "config") { + + + print "graph_title HP server temperatures\n"; + print "graph_vlabel celsius\n"; + print "graph_category sensors\n"; + print "graph_info temperatures read using hplog -t\n"; + +} + + +foreach (@hplog_t) +{ + + #print; + chomp; + # will weed out ---C + if (m@^\s*(\d+)\s+Basic Sensor\s+(\S+[\S\s]+?\S+)\s+(\S+)\s+\S+?/\s*(\d+)C\s+\S+?/\s*(\d+)C@) + { + + my $id=$1; + my $label=$2; + my $status=$3; + my $temp=$4; + my $maxtemp=$5; + #print "$id $_\n"; + + #print "$id.label $label $id\n"; + + if($ARGV[0] and $ARGV[0] eq "config") { + + print "id_$id.label $id:$label\n"; + print "id_$id.critical $maxtemp\n"; + } + else + { + + print "id_$id.value $temp\n"; + } + + } + +} -#ID TYPE LOCATION STATUS CURRENT THRESHOLD -#1 ADM1022 Processor Zone Normal 104F/ 40C 143F/ 62C -#2 ADM1022 CPU (1) Normal 96F/ 36C 163F/ 73C -#3 ADM1022 I/O Zone Normal 118F/ 48C 154F/ 68C -#4 ADM1022 CPU (2) Normal 127F/ 53C 163F/ 73C -#5 ADM1022 Pwr. Supply Bay Normal 95F/ 35C 127F/ 53C -CPUNUMBER=0 -/sbin/hplog -t | ( while read a b c d e f g h i j k l m -do - if [ "$c" == "Processor" ] ; then - echo -n "processor_zone.value " - echo $g | sed 's/C//' - elif [ "$c" == "I/O" ] ; then - echo -n "io_zone.value " - echo $g | sed 's/C//' - elif [ "$c" == "CPU" ] ; then - echo -n "processor$CPUNUMBER.value " - echo $g | sed 's/C//' - CPUNUMBER=`expr $CPUNUMBER + 1` - elif [ "$c" == "Pwr." ] ; then - echo -n "psu_bay.value " - echo $h | sed 's/C//' - fi - -done -)