fix condition regarding to new change_bytes handling

This commit is contained in:
Sims24 2017-03-08 11:24:32 +01:00
parent 3a43373062
commit 4bbed8ceff
1 changed files with 6 additions and 6 deletions

View File

@ -34,14 +34,14 @@ sub custom_metric_output {
my $message; my $message;
if ($self->{result_values}->{type} eq 'unique') { if ($self->{result_values}->{type} eq 'unique') {
if (defined($config_data->{selection}->{$self->{result_values}->{instance}}->{formatting})) { if (defined($config_data->{selection}->{$self->{result_values}->{instance}}->{formatting}->{printf_var}) && defined($config_data->{selection}->{$self->{result_values}->{instance}}->{formatting}->{printf_msg})) {
eval { eval {
local $SIG{__WARN__} = sub { $message = $_[0]; }; local $SIG{__WARN__} = sub { $message = $_[0]; };
local $SIG{__DIE__} = sub { $message = $_[0]; }; local $SIG{__DIE__} = sub { $message = $_[0]; };
$msg = sprintf("$config_data->{selection}->{$self->{result_values}->{instance}}->{formatting}->{printf_msg}", $msg = sprintf("$config_data->{selection}->{$self->{result_values}->{instance}}->{formatting}->{printf_msg}",
eval "$config_data->{selection}->{$self->{result_values}->{instance}}->{formatting}->{printf_var}"); eval "$config_data->{selection}->{$self->{result_values}->{instance}}->{formatting}->{printf_var}");
}; };
} elsif (exists($config_data->{filters}->{formatting}->{printf_var}) && exists($config_data->{filters}->{formatting}->{printf_msg})) { } elsif (defined($config_data->{filters}->{formatting}->{printf_var}) && defined($config_data->{filters}->{formatting}->{printf_msg})) {
eval { eval {
local $SIG{__WARN__} = sub { $message = $_[0]; }; local $SIG{__WARN__} = sub { $message = $_[0]; };
local $SIG{__DIE__} = sub { $message = $_[0]; }; local $SIG{__DIE__} = sub { $message = $_[0]; };
@ -361,22 +361,22 @@ Specify the full path to a json config file
=item B<--json-data> =item B<--json-data>
Get JSON on the fly Specify the full path to a json config file
=item B<--filter-counters> =item B<--filter-counters>
Filter some counter (can be 'metric' or 'global') Filter some counter (can be 'unique' or 'global')
Useless, if you use selection/filter but not Useless, if you use selection/filter but not
global/virtual curves global/virtual curves
=item B<--warning-*> =item B<--warning-*>
Warning threshold (can be 'metric' or 'global') Warning threshold (can be 'unique' or 'global')
(Override config_file if set) (Override config_file if set)
=item B<--critical-*> =item B<--critical-*>
Critical threshold (can be 'metric' or 'global') Critical threshold (can be 'unique' or 'global')
(Override config_file if set) (Override config_file if set)
=back =back