Projet

Général

Profil

Révision 548a2b62

ID548a2b626eb6a794ccd194d943bcc956e14908c4
Parent 0adad546
Enfant 5b22647d

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

freeipmi: implement suggestions from Bart ten Brinke for FreeIPMI 1.1.x.

This adds support for versions of FreeIPMI before 1.2 (without the
threshold information), and explicits the dependency information.

It also works with older Munin nodes where dirtyconfig is not supported.

Voir les différences:

plugins/sensors/freeipmi
17 17
non-wildcard plugin, i.e., 'freeipmi', whereas when used to monitor a
18 18
foreign host it should be, e.g., 'freeipmi_192.168.0.253'.
19 19

  
20
=head1 DEPENDENCIES
21

  
22
The plugin requires FreeIPMI 1.1.5 or later to fetch the information.
23
Limits set on thresholds are available when using FreeIPMI 1.2.0 or
24
later.
25

  
20 26
=head1 AUTHOR
21 27

  
22 28
Diego Elio Pettenò <flameeyes@flameeyes.eu>.
23 29

  
30
With help and suggestions of:
31

  
32
Bart ten Brinke <info@retrosync.com>
33

  
34
=head1 LICENSE
35

  
36
GPLv2
37

  
38
=head1 MAGIC MARKERS
39

  
40
 #%# family=auto
41
 #%# capabilities=autoconf
42

  
24 43
=head1 LICENSE
25 44

  
26 45
GPLv2
......
42 61
$0 =~ /freeipmi(?:_(.+))$/;
43 62
my $hostname = $1;
44 63

  
45
$IPMISENSORS .= " --quiet-cache --comma-separated-output --no-header-output --ignore-not-available-sensors --sensor-types=Temperature,Fan,Current,Voltage --output-sensor-thresholds";
64
my $help_output = `$IPMISENSORS --help`;
65

  
66
$IPMISENSORS .= " --output-sensor-thresholds" if $help_output =~ /--output-sensor-thresholds/;
67
$IPMISENSORS .= " --quiet-cache --comma-separated-output --no-header-output --ignore-not-available-sensors --sensor-types=Temperature,Fan,Current,Voltage";
46 68
$IPMISENSORS .= " --hostname=$hostname" if defined($hostname);
47 69
$IPMISENSORS .= " --username=$ENV{IPMI_USERNAME}" if defined($ENV{IPMI_USERNAME});
48 70
$IPMISENSORS .= " --password=$ENV{IPMI_PASSWORD}" if defined($ENV{IPMI_PASSWORD});
49 71

  
50
my $output=`$IPMISENSORS --output-sensor-thresholds 2>/dev/null`;
72
my $output=`$IPMISENSORS 2>/dev/null`;
51 73
my $retval=$?;
52 74

  
53 75
if ( defined $ARGV[0] and $ARGV[0] eq 'autoconf' ) {
......
158 180
    }
159 181
  }
160 182

  
161
  unless ( $ENV{MUNIN_CAP_DIRTYCONFIG} == 1 ) {
183
  unless ( ($ENV{MUNIN_CAP_DIRTYCONFIG} || 0) == 1 ) {
162 184
    exit 0;
163 185
  }
164 186
}

Formats disponibles : Unified diff