[nagiosplug] check_udp: try nc.traditional too
Nagios Plugin Development
nagios-plugins at users.sourceforge.net
Sun Sep 15 00:00:48 CEST 2013
Module: nagiosplug
Branch: master
Commit: 6361247b4c72b2527ffef5c5c4d9672264b61941
Author: Sven Nierlein <Sven.Nierlein at consol.de>
Committer: Sven Nierlein <sven at consol.de>
Date: Sat Sep 14 19:59:17 2013 +0200
URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=6361247
check_udp: try nc.traditional too
nc.traditional is available on (at least) ubuntu systems and uses traditional nc syntax
---
plugins/t/check_udp.t | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/plugins/t/check_udp.t b/plugins/t/check_udp.t
index ae1718c..6ede300 100644
--- a/plugins/t/check_udp.t
+++ b/plugins/t/check_udp.t
@@ -31,7 +31,10 @@ cmp_ok( $res->return_code, '==', 2, "Errors correctly because no udp service run
like ( $res->output, '/No data received from host/', "Output OK");
my $nc;
-if(system("which netcat >/dev/null 2>&1") == 0) {
+if(system("which nc.traditional >/dev/null 2>&1") == 0) {
+ $nc = 'nc.traditional -w 3 -l -u -p 3333';
+}
+elsif(system("which netcat >/dev/null 2>&1") == 0) {
$nc = 'netcat -w 3 -l -u -p 3333';
}
elsif(system("which nc >/dev/null 2>&1") == 0) {
More information about the Commits
mailing list