summaryrefslogtreecommitdiffstats
path: root/plugins/check_dns.c
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-08-07 11:51:12 +0000
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-08-07 11:51:12 +0000
commit9e17dab6c3e4b4e7142f3ea5b2a60fcd488dc709 (patch)
treecb5831f4c018edc441686b2fe7715eb91de4ffee /plugins/check_dns.c
parent7f1bb2a782a008b55b0ef657ec01d7fbdb637fd4 (diff)
downloadmonitoring-plugins-9e17dab6c3e4b4e7142f3ea5b2a60fcd488dc709.tar.gz
replace "terminate" with "die" for shorter name and better readability
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@656 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_dns.c')
-rw-r--r--plugins/check_dns.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index eae5880e..8b3bb4f6 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -180,7 +180,7 @@ main (int argc, char **argv)
180 address = strdup (temp_buffer); 180 address = strdup (temp_buffer);
181 strip (address); 181 strip (address);
182 if (address==NULL || strlen(address)==0) 182 if (address==NULL || strlen(address)==0)
183 terminate (STATE_CRITICAL, 183 die (STATE_CRITICAL,
184 _("DNS CRITICAL - '%s' returned empty host name string\n"), 184 _("DNS CRITICAL - '%s' returned empty host name string\n"),
185 NSLOOKUP_COMMAND); 185 NSLOOKUP_COMMAND);
186 result = STATE_OK; 186 result = STATE_OK;
@@ -224,7 +224,7 @@ main (int argc, char **argv)
224 /* If we got here, we should have an address string, 224 /* If we got here, we should have an address string,
225 and we can segfault if we do not */ 225 and we can segfault if we do not */
226 if (address==NULL || strlen(address)==0) 226 if (address==NULL || strlen(address)==0)
227 terminate (STATE_CRITICAL, 227 die (STATE_CRITICAL,
228 _("DNS CRITICAL - '%s' output parsing exited with no address\n"), 228 _("DNS CRITICAL - '%s' output parsing exited with no address\n"),
229 NSLOOKUP_COMMAND); 229 NSLOOKUP_COMMAND);
230 230
@@ -270,32 +270,32 @@ error_scan (char *input_buffer)
270 270
271 /* DNS server is not running... */ 271 /* DNS server is not running... */
272 else if (strstr (input_buffer, "No response from server")) 272 else if (strstr (input_buffer, "No response from server"))
273 terminate (STATE_CRITICAL, _("No response from name server %s\n"), dns_server); 273 die (STATE_CRITICAL, _("No response from name server %s\n"), dns_server);
274 274
275 /* Host name is valid, but server doesn't have records... */ 275 /* Host name is valid, but server doesn't have records... */
276 else if (strstr (input_buffer, "No records")) 276 else if (strstr (input_buffer, "No records"))
277 terminate (STATE_CRITICAL, _("Name server %s has no records\n"), dns_server); 277 die (STATE_CRITICAL, _("Name server %s has no records\n"), dns_server);
278 278
279 /* Connection was refused */ 279 /* Connection was refused */
280 else if (strstr (input_buffer, "Connection refused") || 280 else if (strstr (input_buffer, "Connection refused") ||
281 (strstr (input_buffer, "** server can't find") && 281 (strstr (input_buffer, "** server can't find") &&
282 strstr (input_buffer, ": REFUSED")) || 282 strstr (input_buffer, ": REFUSED")) ||
283 (strstr (input_buffer, "Refused"))) 283 (strstr (input_buffer, "Refused")))
284 terminate (STATE_CRITICAL, _("Connection to name server %s was refused\n"), dns_server); 284 die (STATE_CRITICAL, _("Connection to name server %s was refused\n"), dns_server);
285 285
286 /* Host or domain name does not exist */ 286 /* Host or domain name does not exist */
287 else if (strstr (input_buffer, "Non-existent") || 287 else if (strstr (input_buffer, "Non-existent") ||
288 strstr (input_buffer, "** server can't find") || 288 strstr (input_buffer, "** server can't find") ||
289 strstr (input_buffer,"NXDOMAIN")) 289 strstr (input_buffer,"NXDOMAIN"))
290 terminate (STATE_CRITICAL, _("Domain %s was not found by the server\n"), query_address); 290 die (STATE_CRITICAL, _("Domain %s was not found by the server\n"), query_address);
291 291
292 /* Network is unreachable */ 292 /* Network is unreachable */
293 else if (strstr (input_buffer, "Network is unreachable")) 293 else if (strstr (input_buffer, "Network is unreachable"))
294 terminate (STATE_CRITICAL, _("Network is unreachable\n")); 294 die (STATE_CRITICAL, _("Network is unreachable\n"));
295 295
296 /* Internal server failure */ 296 /* Internal server failure */
297 else if (strstr (input_buffer, "Server failure")) 297 else if (strstr (input_buffer, "Server failure"))
298 terminate (STATE_CRITICAL, _("Server failure for %s\n"), dns_server); 298 die (STATE_CRITICAL, _("Server failure for %s\n"), dns_server);
299 299
300 /* Request error or the DNS lookup timed out */ 300 /* Request error or the DNS lookup timed out */
301 else if (strstr (input_buffer, "Format error") || 301 else if (strstr (input_buffer, "Format error") ||
@@ -357,7 +357,7 @@ process_arguments (int argc, char **argv)
357 break; 357 break;
358 case 'H': /* hostname */ 358 case 'H': /* hostname */
359 if (strlen (optarg) >= ADDRESS_LENGTH) 359 if (strlen (optarg) >= ADDRESS_LENGTH)
360 terminate (STATE_UNKNOWN, _("Input buffer overflow\n")); 360 die (STATE_UNKNOWN, _("Input buffer overflow\n"));
361 strcpy (query_address, optarg); 361 strcpy (query_address, optarg);
362 break; 362 break;
363 case 's': /* server name */ 363 case 's': /* server name */
@@ -369,7 +369,7 @@ process_arguments (int argc, char **argv)
369 exit (STATE_UNKNOWN); 369 exit (STATE_UNKNOWN);
370 } 370 }
371 if (strlen (optarg) >= ADDRESS_LENGTH) 371 if (strlen (optarg) >= ADDRESS_LENGTH)
372 terminate (STATE_UNKNOWN, _("Input buffer overflow\n")); 372 die (STATE_UNKNOWN, _("Input buffer overflow\n"));
373 strcpy (dns_server, optarg); 373 strcpy (dns_server, optarg);
374 break; 374 break;
375 case 'r': /* reverse server name */ 375 case 'r': /* reverse server name */
@@ -380,12 +380,12 @@ process_arguments (int argc, char **argv)
380 exit (STATE_UNKNOWN); 380 exit (STATE_UNKNOWN);
381 } 381 }
382 if (strlen (optarg) >= ADDRESS_LENGTH) 382 if (strlen (optarg) >= ADDRESS_LENGTH)
383 terminate (STATE_UNKNOWN, _("Input buffer overflow\n")); 383 die (STATE_UNKNOWN, _("Input buffer overflow\n"));
384 strcpy (ptr_server, optarg); 384 strcpy (ptr_server, optarg);
385 break; 385 break;
386 case 'a': /* expected address */ 386 case 'a': /* expected address */
387 if (strlen (optarg) >= ADDRESS_LENGTH) 387 if (strlen (optarg) >= ADDRESS_LENGTH)
388 terminate (STATE_UNKNOWN, _("Input buffer overflow\n")); 388 die (STATE_UNKNOWN, _("Input buffer overflow\n"));
389 strcpy (expected_address, optarg); 389 strcpy (expected_address, optarg);
390 match_expected_address = TRUE; 390 match_expected_address = TRUE;
391 break; 391 break;
@@ -395,7 +395,7 @@ process_arguments (int argc, char **argv)
395 c = optind; 395 c = optind;
396 if (strlen(query_address)==0 && c<argc) { 396 if (strlen(query_address)==0 && c<argc) {
397 if (strlen(argv[c])>=ADDRESS_LENGTH) 397 if (strlen(argv[c])>=ADDRESS_LENGTH)
398 terminate (STATE_UNKNOWN, _("Input buffer overflow\n")); 398 die (STATE_UNKNOWN, _("Input buffer overflow\n"));
399 strcpy (query_address, argv[c++]); 399 strcpy (query_address, argv[c++]);
400 } 400 }
401 401
@@ -406,7 +406,7 @@ process_arguments (int argc, char **argv)
406 return ERROR; 406 return ERROR;
407 } 407 }
408 if (strlen(argv[c]) >= ADDRESS_LENGTH) 408 if (strlen(argv[c]) >= ADDRESS_LENGTH)
409 terminate (STATE_UNKNOWN, _("Input buffer overflow\n")); 409 die (STATE_UNKNOWN, _("Input buffer overflow\n"));
410 strcpy (dns_server, argv[c++]); 410 strcpy (dns_server, argv[c++]);
411 } 411 }
412 412