Projet

Général

Profil

Révision 0a1bbfa9

ID0a1bbfa901f90b4dc7a6efb4ba3e93a0265382ee
Parent d3a0ed0b
Enfant 8d7143d5

Ajouté par Zoltan Herpai il y a presque 14 ans

Up-to-date release

Voir les différences:

plugins/other/ipmisens-v3
8 8
#	following way:
9 9
#
10 10
#	ipmisens2_[machine]_[sensors]
11
#
11 12
#	Supported machines:
12
#	- Sun x4100/4100m2/4200/4200m2: x4x00 (temp, volt, fan)
13
#	- Sun V20z (V40z?): v20z (temp, volt, fan)
13
#	- Asus K8N-LR: asmb2 (temp, volt, fan)
14
#	- Dell DCS-XS23: xs23 (temp, volt, fan)
15
#	- Dell M610 blade: m610 (temp)
16
#	- Dell PowerEdge 2650: pe2650 (temp, volt, fan)
17
#	- Fujitsu TX120: tx120 (temp, volt, fan)
18
#	- HP Proliant ML350G5: proliantg5 (temp)
19
#	- HP Proliant DL380G5: proliantg5 (temp)
20
#	- HP Proliant DL385G1: hpasmcli (temp, fan)
21
#	- IBM HS21/HS22/Dataplex DX360: ibmhsxx (volt)
22
#	- IBM LS20/LS21: ibmlsxx (temp, volt)
23
#	- IBM LS41: ibmls4x (temp, volt)
24
#	- IBM x3200/x3550: ibmx3xx0 (temp, volt, fan)
14 25
#	- IBM x346: x346 (temp, volt, fan)
15
#	- Sun x2100/2100m2/2200/2200m2: x2100 (temp, volt, fan)
16 26
#	- Intel SHG2 mainboard: shg2 (temp, volt, fan)
27
#	- Sun x2100/2100m2/2200/2200m2: x2100 (temp, volt, fan)
17 28
#	- Sun x2250: x2250 (temp, volt, fan)
29
#	- Sun x2270: x2270 (temp, volt, fan)
30
#	- Sun x4100/4100m2/4200/4200m2/4600: x4x00 (temp, volt, fan)
18 31
#	- Sun x4150: x4150 (temp, volt, fan)
32
#	- Sun V20z (V40z?): v20z (temp, volt, fan)
33
#	- Supermicro X7DB8/X7DCL: aocipmi20e (temp, volt, fan)
34
#	- Supermicro X8DT6/X8DTT-F: hermon (temp, volt, fan)
19 35
#	- Verari VB1205XM: vb1205 (temp, volt)
20
#	- Dell PowerEdge 2650: pe2650 (temp, volt, fan)
21
#	- IBM x3200/x3550: ibmx3xx0 (temp, volt, fan)
22
#	- IBM LS20/LS21: ibmlsxx (temp, volt)
23
#	- IBM HS21: ibmhsxx (volt)
24
# - asmb2 missing due to lack of output yet
36
#
37
#	Supported but not tested:
38
#	- HP DL145G2: asmb2 (temp, volt, fan)
39
#
40
#	Notes:
41
#	- hpasmcli machtype requires HP's hpasmcli package, and the additional
42
#	  hpasmcliget script.
43
#
44
# Outputs submitted by:
45
# 	- Zoltan LAJBER <lajbi@lajli.gau.hu>
46
#	- Gergely MADARASZ <gorgo@broadband.hu>
47
#	- Louis van Belle <louis@van-belle.nl>
48
#	- Andras GOT <andrej@antiszoc.hu>
49
#	- Andras KORN <korn@chardonnay.math.bme.hu>
50
#	- Tamas TEVESZ <ice@extreme.hu>
51
#	- Gergely TOMKA <gergely@tomka.hu>
52
#	- Gabor SZOLLOSI <dev@localnet.hu>
53
#	- Reka KAROLYI <reka@karolyi.eu>
54
#	- Andras HORVATH <Andras.Horvath@cern.ch>
55
#
56
# CHANGELOG
57
#
58
# Revision 3.01		2010/09/23 Zoltan HERPAI <wigyori@uid0.hu>
59
#			* Add support for handling non-ipmitool-based machtypes
60
#			* Add support for HP Proliant DL385G1
61
#
62
# Revision 3.00		2010/05/25 Zoltan HERPAI <wigyori@uid0.hu>
63
#			* Add support for Supermicro X7DB8 via AOC IPMI20-E (aocipmi20e)
64
#			* Add support for Supermicro X7DCL via AOC IPMI20-E (aocipmi20e)
65
#			* Add support for Supermicro X8DT6 via Winbond Hermon BMC (hermon)
66
#			* Add support for Supermicro X8DTT-F via Winbond Hermon BMC (hermon)
67
#			* Add support for Dell M610 (m610)
68
#			* Add support for HP DL380G5 (proliantg5)
69
#			* Add support for HP ML350G5 (proliantg5)
70
#			* Re-add support for Asus K8N-LR via ASMB2 (asmb2)
71
#			* Add to-be-tested support for HP DL145G2 as per Paulo@muninexchange (asmb2)
72
#
73
# Revision 3.00early4	2010/01/09 Zoltan HERPAI <wigyori@uid0.hu>
74
#			* Add support for IBM HS22 (ibmhsxx)
75
#			* Add support for IBM iDataplex DX360 (ibmhsxx)
76
#			* Add support for Dell DCS XS23-sc (xs23)
77
#
78
# Revision 3.00early3	2009/12/30 Zoltan HERPAI <wigyori@uid0.hu>
79
#			* Support for easier debugging ($debug)
80
#			* Add support for IBM LS41 (ibmls4x)
81
#			* Add complete support for Sun x2270 (x2270)
82
#			* Add support for Sun x4500 (x4x00)
83
#			* Add support for Fujitsu-Siemens TX120 (tx120)
84
#
85
# Revision 3.00early2	2009/09/09 Zoltan HERPAI <wigyori@uid0.hu>
86
#			* Minor bugfix due to munin brain damage
25 87
#
26 88
# Revision 3.00early	2009/09/01 Zoltan HERPAI <wigyori@uid0.hu>
27 89
#			* Complete rewrite in perl.
......
30 92
#
31 93

  
32 94
use strict;
95
use warnings;
33 96
use POSIX;
34 97
use FindBin qw($Script);
35 98

  
......
39 102
# set the ipmidump expiration to 1 day
40 103
my $TEMPREFRESH = 86400;
41 104
my $debug = 0;
105
my $devel = 0;
42 106

  
43 107
##############
44 108
# You should not need to edit anything below here
......
46 110
$ENV{PATH} = '/bin:/usr/bin:/usr/sbin';
47 111
$ENV{IFS} = "\n";
48 112

  
113
$0 =~ /.*_(.*)_(.*)/;
114
my $machine = $1;
115
my $sensor = $2;
116

  
49 117
# Test if ipmitool is available
50
`$IPMITOOL help 2> /dev/null`;
51
if ($?)
118
if ( !$devel )
52 119
{
53
	print "no ($IPMITOOL not found)";
54
	exit 1;
120
	if ( $machine ne 'hpasmcli' ) {
121
		`$IPMITOOL help 2> /dev/null`;
122
		if ($?)
123
		{
124
			print "no ($IPMITOOL not found)";
125
			exit 1;
126
		}
127
	}
55 128
}
56 129

  
57
$0 =~ /.*_(.*)_(.*)/;
58
my $machine = $1;
59
my $sensor = $2;
60 130

  
61 131
print "Machine: $machine , sensor: $sensor\n" if ($debug);
62 132

  
63 133
# check expiration time of the dumpfile
64
if ( -f $TEMPFILE && $curtime - (stat($TEMPFILE))[9] >= $TEMPREFRESH )
134
if ( !$devel )
65 135
{
66
	print "Unlinking $TEMPFILE...\n" if ($debug);
67
	unlink ($TEMPFILE);
136
	if ( $machine ne 'hpasmcli' ) {
137
		if ( -f $TEMPFILE && $curtime - (stat($TEMPFILE))[9] >= $TEMPREFRESH )
138
		{
139
			print "Unlinking $TEMPFILE...\n" if ($debug);
140
			unlink ($TEMPFILE);
141
		}
142
	}
68 143
}
69 144

  
70
if ( ! -f $TEMPFILE )
145
if ( !$devel )
71 146
{
72
	print "Writing dumpfile $TEMPFILE...\n" if ($debug);
73
	`$IPMITOOL sdr dump $TEMPFILE` || die $!;
74
	if ($?)
75
	{
76
		print "no (retcode $?)\n";
77
		exit 2;
147
	if ( $machine ne 'hpasmcli' ) {
148
		if ( ! -f $TEMPFILE )
149
		{
150
			print "Writing dumpfile $TEMPFILE...\n" if ($debug);
151
			`$IPMITOOL sdr dump $TEMPFILE` || die $!;
152
			if ($?)
153
			{
154
				print "no (retcode $?)\n";
155
				exit 2;
156
			}
157
		}
78 158
	}
79 159
}
80 160

  
161
my @ipmioutput;
162

  
81 163
# Read the sensors
82
my @ipmioutput = `$IPMITOOL sdr -S $TEMPFILE`;
164
if ( $machine ne 'hpasmcli' ) {
165
	@ipmioutput = `$IPMITOOL sdr -S $TEMPFILE`;
166
}
167
else {
168
	@ipmioutput = `cat /tmp/ipmi-sensors`;
169
}
170
#my @ipmioutput = `cat ~wigyori/ipmisens2/outputs/hp_ml350g5`;
171

  
83 172
if ($?)
84 173
{
85 174
	print "no (retcode $?)\n";
......
87 176
}
88 177

  
89 178
my $arg;
90
if ( defined($ARGV[0]) )
179
if ( defined($ARGV[0]) && $ARGV[0] ne "" )
91 180
{
181
	print "argv: ".$ARGV[0]."\n" if ($debug);
92 182
	if ( $ARGV[0] eq 'config' )	{ $arg = 'config'; }
93 183
	if ( $ARGV[0] eq 'autoconf' )	{ $arg = 'autoconf'; }
94 184
	
......
118 208
		
119 209
		if ( $sensor eq 'fan' )
120 210
		{
121
			%cnf = (
122
				'graph_title' => 'Fan speeds',
123
				'graph_vlabel' => 'RPM',
124
				'graph_category' => 'sensors',
125
			);
211
			if ( $machine ne 'hpasmcli' ) {
212
				%cnf = (
213
					'graph_title' => 'Fan speeds',
214
					'graph_vlabel' => 'RPM',
215
					'graph_category' => 'sensors',
216
				);
217
			}
218
			else {
219
				%cnf = (
220
					'graph_title' => 'Fan speeds',
221
					'graph_vlabel' => '%',
222
					'graph_category' => 'sensors',
223
				);
224
			}
126 225
		}
127 226
		
128 227
		# Static descriptors
......
170 269
		$base{'x4x00'}->{'p1v_vddio'} = 'CPU1 VDDIO';
171 270
		$base{'x4x00'}->{'p1v_vdd'} = 'CPU1 VDD';
172 271
		$base{'x4x00'}->{'p1v_vtt'} = 'CPU1 VTT';
173
		# Sun x4600 extents
272
		# Sun x4600 voltage extents
174 273
		$base{'x4x00'}->{'mbv_1v2'} = 'MB +1.2V';
175 274
		$base{'x4x00'}->{'mbv_1v5'} = 'MB +1.5V';
176 275
		$base{'x4x00'}->{'mbv_2v5'} = 'MB +2.5V';
......
247 346
		$base{'x4x00'}->{'mbt_amb0'} = 'System board 0';
248 347
		$base{'x4x00'}->{'mbt_amb1'} = 'System board 1';
249 348
		$base{'x4x00'}->{'mbt_amb2'} = 'System board 2';
349
		# Sun x4500 voltage extents
350
		$base{'x4x00'}->{'procp0v_1v25'} = 'CPU0 1.25V';
351
		$base{'x4x00'}->{'procp1v_1v25'} = 'CPU1 1.25V';
352
		$base{'x4x00'}->{'procp0v_1v5'} = 'CPU0 1.5V';
353
		$base{'x4x00'}->{'procp1v_1v5'} = 'CPU1 1.5V';
354
		$base{'x4x00'}->{'procp0v_2v5'} = 'CPU0 2.5V';
355
		$base{'x4x00'}->{'procp1v_2v5'} = 'CPU1 2.5V';
356
		$base{'x4x00'}->{'procv_1v8'} = 'CPU 1.8V';
357
		$base{'x4x00'}->{'iov_1v5'} = 'IO 1.5V';
358
		$base{'x4x00'}->{'iov_2v5'} = 'IO 2.5V';
359
		$base{'x4x00'}->{'iov_5v_disk'} = 'IO 5V disk';
360
		$base{'x4x00'}->{'iov_dash12v'} = 'IO -12V';
361
		# Sun x4500 temp extents
362
		$base{'x4x00'}->{'iofrontt_amb'} = 'IO front';
363
		$base{'x4x00'}->{'ioreart_amb'} = 'IO rear';
364
		$base{'x4x00'}->{'procfrontt_amb'} = 'CPU front';
365
		$base{'x4x00'}->{'procreart_amb'} = 'CPU rear';
366
		$base{'x4x00'}->{'procp0t_core'} = 'CPU0 temp';
367
		$base{'x4x00'}->{'procp1t_core'} = 'CPU1 temp';
368
		$base{'x4x00'}->{'dbpt_amb'} = 'DBP';
250 369
		
251 370
		# Sun V20z (V40z?)
252 371
		$base{'v20z'}->{'ambient'} = 'System';
......
323 442
		$base{'x2250'}->{'1v8_nic'} = 'NIC +1.8V';
324 443
		$base{'x2250'}->{'1v5_fbd'} = 'FBDIMM +1.5V';
325 444
		
445
		# Sun x2270
446
		$base{'x2270'}->{'3v3_stby'} = '3.3VSTBY';
447
		$base{'x2270'}->{'3v3'} = '+3.3V';
448
		$base{'x2270'}->{'5v'} = '+5V';
449
		$base{'x2270'}->{'12v'} = '+12V';
450
		$base{'x2270'}->{'3v3_vbat'} = '3.3VBAT';
451
		$base{'x2270'}->{'1v5'} = '+1.5V';
452
		$base{'x2270'}->{'p0_1v5_ddr'} = 'DDR P0 +1.5V';
453
		$base{'x2270'}->{'p1_1v5_ddr'} = 'DDR P1 +1.5V';
454
		$base{'x2270'}->{'p0_1v8'} = 'P0 +1.8V';
455
		$base{'x2270'}->{'p1_1v8'} = 'P1 +1.8V';
456
		$base{'x2270'}->{'p0_vtt'} = 'P0 VTT';
457
		$base{'x2270'}->{'p1_vtt'} = 'P1 VTT';
458
		$base{'x2270'}->{'p0_vccp'} = 'P0 VCCp';
459
		$base{'x2270'}->{'p1_vccp'} = 'P1 VCCp';
460
		
326 461
		# Sun x4150
327 462
		$base{'x4150'}->{'mb_t_amb0'} = 'MB Sensor 0';
328 463
		$base{'x4150'}->{'mb_t_amb1'} = 'MB Sensor 1';
......
417 552
		$base{'ibmhsxx'}->{'planar3_3v'} = '+3.3V';
418 553
		$base{'ibmhsxx'}->{'planar5v'} = '+5V';
419 554
		$base{'ibmhsxx'}->{'planarvbat'} = 'VBAT';
555
		# IBM iDataplex DX320 extents
556
		$base{'ibmhsxx'}->{'cpu1vcore'} = 'CPU1 Vcore';
557
		$base{'ibmhsxx'}->{'cpu2vcore'} = 'CPU2 Vcore';
420 558

  
421

  
559
		# Fujitsu-Siemens TX120
560
		$base{'tx120'}->{'12v'} = '12V';
561
		$base{'tx120'}->{'15v'} = '1.5V';
562
		$base{'tx120'}->{'18v'} = '1.8V';
563
		$base{'tx120'}->{'33v'} = '3.3V';
564
		$base{'tx120'}->{'5v'} = '5V';
565
		$base{'tx120'}->{'dash12v'} = '-12V';
566
		$base{'tx120'}->{'stdby33v'} = '3.3VSTBY';
567
		$base{'tx120'}->{'vtt'} = 'VTT';
568
		$base{'tx120'}->{'battery3v'} = '3VBAT';
569
		$base{'tx120'}->{'fanpsu'} = 'Fan PSU';
570
		$base{'tx120'}->{'fan1sys'} = 'Fan Sys 1';
571
		$base{'tx120'}->{'fan2sys'} = 'Fan Sys 2';
572
		$base{'tx120'}->{'fancpu'} = 'Fan CPU';
573
		$base{'tx120'}->{'ambient'} = 'Ambient';
574
		$base{'tx120'}->{'systemboard'} = 'System board';
575
		$base{'tx120'}->{'cpu'} = 'CPU';
576
		
577
		# Dell DCS XS23-sc
578
		$base{'xs23'}->{'systemfan'} = 'System fan';
579
		$base{'xs23'}->{'cpu0'} = 'CPU 0';
580
		$base{'xs23'}->{'cpu1'} = 'CPU 1';
581
		$base{'xs23'}->{'midplane'} = 'Midplane';
582
		$base{'xs23'}->{'p12v'} = 'Planar 12V';
583
		$base{'xs23'}->{'p15v'} = 'Planar 1.5V';
584
		$base{'xs23'}->{'p18v'} = 'Planar 1.8V';
585
		$base{'xs23'}->{'p33v'} = 'Planar 3.3V';
586
		$base{'xs23'}->{'p5v'} = 'Planar 5V';
587
		$base{'xs23'}->{'vtt'} = 'Vtt';
588
		$base{'xs23'}->{'vcc33vaux'} = 'Vcc 3.3V AUX';
589
		
590
		# Supermicro X8DT6 / X8DTT-F via Winbond Hermon BMC
591
		$base{'hermon'}->{'fan1'} = 'Fan 1';
592
		$base{'hermon'}->{'fan2'} = 'Fan 2';
593
		$base{'hermon'}->{'fan3'} = 'Fan 3';
594
		$base{'hermon'}->{'fan4'} = 'Fan 4';
595
		$base{'hermon'}->{'fan5'} = 'Fan 5';
596
		$base{'hermon'}->{'fan6'} = 'Fan 6';
597
		$base{'hermon'}->{'fan7'} = 'Fan 7';
598
		$base{'hermon'}->{'fan8'} = 'Fan 8';
599
		$base{'hermon'}->{'system'} = 'System';
600
		$base{'hermon'}->{'cpu1temp'} = 'CPU1 temp';
601
		$base{'hermon'}->{'cpu2temp'} = 'CPU2 temp';
602
		$base{'hermon'}->{'12v'} = '+12V';
603
		$base{'hermon'}->{'15v'} = '+1.5V';
604
		$base{'hermon'}->{'33v'} = '+3.3V';
605
		$base{'hermon'}->{'33vsb'} = '+3.3VSB';
606
		$base{'hermon'}->{'5v'} = '+5V';
607
		$base{'hermon'}->{'vbat'} = 'VBAT';
608
		$base{'hermon'}->{'cpu1dimm'} = 'CPU1 DIMM';
609
		$base{'hermon'}->{'cpu2dimm'} = 'CPU2 DIMM';
610
		$base{'hermon'}->{'cpu1vcore'} = 'CPU1 Vcore';
611
		$base{'hermon'}->{'cpu2vcore'} = 'CPU2 Vcore';
612
		
613
		# Most of these are similar on the Supermicro X* boards
614
		$base{'aocipmi20e'} = $base{'hermon'};
615
		$base{'aocipmi20e'}->{'dash12v'} = '-12V';
616
		$base{'aocipmi20e'}->{'5vsb'} = '+5VSB';
617
		$base{'aocipmi20e'}->{'fan7_cpu1'} = 'Fan7 / CPU1';
618
		$base{'aocipmi20e'}->{'fan8_cpu2'} = 'Fan8 / CPU2';
619
		$base{'aocipmi20e'}->{'sys'} = 'System';
620
		
621
		# Asus K8N-LR / HP DL145G2
622
		$base{'asmb2'}->{'cpufan1'} = 'CPU Fan 1';
623
		$base{'asmb2'}->{'cpufan2'} = 'CPU Fan 2';
624
		$base{'asmb2'}->{'frontfan1'} = 'Front Fan 1';
625
		$base{'asmb2'}->{'frontfan2'} = 'Front Fan 2';
626
		$base{'asmb2'}->{'rearfan1'} = 'Rear Fan 1';
627
		$base{'asmb2'}->{'rearfan2'} = 'Rear Fan 2';
628
		$base{'asmb2'}->{'cpu1thermal'} = 'CPU1';
629
		$base{'asmb2'}->{'systemthermal'} = 'System';
630
		$base{'asmb2'}->{'25vor18v'} = '+2.5V / +1.8V';
631
		$base{'asmb2'}->{'bat_cmos'} = 'VBAT';
632
		$base{'asmb2'}->{'cpuvcore1'} = 'CPU1 Vcore';
633
		$base{'asmb2'}->{'system12v'} = '+12V';
634
		$base{'asmb2'}->{'system15v'} = '+1.5V';
635
		$base{'asmb2'}->{'system5v'} = '+5V';
636
		$base{'asmb2'}->{'system3v'} = '+3V';
637
		$base{'asmb2'}->{'system5vsb'} = '+5VSTBY';
638
		
639
		# Dell M610 blade
640
		$base{'m610'}->{'ambienttemp'} = 'Ambient temp';
641
		$base{'m610'}->{'temp'} = 'Blade temp';
642
		
643
		# hpasmcli / Proliant DL385G1
644
		$base{'hpasmcli'}->{'cpu-1'} = 'CPU 1';
645
		$base{'hpasmcli'}->{'cpu-2'} = 'CPU 2';
646
		$base{'hpasmcli'}->{'i_o_zone'} = 'I/O zone';
647
		$base{'hpasmcli'}->{'power_supply_bay'} = 'PSU bay';
648
		$base{'hpasmcli'}->{'processor_zone'} = 'CPU zone';
649
		
422 650
		# Machine config, run through the file/output
423 651
		my $label; my $tmp;
424 652
		foreach my $line ( @ipmioutput )
......
432 660
				if ( $machine eq 'x346' ) { $line =~ /(.*) Tach.*/; $label = $1; }
433 661
				if ( $machine eq 'shg2' ) { $line =~ s/(.*)\s+\|.*RPM.*\|\s+ok/$1/; $label = $1; }
434 662
				if ( $machine eq 'x2250' ) { $line =~ /(.*)\/TACH.*RPM.*/; $label = $1; }
663
				if ( $machine eq 'x2270' ) { $line =~ /(.*)\/TACH.*RPM.*/; $label = $1; }
435 664
				if ( $machine eq 'x4150' ) { $line =~ /(.*)\/TACH.*RPM.*/; $label = $1; }
436 665
				if ( $machine eq 'pe2650' ) { $line =~ /(.*) RPM\s+\|.*RPM.*/; $label = $1; }
437 666
				if ( $machine eq 'ibmx3xx0' ) { $line =~ /(.*) Tach.*/; $label = $1; }
667
				if ( $machine eq 'tx120' ) { $line =~ /(.*)\s+\|.*RPM.*\|\s+ok/; $label = $1; }
668
				if ( $machine eq 'xs23' ) { $line =~ /(.*)\s+\|.*RPM.*\|\s+ok/; $label = $1; }
669
				if ( $machine eq 'hermon' ) { $line =~ /(.*)\s+\|.*RPM.*\|\s+ok/; $label = $1; }
670
				if ( $machine eq 'aocipmi20e' ) { $line =~ /(.*)\s+\|.*RPM.*\|\s+ok/; $label = $1; }
671
				if ( $machine eq 'asmb2' ) { $line =~ /(.*)\s+\|.*RPM.*\|\s+ok/; $label = $1; }
438 672
				
439 673
			}
674
			elsif ( $sensor eq 'fan' && $line =~ /\#\d+\s+\S+\s+Yes.*\%/ ) {
675
				if ( $machine eq 'hpasmcli' ) { $line =~ /\#(\d+)\s+(.*)\s+Yes.*\%.*/; $label = "$2_$1"; }
676
			}
440 677
			
441 678
			if ( $sensor eq 'temp' && $line =~ /.*degree.*ok/ )
442 679
			{
......
444 681
				if ( $machine eq 'v20z' ) { $line =~ /(.*)temp.*/; $label = $1; }
445 682
				if ( $machine eq 'x2100') { $line =~ s/(.*)\s+\|.*deg.*/\L$1/; $label = $line; }
446 683
				if ( $machine eq 'x346' ) { $line =~ /(.*) Temp.*/; $label = $1; }
684
				if ( $machine eq 'ibmls4x' ) { $line =~ /(.*) TEMP.*/; $label = $1; }
447 685
				if ( $machine eq 'shg2' ) { $line =~ /(.*)\s+\|.*deg.*/; $label = $1; }
448 686
				if ( $machine eq 'x2250' ) { $line =~ /MB\/T\_(.*)\s+\|.*deg.*/; $label = $1; }
687
				if ( $machine eq 'x2270' ) { $line =~ /MB\/T\_(.*)\s+\|.*deg.*/; $label = $1; }
449 688
				if ( $machine eq 'x4150' ) { $line =~ /(.*)\s+\|.*deg.*/; $label = $1; }
450 689
				if ( $machine eq 'vb1205' ) { $line =~ /(.*)\s+\|.*deg.*/; $label = $1; }
451 690
				if ( $machine eq 'pe2650' ) { $line =~ /(.*) Temp.*/; $label = $1; }
452 691
				if ( $machine eq 'ibmx3xx0' ) { $line =~ /(.*) Temp.*/; $label = $1; }
453 692
				if ( $machine eq 'ibmlsxx' ) { $line =~ /(.*) TEMP.*/; $label = $1; }
454
				
693
				if ( $machine eq 'tx120' ) { $line =~ /(.*)\ \|.*deg.*/; $label = $1; }
694
				if ( $machine eq 'xs23' ) { $line =~ /(.*)\ Temp\s+|.*deg.*/; $label = $1; }
695
				if ( $machine eq 'hermon' ) { $line =~ /(.*)\ Temp\s+|.*deg.*/; $label = $1; }
696
				if ( $machine eq 'aocipmi20e' ) { $line =~ /(.*)\ Temp\s+|.*deg.*/; $label = $1; }
697
				if ( $machine eq 'asmb2' ) { $line =~ /(.*)\s+\|.*deg.*/; $label = $1; }
698
				if ( $machine eq 'm610' ) { $line =~ /(.*)\s+\|.*deg.*/; $label = $1; }
699
				if ( $machine eq 'proliantg5' ) { $line =~ /(.*)\s+\|.*deg.*/; $label = $1; }
700
			}
701
			elsif ( $sensor eq 'temp' && $line =~ /\d+C\/\d+F/ ) {
702
				if ( $machine eq 'hpasmcli' ) { $line =~ /.*\s+(.*)\s+\d+C\/\d+F\s+\d+C\/\d+F/; $label = $1; }
455 703
			}
456 704
			
457 705
			if ( $sensor eq 'volt' && $line =~ /.*Volts.*/ )
......
460 708
				if ( $machine eq 'v20z' ) { $line =~ /(.*)\ \|.*Volts.*/; $label = $1; }
461 709
				if ( $machine eq 'x2100') { $line =~ s/(.*)\s+\|.*Volts.*/\L$1/; $label = $line; }
462 710
				if ( $machine eq 'x346' ) { $line =~ /(.*)\s+\|.*Volts.*/; $label = $1; }
711
				if ( $machine eq 'ibmls4x' ) { $line =~ /(.*)\s+\|.*Volts.*/; $label = $1; }
463 712
				if ( $machine eq 'shg2' ) { $line =~ /(.*)\s+\|.*Volts.*/; $label = $1; }
464 713
				if ( $machine eq 'x2250' ) { $line =~ /MB\/V\_(.*)\s+\|.*Volts.*/; $label = $1; }
714
				if ( $machine eq 'x2270' ) { $line =~ /MB\/(.*)\s+\|.*Volts.*/; $label = $1; }
465 715
				if ( $machine eq 'x4150' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1;  }
466 716
				if ( $machine eq 'vb1205' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1; $label =~ s/\./_/g; }
467 717
				if ( $machine eq 'pe2650' ) { $line =~ /(.*) Volt\s+\|.*Volts.*/; $label = $1; }
468 718
				if ( $machine eq 'ibmx3xx0' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1; }
469 719
				if ( $machine eq 'ibmlsxx' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1; $label =~ s/\./_/g; }
470 720
				if ( $machine eq 'ibmhsxx' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1; $label =~ s/\./_/g; }
471
				
472
				
721
				if ( $machine eq 'tx120' ) { $line =~ /(.*)\ \|.*Volts.*/; $label = $1; }
722
				if ( $machine eq 'xs23' ) { $line =~ /(.*)\s+\|.*Volts.*/; $label = $1; }
723
				if ( $machine eq 'hermon' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1;  }
724
				if ( $machine eq 'aocipmi20e' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1;  }
725
				if ( $machine eq 'asmb2' ) { $line =~ /(.*)\s+\|\s+.*Volts.*/; $label = $1;  }
473 726
			}
474 727
			
475 728
			if ( $label )
......
480 733
				$label =~ s/\s+//g;
481 734
				$label =~ s/(.*)/\L$1/;
482 735
				$label =~ s/\//_/g;
736
				$label =~ s/\#/_/g;
737
				
738
				# Random fixups
739
				if ( $machine eq 'x2270' )	{ $label =~ s/v_//; }
740
				if ( $machine eq 'x4x00' )	{ $label =~ s/^sysv\_/mbv\_/; }
741
				if ( $machine eq 'tx120' )	{ $label =~ s/main//; }
483 742
				
484 743
				if ( $base{$machine}->{$label} )
485 744
				{
......
513 772
		if ( $machine eq 'x346' ) { $line =~ /(.*) Tach\s+\| (\d+) RPM.*/; $label = $1; $value = $2; }
514 773
		if ( $machine eq 'shg2' ) { $line =~ /(.*)\s+\|\s+(.*) RPM.*\|.*ok/; $label = $1; $value = $2; }
515 774
		if ( $machine eq 'x2250' ) { $line =~ /(.*)\/TACH\s+\|\s+(.*) RPM.*/; $label = $1; $value = $2; }
775
		if ( $machine eq 'x2270' ) { $line =~ /(.*)\/TACH\s+\|\s+(.*) RPM.*/; $label = $1; $value = $2; }
516 776
		if ( $machine eq 'x4150' ) { $line =~ /(.*)\/TACH\s+\|\s+(\S+) RPM.*/; $label = $1; $value = $2; }
517 777
		if ( $machine eq 'pe2650' ) { $line =~ /(.*) RPM\s+\|\s+(\S+) RPM.*/; $label = $1; $value = $2; }
518 778
		if ( $machine eq 'ibmx3xx0' ) { $line =~ /(.*) Tach\s+\|\s+(\S+) RPM.*/; $label = $1; $value = $2; }
779
		if ( $machine eq 'tx120' ) { $line =~ /(.*)\s+\|\s+(.*) RPM.*\|\s+ok/; $label = $1; $value = $2; }
780
		if ( $machine eq 'xs23' ) { $line =~ /(.*)\s+\|\s+(.*) RPM.*\|\s+ok/; $label = $1; $value = $2; }
781
		if ( $machine eq 'hermon' ) { $line =~ /(.*)\s+\|\s+(.*) RPM.*\|\s+ok/; $label = $1; $value = $2; }
782
		if ( $machine eq 'aocipmi20e' ) { $line =~ /(.*)\s+\|\s+(.*) RPM.*\|\s+ok/; $label = $1; $value = $2; }
783
		if ( $machine eq 'asmb2' ) { $line =~ /(.*)\s+\|\s+(.*) RPM.*\|\s+ok/; $label = $1; $value = $2; }
519 784
	}
520
	
785
	elsif ( $sensor eq 'fan' && $line =~ /\#\d+\s+\S+\s+Yes.*\%/ ) {
786
		if ( $machine eq 'hpasmcli' ) { $line =~ /\#(\d+)\s+(.*)\s+Yes\s+\w+\s+(\d+)\%.*/; $label = "$2_$1"; $value = $3; }
787
	}
788
                                                        	
521 789
	if ( $sensor eq 'temp' && $line =~ /.*degree.*ok/ )
522 790
	{
523 791
		if ( $machine eq 'x4x00' ) { $line =~ /(.*)\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
524 792
		if ( $machine eq 'v20z' ) { $line =~ /(.*)temp\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
525 793
		if ( $machine eq 'x2100' ) { $line =~ s/(.*)\s+\|\s+(\d+) deg.*/\L$1/; $label = $line; $value = $2; }
526 794
		if ( $machine eq 'x346' ) { $line =~ /(.*) Temp\s+\|\s+(\d+) deg.*/; $label = $1; $value = $2; }
795
		if ( $machine eq 'ibmls4x' ) { $line =~ /(.*) TEMP\s+\|\s+(\d+) deg.*/; $label = $1; $value = $2; }
527 796
		if ( $machine eq 'shg2' ) { $line =~ /(.*)\s+\|\s+(\d+) deg.*/; $label = $1; $value = $2; }
528 797
		if ( $machine eq 'x2250' ) { $line =~ /MB\/T\_(.*)\s+\|\s+(\d+) deg.*/; $label = $1; $value = $2; }
798
		if ( $machine eq 'x2270' ) { $line =~ /MB\/T\_(.*)\s+\|\s+(\d+) deg.*/; $label = $1; $value = $2; }
529 799
		if ( $machine eq 'x4150' ) { $line =~ /(.*)\s+\|\s+(\S+) deg.*/; $label = $1; $value = $2; }
530 800
		if ( $machine eq 'vb1205' ) { $line =~ /(.*)\s+\|\s+(\S+) deg.*/; $label = $1; $value = $2; }
531 801
		if ( $machine eq 'pe2650' ) { $line =~ /(.*) Temp\s+\|\s+(\S+) deg.*/; $label = $1; $value = $2; }
532 802
		if ( $machine eq 'ibmx3xx0' ) { $line =~ /(.*) Temp\s+\|\s+(\S+) deg.*/; $label = $1; $value = $2; }
533 803
		if ( $machine eq 'ibmlsxx' ) { $line =~ /(.*) TEMP\s+\|\s+(\S+) deg.*/; $label = $1; $value = $2; }
804
		if ( $machine eq 'tx120' ) { $line =~ /(.*)\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
805
		if ( $machine eq 'xs23' ) { $line =~ /(.*)\ Temp\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
806
		if ( $machine eq 'hermon' ) { $line =~ /(.*)\ Temp\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }   
807
		if ( $machine eq 'aocipmi20e' ) { $line =~ /(.*)\ Temp\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
808
		if ( $machine eq 'asmb2' ) { $line =~ /(.*)\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
809
		if ( $machine eq 'm610' ) { $line =~ /(.*)\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
810
		if ( $machine eq 'proliantg5' ) { $line =~ /(.*)\s+\|\s+(\S+)\ deg.*/; $label = $1; $value = $2; }
534 811
	}
812
	elsif ( $sensor eq 'temp' && $line =~ /\d+C\/\d+F/ ) {
813
		if ( $machine eq 'hpasmcli' ) { $line =~ /.*\s+(.*)\s+(\d+)C\/\d+F\s+\d+C\/\d+F/; $label = $1; $value = $2; } 
814
	}	                                                        
535 815
	
536 816
	if ( $sensor eq 'volt' && $line =~ /.*Volt.*ok/ )
537 817
	{
......
539 819
		if ( $machine eq 'v20z' ) { $line =~ /(.*)\s+\|\s+(\S+)\ Volt.*/; $label = $1; $value = $2; }
540 820
		if ( $machine eq 'x2100' ) { $line =~ s/(.*)\s+\|\s+(\S+)\ Volt.*/\L$1/; $label = $line; $value = $2; }
541 821
		if ( $machine eq 'x346' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
822
		if ( $machine eq 'ibmls4x' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
542 823
		if ( $machine eq 'shg2' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
543 824
		if ( $machine eq 'x2250' ) { $line =~ /MB\/V\_(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
825
		if ( $machine eq 'x2270' ) { $line =~ /MB\/(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
544 826
		if ( $machine eq 'x4150' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
545 827
		if ( $machine eq 'vb1205' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; $label =~ s/\./_/g; }
546 828
		if ( $machine eq 'pe2650' ) { $line =~ /(.*) Volt\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
547 829
		if ( $machine eq 'ibmx3xx0' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
548 830
		if ( $machine eq 'ibmlsxx' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; $label =~ s/\./_/g; }
549 831
		if ( $machine eq 'ibmhsxx' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; $label =~ s/\./_/g; }
550
		
832
		if ( $machine eq 'tx120' ) { $line =~ /(.*)\ \|\s+(\S+)\ Volt.*/; $label = $1; $value = $2; }
833
		if ( $machine eq 'xs23' ) { $line =~ /(.*)\ \|\s+(\S+)\ Volt.*/; $label = $1; $value = $2; }
834
		if ( $machine eq 'hermon' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
835
		if ( $machine eq 'aocipmi20e' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
836
		if ( $machine eq 'asmb2' ) { $line =~ /(.*)\s+\|\s+(\S+) Volts.*/; $label = $1; $value = $2; }
551 837
	}
552 838

  
553 839
	if ( $label )
......
558 844
		$label =~ s/\s+//g;
559 845
		$label =~ s/(.*)/\L$1/;
560 846
		$label =~ s/\//_/g;
847
		$label =~ s/\#/_/g;
848
		
849
		# Random fixups
850
		if ( $machine eq 'x2270' )	{ $label =~ s/v_//; }
851
		if ( $machine eq 'x4x00' )	{ $label =~ s/^sysv\_/mbv\_/; }
852
		if ( $machine eq 'tx120' )	{ $label =~ s/main//; }
853
		
561 854
                                		
562 855
		$res{$label} = $value;
563 856
	}

Formats disponibles : Unified diff