aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_disk.c
diff options
context:
space:
mode:
authorGravatar Ton Voon <tonvoon@users.sourceforge.net> 2006-10-12 14:14:48 +0000
committerGravatar Ton Voon <tonvoon@users.sourceforge.net> 2006-10-12 14:14:48 +0000
commitf9baef7ed0d40745a46ea82d08d85949bb48b8c9 (patch)
treed858e615fd886974b9c4ad8a270e2dc92fb0d08f /plugins/check_disk.c
parentbd9a612f6c18fcc9b17e5abf58def18b19521d82 (diff)
downloadmonitoring-plugins-f9baef7ed0d40745a46ea82d08d85949bb48b8c9.tar.gz
Remove the "- free space" if status is OK
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1491 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_disk.c')
-rw-r--r--plugins/check_disk.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index b9787c89..3c7b0ecf 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -153,6 +153,7 @@ main (int argc, char **argv)
char *output;
char *details;
char *perf;
+ char *preamble;
double inode_space_pct;
uintmax_t total, available, available_to_root, used;
double dfree_pct = -1, dused_pct = -1;
@@ -165,7 +166,8 @@ main (int argc, char **argv)
struct parameter_list *temp_list, *path;
struct name_list *seen = NULL;
- output = strdup (" - free space:");
+ preamble = strdup (" - free space:");
+ output = strdup ("");
details = strdup ("");
perf = strdup ("");
@@ -323,7 +325,7 @@ main (int argc, char **argv)
asprintf (&output, "%s%s", output, details);
- printf ("DISK %s%s|%s\n", state_text (result), output, perf);
+ printf ("DISK %s%s%s|%s\n", state_text (result), (erronly && result==STATE_OK) ? "" : preamble, output, perf);
return result;
}