+ Fix #225
This commit is contained in:
parent
59e87945eb
commit
e8faac756e
|
@ -142,7 +142,7 @@ sub run {
|
||||||
my @exits;
|
my @exits;
|
||||||
foreach (keys %{$maps_counters}) {
|
foreach (keys %{$maps_counters}) {
|
||||||
foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) {
|
foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) {
|
||||||
if (defined($self->{counters_value}->{$instance}->{$_}) && $self->{counters_value}->{$instance}->{$_} ne '' && $self->{counters_value}->{$instance}->{$_} != 0) {
|
if (defined($self->{counters_value}->{$instance}->{$_}) && $self->{counters_value}->{$instance}->{$_} != 0 && $self->{counters_value}->{$instance}->{$_} =~ /\d/) {
|
||||||
push @exits, $self->{perfdata}->threshold_check(value => $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor}, threshold => [ { label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, 'exit_litteral' => $maps_counters->{$_}->{thresholds}->{$name}->{exit_value} }]);
|
push @exits, $self->{perfdata}->threshold_check(value => $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor}, threshold => [ { label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, 'exit_litteral' => $maps_counters->{$_}->{thresholds}->{$name}->{exit_value} }]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ sub run {
|
||||||
my $str_output = "Input Line '$instance_output' ";
|
my $str_output = "Input Line '$instance_output' ";
|
||||||
my $str_append = '';
|
my $str_append = '';
|
||||||
foreach (keys %{$maps_counters}) {
|
foreach (keys %{$maps_counters}) {
|
||||||
next if (!defined($self->{counters_value}->{$instance}->{$_}) || $self->{counters_value}->{$instance}->{$_} == 0 || $self->{counters_value}->{$instance}->{$_} eq '');
|
next if (!defined($self->{counters_value}->{$instance}->{$_}) || $self->{counters_value}->{$instance}->{$_} == 0 || $self->{counters_value}->{$instance}->{$_} !~ /\d/);
|
||||||
|
|
||||||
$str_output .= $str_append . sprintf($maps_counters->{$_}->{output_msg}, $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor});
|
$str_output .= $str_append . sprintf($maps_counters->{$_}->{output_msg}, $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor});
|
||||||
$str_append = ', ';
|
$str_append = ', ';
|
||||||
|
|
|
@ -182,7 +182,7 @@ sub run {
|
||||||
my @exits;
|
my @exits;
|
||||||
foreach (keys %{$maps_counters}) {
|
foreach (keys %{$maps_counters}) {
|
||||||
foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) {
|
foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) {
|
||||||
if (defined($self->{counters_value}->{$instance}->{$_}) && $self->{counters_value}->{$instance}->{$_} ne '' && $self->{counters_value}->{$instance}->{$_} != $maps_counters->{$_}->{no_present}) {
|
if (defined($self->{counters_value}->{$instance}->{$_}) && $self->{counters_value}->{$instance}->{$_} != $maps_counters->{$_}->{no_present} && $self->{counters_value}->{$instance}->{$_} =~ /\d/) {
|
||||||
push @exits, $self->{perfdata}->threshold_check(value => $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor}, threshold => [ { label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, 'exit_litteral' => $maps_counters->{$_}->{thresholds}->{$name}->{exit_value} }]);
|
push @exits, $self->{perfdata}->threshold_check(value => $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor}, threshold => [ { label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, 'exit_litteral' => $maps_counters->{$_}->{thresholds}->{$name}->{exit_value} }]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ sub run {
|
||||||
my $str_output = "Output Line '$instance_output' ";
|
my $str_output = "Output Line '$instance_output' ";
|
||||||
my $str_append = '';
|
my $str_append = '';
|
||||||
foreach (keys %{$maps_counters}) {
|
foreach (keys %{$maps_counters}) {
|
||||||
next if (!defined($self->{counters_value}->{$instance}->{$_}) || $self->{counters_value}->{$instance}->{$_} == $maps_counters->{$_}->{no_present} || $self->{counters_value}->{$instance}->{$_} eq '');
|
next if (!defined($self->{counters_value}->{$instance}->{$_}) || $self->{counters_value}->{$instance}->{$_} == $maps_counters->{$_}->{no_present} || $self->{counters_value}->{$instance}->{$_} !~ /\d/);
|
||||||
|
|
||||||
$str_output .= $str_append . sprintf($maps_counters->{$_}->{output_msg}, $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor});
|
$str_output .= $str_append . sprintf($maps_counters->{$_}->{output_msg}, $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor});
|
||||||
$str_append = ', ';
|
$str_append = ', ';
|
||||||
|
|
Loading…
Reference in New Issue