Fix numericvalue mode and avoid error messages

This commit is contained in:
Quentin Garnier 2014-06-03 09:29:48 +02:00
parent 3ad4a4e3a9
commit 65c0426d92
3 changed files with 6 additions and 3 deletions

View File

@ -184,7 +184,10 @@ sub output_add {
sub perfdata_add {
my ($self, %options) = @_;
my $perfdata = {'label' => '', 'value' => '', unit => '', warning => '', critical => '', min => '', max => ''};
$perfdata = {%$perfdata, %options};
foreach (keys %options) {
next if (!defined($options{$_}));
$perfdata->{$_} = $options{$_};
}
$perfdata->{label} =~ s/'/''/g;
push @{$self->{perfdatas}}, $perfdata;
}

View File

@ -119,7 +119,7 @@ __END__
=head1 MODE
Check current/average connections on Cisco ASA (CISCO-UNIFIED-FIREWALL-MIB).
Check failover status on Cisco ASA (CISCO-UNIFIED-FIREWALL-MIB).
=over 8

View File

@ -60,7 +60,7 @@ sub new {
"format-scale-unit:s" => { name => 'format_scale_unit', default => 'other'},
"perfdata-unit:s" => { name => 'perfdata_unit', default => ''},
"perfdata-name:s" => { name => 'perfdata_name', default => 'value'},
"perfdata-max:s" => { name => 'perfdata_min', default => ''},
"perfdata-min:s" => { name => 'perfdata_min', default => ''},
"perfdata-max:s" => { name => 'perfdata_max', default => ''},
});
$self->{statefile_cache} = centreon::plugins::statefile->new(%options);