summaryrefslogtreecommitdiffstats
path: root/plugins/check_disk.c
diff options
context:
space:
mode:
authorKristian Schuster <116557017+KriSchu@users.noreply.github.com>2023-02-20 01:03:01 (GMT)
committerKristian Schuster <116557017+KriSchu@users.noreply.github.com>2023-02-20 01:03:01 (GMT)
commite102b8a49e857a474db516455d2e871e6834ae34 (patch)
tree6057994e8c341c481b8b50e9ba9aec12e978e864 /plugins/check_disk.c
parenta58293a0c288ee0e050c79715073da9fbdfc4c58 (diff)
downloadmonitoring-plugins-e102b8a49e857a474db516455d2e871e6834ae34.tar.gz
check_disk: fix ugly output with -e option and adapt tests accordingly
Diffstat (limited to 'plugins/check_disk.c')
-rw-r--r--plugins/check_disk.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index d32841d..c52d1df 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -186,8 +186,8 @@ main (int argc, char **argv)
186 char mountdir[32]; 186 char mountdir[32];
187#endif 187#endif
188 188
189 preamble = strdup (" free space:"); 189 preamble = strdup (" - free space:");
190 ignored_preamble = strdup (" ignored paths:"); 190 ignored_preamble = strdup (" - ignored paths:");
191 output = strdup (""); 191 output = strdup ("");
192 ignored = strdup (""); 192 ignored = strdup ("");
193 details = strdup (""); 193 details = strdup ("");
@@ -455,12 +455,12 @@ main (int argc, char **argv)
455 if (verbose >= 2) 455 if (verbose >= 2)
456 xasprintf (&output, "%s%s", output, details); 456 xasprintf (&output, "%s%s", output, details);
457 457
458 if (strcmp(output, "") == 0) { 458 if (strcmp(output, "") == 0 && ! erronly) {
459 preamble = ""; 459 preamble = "";
460 xasprintf (&output, " No disks were found for provided parameters;"); 460 xasprintf (&output, " - No disks were found for provided parameters;");
461 } 461 }
462 462
463 printf ("DISK %s -%s%s%s%s|%s\n", state_text (result), ((erronly && result==STATE_OK)) ? "" : preamble, output, (strcmp(ignored, "") == 0) ? "" : ignored_preamble, ignored, perf); 463 printf ("DISK %s%s%s%s%s|%s\n", state_text (result), ((erronly && result==STATE_OK)) ? "" : preamble, output, (strcmp(ignored, "") == 0) ? "" : ignored_preamble, ignored, perf);
464 return result; 464 return result;
465} 465}
466 466