From 8752b0352a056ee8ec06df53942f50a40452f7eb Mon Sep 17 00:00:00 2001 From: SteScho Date: Sun, 14 Feb 2016 20:30:16 +0100 Subject: [PATCH] Not all Systems have connections Example: There are no connections if you have a standalone management system for your checkpoint firewall. I have made the output of connections optional if they are set to suppress a perl warning it $perf_conn is not initialized. --- plugins/check_snmp_cpfw.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/check_snmp_cpfw.pl b/plugins/check_snmp_cpfw.pl index f25c192..7b9100b 100755 --- a/plugins/check_snmp_cpfw.pl +++ b/plugins/check_snmp_cpfw.pl @@ -530,7 +530,7 @@ sub check_options { my $exit_status=undef; $f_print .= " / CPFW Status: "; if (($ha_state_n+$svn_state+$fw_state+$mgmt_state) == 0 ) { - $f_print .= "OK, " . $perf_conn . " conn."; + $f_print .= 'OK' . ($perf_conn ? ', ' . $perf_conn . ' conn.' : ''); $exit_status= $ERRORS{"OK"}; } else { if (($fw_state==1) || ($ha_state_n==1) || ($svn_state==1) || ($mgmt_state==1)) {