fix qos usage cisco

This commit is contained in:
garnier-quentin 2019-11-26 15:13:24 +01:00
parent e32554caaa
commit 7cc661fb9b
1 changed files with 2 additions and 1 deletions

View File

@ -106,7 +106,8 @@ sub custom_traffic_perfdata {
my ($self, %options) = @_;
my ($warning, $critical);
if ($self->{instance_mode}->{option_results}->{units_traffic} eq '%' && defined($self->{result_values}->{total})) {
if ($self->{instance_mode}->{option_results}->{units_traffic} eq '%' &&
(defined($self->{result_values}->{total}) && $self->{result_values}->{total} =~ /[0-9]/)) {
$warning = $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}, total => $self->{result_values}->{total}, cast_int => 1);
$critical = $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}, total => $self->{result_values}->{total}, cast_int => 1);
} elsif ($self->{instance_mode}->{option_results}->{units_traffic} eq 'b/s') {