diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2006-10-12 13:58:43 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2006-10-12 13:58:43 +0000 |
commit | bd9a612f6c18fcc9b17e5abf58def18b19521d82 (patch) | |
tree | c4bb4e93ccbca424b2bd7aeb2a6ad799bc3e3791 /plugins/check_disk.c | |
parent | cff53455ffc4d4df7214f8d671b3dca7ca26f51d (diff) | |
download | monitoring-plugins-bd9a612f6c18fcc9b17e5abf58def18b19521d82.tar.gz |
Fixed output from -e in check_disk (Andreas Behal)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1490 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_disk.c')
-rw-r--r-- | plugins/check_disk.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c index b546fd2f..b9787c89 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c @@ -206,6 +206,10 @@ main (int argc, char **argv) /* Process for every path in list */ for (path = path_select_list; path; path=path->name_next) { + + /* reset disk result */ + disk_result = STATE_UNKNOWN; + me = path->best_match; /* Filters */ @@ -258,23 +262,25 @@ main (int argc, char **argv) temp_result = get_status(dfree_units, path->freespace_units); if (verbose >=3) printf("Freespace_units result=%d\n", temp_result); - result = max_state( result, temp_result ); + disk_result = max_state( disk_result, temp_result ); temp_result = get_status(dfree_pct, path->freespace_percent); if (verbose >=3) printf("Freespace%% result=%d\n", temp_result); - result = max_state( result, temp_result ); + disk_result = max_state( disk_result, temp_result ); temp_result = get_status(dused_units, path->usedspace_units); if (verbose >=3) printf("Usedspace_units result=%d\n", temp_result); - result = max_state( result, temp_result ); + disk_result = max_state( disk_result, temp_result ); temp_result = get_status(dused_pct, path->usedspace_percent); if (verbose >=3) printf("Usedspace_percent result=%d\n", temp_result); - result = max_state( result, temp_result ); + disk_result = max_state( disk_result, temp_result ); temp_result = get_status(dused_inodes_percent, path->usedinodes_percent); if (verbose >=3) printf("Usedinodes_percent result=%d\n", temp_result); - result = max_state( result, temp_result ); + disk_result = max_state( disk_result, temp_result ); + + result = max_state(result, disk_result); asprintf (&perf, "%s %s", perf, perfdata ((!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir, |