aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jan Wagner <waja@cyconet.org> 2014-07-30 21:36:19 +0200
committerGravatar Jan Wagner <waja@cyconet.org> 2014-07-30 21:36:19 +0200
commitfe066559f29aa676d28cde30e28a3da66907ae0a (patch)
treefa1f5d5b1f6c08319646ff0fe283cb723ebd5eb5
parentb43030cdd491322de1c026949691cf4117d78e09 (diff)
parent29844037cc4325fced47bdb7a15ddc9d995ac3b7 (diff)
downloadmonitoring-plugins-fe066559f29aa676d28cde30e28a3da66907ae0a.tar.gz
Merge pull request #1182 from waja/github984
-rw-r--r--THANKS.in1
-rw-r--r--plugins/check_disk.c16
2 files changed, 12 insertions, 5 deletions
diff --git a/THANKS.in b/THANKS.in
index ebd13e17..0d004aa6 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -327,3 +327,4 @@ Patric Wust
Julius Kriukas
Patrick McAndrew
Alexander Wittig
+Jason Benguerel
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)
char *details;
char *perf;
char *preamble;
+ char *flag_header;
double inode_space_pct;
double warning_high_tide;
double critical_high_tide;
@@ -353,18 +354,23 @@ main (int argc, char **argv)
if (disk_result==STATE_OK && erronly && !verbose)
continue;
- xasprintf (&output, "%s %s %.0f %s (%.0f%%",
- output,
+ if(disk_result && verbose >= 1) {
+ xasprintf(&flag_header, " %s [", state_text (disk_result));
+ } else {
+ xasprintf(&flag_header, "");
+ }
+ xasprintf (&output, "%s%s %s %.0f %s (%.0f%%",
+ output, flag_header,
(!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir,
path->dfree_units,
units,
path->dfree_pct);
if (path->dused_inodes_percent < 0) {
- xasprintf(&output, "%s inode=-);", output);
+ xasprintf(&output, "%s inode=-)%s;", output, (disk_result ? "]" : ""));
} else {
- xasprintf(&output, "%s inode=%.0f%%);", output, path->dfree_inodes_percent );
+ xasprintf(&output, "%s inode=%.0f%%)%s;", output, path->dfree_inodes_percent, ((disk_result && verbose >= 1) ? "]" : ""));
}
-
+ free(flag_header);
/* TODO: Need to do a similar debug line
xasprintf (&details, _("%s\n\
%.0f of %.0f %s (%.0f%% inode=%.0f%%) free on %s (type %s mounted on %s) warn:%lu crit:%lu warn%%:%.0f%% crit%%:%.0f%%"),