Преглед изворни кода

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 година
родитељ
комит
7b0f64c056
1 измењених фајлова са 5 додато и 1 уклоњено
  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);