diff options
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/check_dig.c | 9 | ||||
| -rw-r--r-- | plugins/check_disk.c | 16 |
2 files changed, 17 insertions, 8 deletions
diff --git a/plugins/check_dig.c b/plugins/check_dig.c index d9481f2d..d899b119 100644 --- a/plugins/check_dig.c +++ b/plugins/check_dig.c | |||
| @@ -94,8 +94,8 @@ main (int argc, char **argv) | |||
| 94 | timeout_interval_dig = timeout_interval / number_tries + number_tries; | 94 | timeout_interval_dig = timeout_interval / number_tries + number_tries; |
| 95 | 95 | ||
| 96 | /* get the command to run */ | 96 | /* get the command to run */ |
| 97 | xasprintf (&command_line, "%s @%s -p %d %s -t %s %s %s +tries=%d +time=%d", | 97 | xasprintf (&command_line, "%s %s %s -p %d @%s %s %s +tries=%d +time=%d", |
| 98 | PATH_TO_DIG, dns_server, server_port, query_address, record_type, dig_args, query_transport, number_tries, timeout_interval_dig); | 98 | PATH_TO_DIG, dig_args, query_transport, server_port, dns_server, query_address, record_type, number_tries, timeout_interval_dig); |
| 99 | 99 | ||
| 100 | alarm (timeout_interval); | 100 | alarm (timeout_interval); |
| 101 | gettimeofday (&tv, NULL); | 101 | gettimeofday (&tv, NULL); |
| @@ -296,7 +296,10 @@ process_arguments (int argc, char **argv) | |||
| 296 | dns_server = argv[c]; | 296 | dns_server = argv[c]; |
| 297 | } | 297 | } |
| 298 | else { | 298 | else { |
| 299 | dns_server = strdup ("127.0.0.1"); | 299 | if (strcmp(query_transport,"-6") == 0) |
| 300 | dns_server = strdup("::1"); | ||
| 301 | else | ||
| 302 | dns_server = strdup ("127.0.0.1"); | ||
| 300 | } | 303 | } |
| 301 | } | 304 | } |
| 302 | 305 | ||
diff --git a/plugins/check_disk.c b/plugins/check_disk.c index 925dfa82..0d73a4f1 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c | |||
| @@ -171,6 +171,7 @@ main (int argc, char **argv) | |||
| 171 | char *details; | 171 | char *details; |
| 172 | char *perf; | 172 | char *perf; |
| 173 | char *preamble; | 173 | char *preamble; |
| 174 | char *flag_header; | ||
| 174 | double inode_space_pct; | 175 | double inode_space_pct; |
| 175 | double warning_high_tide; | 176 | double warning_high_tide; |
| 176 | double critical_high_tide; | 177 | double critical_high_tide; |
| @@ -353,18 +354,23 @@ main (int argc, char **argv) | |||
| 353 | if (disk_result==STATE_OK && erronly && !verbose) | 354 | if (disk_result==STATE_OK && erronly && !verbose) |
| 354 | continue; | 355 | continue; |
| 355 | 356 | ||
| 356 | xasprintf (&output, "%s %s %.0f %s (%.0f%%", | 357 | if(disk_result && verbose >= 1) { |
| 357 | output, | 358 | xasprintf(&flag_header, " %s [", state_text (disk_result)); |
| 359 | } else { | ||
| 360 | xasprintf(&flag_header, ""); | ||
| 361 | } | ||
| 362 | xasprintf (&output, "%s%s %s %.0f %s (%.0f%%", | ||
| 363 | output, flag_header, | ||
| 358 | (!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir, | 364 | (!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir, |
| 359 | path->dfree_units, | 365 | path->dfree_units, |
| 360 | units, | 366 | units, |
| 361 | path->dfree_pct); | 367 | path->dfree_pct); |
| 362 | if (path->dused_inodes_percent < 0) { | 368 | if (path->dused_inodes_percent < 0) { |
| 363 | xasprintf(&output, "%s inode=-);", output); | 369 | xasprintf(&output, "%s inode=-)%s;", output, (disk_result ? "]" : "")); |
| 364 | } else { | 370 | } else { |
| 365 | xasprintf(&output, "%s inode=%.0f%%);", output, path->dfree_inodes_percent ); | 371 | xasprintf(&output, "%s inode=%.0f%%)%s;", output, path->dfree_inodes_percent, ((disk_result && verbose >= 1) ? "]" : "")); |
| 366 | } | 372 | } |
| 367 | 373 | free(flag_header); | |
| 368 | /* TODO: Need to do a similar debug line | 374 | /* TODO: Need to do a similar debug line |
| 369 | xasprintf (&details, _("%s\n\ | 375 | xasprintf (&details, _("%s\n\ |
| 370 | %.0f of %.0f %s (%.0f%% inode=%.0f%%) free on %s (type %s mounted on %s) warn:%lu crit:%lu warn%%:%.0f%% crit%%:%.0f%%"), | 376 | %.0f of %.0f %s (%.0f%% inode=%.0f%%) free on %s (type %s mounted on %s) warn:%lu crit:%lu warn%%:%.0f%% crit%%:%.0f%%"), |
