mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
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.
This commit is contained in:
parent
0adad54696
commit
548a2b626e
@ -17,10 +17,29 @@ When used for the local host, the plugin should be linked as
|
||||
non-wildcard plugin, i.e., 'freeipmi', whereas when used to monitor a
|
||||
foreign host it should be, e.g., 'freeipmi_192.168.0.253'.
|
||||
|
||||
=head1 DEPENDENCIES
|
||||
|
||||
The plugin requires FreeIPMI 1.1.5 or later to fetch the information.
|
||||
Limits set on thresholds are available when using FreeIPMI 1.2.0 or
|
||||
later.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Diego Elio Pettenò <flameeyes@flameeyes.eu>.
|
||||
|
||||
With help and suggestions of:
|
||||
|
||||
Bart ten Brinke <info@retrosync.com>
|
||||
|
||||
=head1 LICENSE
|
||||
|
||||
GPLv2
|
||||
|
||||
=head1 MAGIC MARKERS
|
||||
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
=head1 LICENSE
|
||||
|
||||
GPLv2
|
||||
@ -42,12 +61,15 @@ my $IPMISENSORS = $ENV{'ipmisensors'} || 'ipmi-sensors';
|
||||
$0 =~ /freeipmi(?:_(.+))$/;
|
||||
my $hostname = $1;
|
||||
|
||||
$IPMISENSORS .= " --quiet-cache --comma-separated-output --no-header-output --ignore-not-available-sensors --sensor-types=Temperature,Fan,Current,Voltage --output-sensor-thresholds";
|
||||
my $help_output = `$IPMISENSORS --help`;
|
||||
|
||||
$IPMISENSORS .= " --output-sensor-thresholds" if $help_output =~ /--output-sensor-thresholds/;
|
||||
$IPMISENSORS .= " --quiet-cache --comma-separated-output --no-header-output --ignore-not-available-sensors --sensor-types=Temperature,Fan,Current,Voltage";
|
||||
$IPMISENSORS .= " --hostname=$hostname" if defined($hostname);
|
||||
$IPMISENSORS .= " --username=$ENV{IPMI_USERNAME}" if defined($ENV{IPMI_USERNAME});
|
||||
$IPMISENSORS .= " --password=$ENV{IPMI_PASSWORD}" if defined($ENV{IPMI_PASSWORD});
|
||||
|
||||
my $output=`$IPMISENSORS --output-sensor-thresholds 2>/dev/null`;
|
||||
my $output=`$IPMISENSORS 2>/dev/null`;
|
||||
my $retval=$?;
|
||||
|
||||
if ( defined $ARGV[0] and $ARGV[0] eq 'autoconf' ) {
|
||||
@ -158,7 +180,7 @@ END
|
||||
}
|
||||
}
|
||||
|
||||
unless ( $ENV{MUNIN_CAP_DIRTYCONFIG} == 1 ) {
|
||||
unless ( ($ENV{MUNIN_CAP_DIRTYCONFIG} || 0) == 1 ) {
|
||||
exit 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user