diff --git a/debian/patches/18_check_snmp_int_fix_perf_out b/debian/patches/18_check_snmp_int_fix_perf_out new file mode 100644 index 0000000..59bc9c7 --- /dev/null +++ b/debian/patches/18_check_snmp_int_fix_perf_out @@ -0,0 +1,43 @@ +From effd196f76c4f4e9505b0955b020f8f65f1700a2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pawe=C5=82=20Szafer?= +Date: Mon, 16 Mar 2020 18:41:49 +0100 +Subject: [PATCH] fix perf_out not defined error + +--- + plugins/check_snmp_int.pl | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/plugins/check_snmp_int.pl b/plugins/check_snmp_int.pl +index 6e42163..1f0cdc2 100755 +--- a/plugins/check_snmp_int.pl ++++ b/plugins/check_snmp_int.pl +@@ -993,24 +993,25 @@ sub check_options { + + # Check if all interface are OK + if ($num_ok == $num_int) { ++ my $is_perf_defined = defined($perf_out) && defined($o_perf); + if ($final_status == 0) { + print $print_out, ":", $num_ok, " UP: OK"; +- if (defined($o_perf)) { print " | ", $perf_out; } ++ if ($is_perf_defined) { print " | ", $perf_out; } + print "\n"; + exit $ERRORS{"OK"}; + } elsif ($final_status == 1) { + print $print_out, ":(", $num_ok, " UP): WARNING"; +- if (defined($o_perf)) { print " | ", $perf_out; } ++ if ($is_perf_defined) { print " | ", $perf_out; } + print "\n"; + exit $ERRORS{"WARNING"}; + } elsif ($final_status == 2) { + print $print_out, ":(", $num_ok, " UP): CRITICAL"; +- if (defined($o_perf)) { print " | ", $perf_out; } ++ if ($is_perf_defined) { print " | ", $perf_out; } + print "\n"; + exit $ERRORS{"CRITICAL"}; + } else { + print $print_out, ":(", $num_ok, " UP): UNKNOWN"; +- if (defined($perf_out)) { print " | ", $perf_out; } ++ if ($is_perf_defined) { print " | ", $perf_out; } + print "\n"; + exit $ERRORS{"UNKNOWN"}; + } diff --git a/debian/patches/series b/debian/patches/series index 421df72..82505fe 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,5 +6,6 @@ 15_check_snmp_int_spaces 16_check_snmp_win_max_message_size 17_check_snmp_storage_okifempty +18_check_snmp_int_fix_perf_out 50_disable_epn 51_fix_privacy_doc