[monitoring-plugins] udp test: prefer nc over netcat syntax

Sven Nierlein git at monitoring-plugins.org
Mon Mar 13 11:50:13 CET 2017


 Module: monitoring-plugins
 Branch: master
 Commit: 77aa6d4ebf1bd3567395c92b9e5cc9daa74e9838
 Author: Sven Nierlein <sven at nierlein.de>
   Date: Sun Mar 12 22:54:04 2017 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=77aa6d4

udp test: prefer nc over netcat syntax

sles 12 systems have netcat symlinked to nc and so expect nc syntax for netcat.

Signed-off-by: Sven Nierlein <sven at nierlein.de>

---

 plugins/t/check_udp.t | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugins/t/check_udp.t b/plugins/t/check_udp.t
index 1f6fee7..6c47d09 100644
--- a/plugins/t/check_udp.t
+++ b/plugins/t/check_udp.t
@@ -34,12 +34,12 @@ my $nc;
 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) {
 	$nc = 'nc -w 3 -l -u -4 localhost 3333';
 }
+elsif(system("which netcat >/dev/null 2>&1") == 0) {
+	$nc = 'netcat -w 3 -l -u -p 3333';
+}
 
 SKIP: {
 	skip "solaris netcat does not listen to udp", 6 if $^O eq 'solaris';



More information about the Commits mailing list