3 # Graph temperature on Proliant Servers
8 my $hpasmcli = "/sbin/hpasmcli";
9 my $cmd = "$hpasmcli -s \"show temp\"";
10 # C/F : graph temp in celsius or fahrenheit
16 #(-f $hpasmcli) || exit(1);
18 foreach my $line (@result) {
23 my ($sensor, $loc, $temp, $threshold) = split(/\s/, $line);
24 next if ($temp eq "-");
26 $temp = $degree eq "C" ? (split(/\//, $temp))[0] : (split(/\//, $temp))[1];
28 $threshold = $degree eq "C" ? (split(/\//, $threshold))[0] : (split(/\//, $threshold))[1];
29 $threshold =~ s/C|F//g;
32 $val{$sensor} = {location => lc($loc),
34 threshold => $threshold
41 if ($ARGV[0] && $ARGV[0] eq "config") {
43 print "graph_title Temperature\n";
44 print "graph_vlabel temperature in °$degree\n";
45 print "graph_category sensors\n";
46 while (my ($k, $hashref) = each (%val)) {
47 print "$hashref->{location}.label $hashref->{location}\n";
48 print "$hashref->{location}.warning ".($hashref->{threshold} - 5) ."\n";
49 print "$hashref->{location}.critical $hashref->{threshold}\n";
54 while (my ($k, $hashref) = each (%val)) {
55 print "$hashref->{location}.value $hashref->{temp}\n";