Projet

Général

Profil

Révision f63f73d3

IDf63f73d3b537e9563de0f4b4cee18a52b9288e5d
Parent 65fb3d8e
Enfant 7dd40e24

Ajouté par Diego Elio Pettenò il y a environ 13 ans

sensors/hplog_*: remove in favour of hpasmcli2_

These two plugins are using a different command coming from the same
package as hpasmcli, they lack a license identification, and are a tad
more rough than the one that would replace them.

Voir les différences:

plugins/sensors/hplog_f-a-hp-proliant-server-fans-speed
1
#!/bin/bash
2

  
3
if [ "$1" == "config" ] ; then
4
	echo "graph_title HP server fan speed"
5
	echo "graph_vlabel speed"
6
	echo "graph_category sensors"
7
	echo "graph_info This graph shows the speed of the system fans"
8

  
9
	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"  }'
10
	exit 0
11
fi
12

  
13
#ID     TYPE        LOCATION      STATUS  REDUNDANT FAN SPEED 
14
#1  Var. Speed   Processor Zone  Normal     N/A     Low    ( 10)
15
#2  Var. Speed   System Board    Normal     N/A     Low    ( 10)
16
#6  Var. Speed   System Board    Normal     Yes     Low    ( 13)
17
#ID     TYPE        LOCATION      STATUS  REDUNDANT FAN SPEED 
18
# 1  Var. Speed   Virtual         Normal     N/A     Low    ( 19)
19

  
20

  
21
hplog -f | perl -ne 'if ( m/(System|Processor|Virtual)/) { $t=lc($1); $count[$t]++; m/\( *(\d+)\)/; print "${t}_$count[$t].value $1\n"  }'
plugins/sensors/hplog_t-a-hp-proliant-server-temperatures
1
#!/usr/bin/perl -w 
2

  
3
=head hplog_t
4

  
5
DL 380 G6
6
ID     TYPE        LOCATION      STATUS    CURRENT  THRESHOLD 
7
 1  Basic Sensor Ambient         Normal    68F/ 20C 105F/ 41C 
8
 2  Basic Sensor CPU (1)         Normal   104F/ 40C 179F/ 82C 
9
 3  Basic Sensor CPU (2)         Normal   104F/ 40C 179F/ 82C 
10
 4  Basic Sensor Memory Board    Normal   105F/ 41C 188F/ 87C 
11
 5  Basic Sensor Memory Board    Normal   105F/ 41C 188F/ 87C 
12
 6  Basic Sensor Memory Board    Normal   100F/ 38C 188F/ 87C 
13
 7  Basic Sensor Memory Board    Normal    98F/ 37C 188F/ 87C 
14
 8  Basic Sensor Pwr. Supply Bay Normal   123F/ 51C 194F/ 90C 
15
 9  Basic Sensor Pwr. Supply Bay Normal   105F/ 41C 149F/ 65C 
16
10  Basic Sensor I/O Zone        Normal   125F/ 52C 194F/ 90C 
17
11  Basic Sensor I/O Zone        Normal   114F/ 46C 158F/ 70C 
18
12  Basic Sensor I/O Zone        Normal   131F/ 55C 194F/ 90C 
19
13  Basic Sensor I/O Zone        Normal   ---F/---C 158F/ 70C 
20
14  Basic Sensor I/O Zone        Normal   ---F/---C 158F/ 70C 
21
15  Basic Sensor I/O Zone        Normal   ---F/---C 158F/ 70C 
22
16  Basic Sensor I/O Zone        Normal   ---F/---C 158F/ 70C 
23
17  Basic Sensor I/O Zone        Normal   ---F/---C 158F/ 70C 
24
18  Basic Sensor I/O Zone        Normal   ---F/---C 158F/ 70C 
25
19  Basic Sensor Processor Zone  Normal    95F/ 35C 158F/ 70C 
26
20  Basic Sensor Processor Zone  Normal    95F/ 35C 158F/ 70C 
27
21  Basic Sensor Processor Zone  Normal   105F/ 41C 176F/ 80C 
28
22  Basic Sensor Processor Zone  Normal   102F/ 39C 176F/ 80C 
29
23  Basic Sensor I/O Zone        Normal   118F/ 48C 170F/ 77C 
30
24  Basic Sensor Memory Board    Normal   109F/ 43C 158F/ 70C 
31
25  Basic Sensor Memory Board    Normal    98F/ 37C 158F/ 70C 
32
26  Basic Sensor Memory Board    Normal    98F/ 37C 158F/ 70C 
33
27  Basic Sensor I/O Zone        Normal   ---F/---C 158F/ 70C 
34
28  Basic Sensor I/O Zone        Normal   ---F/---C 158F/ 70C 
35
29  Basic Sensor System Board    Normal   109F/ 43C 140F/ 60C 
36
30  Basic Sensor I/O Zone        Normal   168F/ 76C 230F/110C 
37

  
38

  
39
=cut 
40

  
41
use strict;
42

  
43

  
44

  
45

  
46
open (HPLOGT,"/sbin/hplog -t |");
47
#open (HPLOGT,"<hplog_t-example");
48
my @hplog_t=<HPLOGT>;
49
close HPLOGT;
50
my %hplog;
51

  
52
#print "@hplog_t";
53

  
54
if($ARGV[0] and $ARGV[0] eq "config") {
55
        
56

  
57
	print "graph_title HP server temperatures\n";
58
	print "graph_vlabel celsius\n";
59
	print "graph_category sensors\n";
60
	print "graph_info temperatures read using hplog -t\n";
61
        
62
}
63

  
64

  
65
foreach (@hplog_t)
66
{
67
    
68
    #print;
69
    chomp;
70
    # will weed out ---C
71
    if (m@^\s*(\d+)\s+Basic Sensor\s+(\S+[\S\s]+?\S+)\s+(\S+)\s+\S+?/\s*(\d+)C\s+\S+?/\s*(\d+)C@)
72
    {
73
                
74
        my $id=$1;
75
        my $label=$2;
76
        my $status=$3;
77
        my $temp=$4;
78
        my $maxtemp=$5;
79
        #print "$id $_\n";
80
        
81
        #print "$id.label $label $id\n";
82

  
83
        if($ARGV[0] and $ARGV[0] eq "config") {
84
            
85
            print "id_$id.label $id:$label\n";
86
            print "id_$id.critical $maxtemp\n";
87
        }
88
        else
89
        {
90
            
91
            print "id_$id.value $temp\n";
92
        }
93
        
94
    }
95
    
96
}
97

  
98

  
99

  

Formats disponibles : Unified diff