Sfoglia il codice sorgente

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 12 anni fa
parent
commit
7b0f64c056
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  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 */
   /* check if authoritative */
   if (result == STATE_OK && expect_authority && non_authoritative) {
   if (result == STATE_OK && expect_authority && non_authoritative) {
     result = STATE_CRITICAL;
     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);
   microsec = deltime (tv);