openbsd-ports/net/nagios/check_sip/patches/patch-check_sip
sthen e8330b2841 Use ${LOCALBASE}/bin/sipsak rather than relying on PATH to be set.
Fixes SIP checks when nagios is started from rc.local. Bump PKGNAME.
2009-11-13 15:30:51 +00:00

31 lines
999 B
Plaintext

$OpenBSD: patch-check_sip,v 1.2 2009/11/13 15:30:51 sthen Exp $
--- check_sip.orig Fri Nov 13 15:21:23 2009
+++ check_sip Fri Nov 13 15:22:11 2009
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
##
# check_sip - (c) 2005-2006 O'Shaughnessy Evans <shaug+nagios at aloha.net>
@@ -33,7 +33,7 @@ BEGIN {
$ME = 'check_sip';
# command to get connection state; 1st %s is for extra args, second is SIP URI
- @Sipsak_Cmd = qw(sipsak --nagios-code -v);
+ @Sipsak_Cmd = qw(${LOCALBASE}/bin/sipsak --nagios-code -v);
$User = '';
$Password = '';
$Port = 5060;
@@ -151,7 +151,10 @@ if ($Proxy) {
push @Sipsak_Cmd, '--outbound-proxy', $Proxy;
}
-push @Sipsak_Cmd, '--sip-uri', $URI;
+# add --numeric since on OpenBSD /etc/hosts lookup typically
+# gives 127.0.0.1 which results in broken SIP headers.
+
+push @Sipsak_Cmd, '--numeric --sip-uri', $URI;
print "executing: ". join(' ', @Sipsak_Cmd). "\n" if $Verbose;
my $cmd = join(' ', @Sipsak_Cmd);
my @out = `$cmd 2>&1`;