فهرست منبع

check_nt does not correctly report a DNS entry it cannot resolve

Fix for issue https://github.com/nagios-plugins/nagios-plugins/issues/67
John C. Frickson 9 سال پیش
والد
کامیت
e68e013faf
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      plugins/netutils.c

+ 4 - 1
plugins/netutils.c

@@ -209,7 +209,10 @@ np_net_connect (const char *host_name, int port, int *sd, int proto)
 		result = getaddrinfo (host, port_str, &hints, &res);
 
 		if (result != 0) {
-			printf ("%s\n", gai_strerror (result));
+			if (result == EAI_NONAME)
+				usage_va(_("Invalid hostname/address - %s"), host);
+			else
+				printf ("%s\n", gai_strerror (result));
 			return STATE_UNKNOWN;
 		}