Explorar o código

plugins/check_dns.c: Authoritative response change

Altered output for authoritative message if no dns server was provided, in case of using -A without -s.
Spenser Reinhardt %!s(int64=12) %!d(string=hai) anos
pai
achega
7b0f64c056
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      plugins/check_dns.c

+ 5 - 1
plugins/check_dns.c

@@ -236,7 +236,11 @@ main (int argc, char **argv)
   /* check if authoritative */
   if (result == STATE_OK && expect_authority && non_authoritative) {
     result = STATE_CRITICAL;
-    xasprintf(&msg, _("server %s is not authoritative for %s"), dns_server, query_address);
+
+    if (strncmp(dns_server, "", 2))
+      xasprintf(&msg, _("server %s is not authoritative for %s"), dns_server, query_address);
+    else
+      xasprintf(&msg, _("there is no authoritative server for %s"), query_address);
   }
 
   microsec = deltime (tv);