https://bugzilla.novell.com/show_bug.cgi?id=859355 https://bugzilla.novell.com/show_bug.cgi?id=859355#c0 Summary: Perl errors while SIP is not answer for check_sip Nagios plugin Classification: openSUSE Product: openSUSE 12.3 Version: Final Platform: All OS/Version: All Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: avn@avnsite.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:26.0) Gecko/20100101 Firefox/26.0 Perl script errors if SIP not answer for check_sip Nagios plugin: asterisk:/usr/lib/nagios/plugins # ./check_sip -u sip:2999 -H asterisk Reproducible: Always Steps to Reproduce: 1. Stop Asterisk PBX 2. Run /usr/lib/nagios/plugins/check_sip for example as asterisk:/usr/lib/nagios/plugins # ./check_sip -u sip:2999 -H asterisk 3. See errors Actual Results: Use of uninitialized value $tstring in concatenation (.) or string at /check_sip line 277. Use of uninitialized value $rcode in concatenation (.) or string at ./check_sip line 277. Unknown error: , 0.000686 seconds response time, cnt=12|rtt=0.000686s;cnt=12;0.5s;1s;0:10; code= Expected Results: Needs to report something like this: Unknown error: UNKNOWN ERROR, 0.00086 seconds response time, cnt=12|rtt=0.00086s;cnt=12;0.5s;1s;0:10; code=NO RESPONSE Proposed check_sip.patch: --- check_sip<->2014-01-18 15:15:52.757895836 +0400 +++ check_sip<->2013-10-04 18:03:00.000000000 +0400 @@ -256,7 +256,13 @@ my ($response, $rtime, $sp_behavior) = @_; my @header=split(/\r/,$response); my $tstring=$header[0]; + if( !defined $tstring ) { + $tstring = "UNKNOWN ERROR"; + } my $rcode=getResponseCode($response); + if( !defined $rcode ) { + $rcode = "NO RESPONSE"; + } if (!$sp_behavior){ #in this case, we want to see if the SIP-server is respoding positively to our request # Some SUT respond with 100 Trying - assume everything is OK if we get this -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.