diff options
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) | |||
206 | 206 | ||
207 | /* Process for every path in list */ | 207 | /* Process for every path in list */ |
208 | for (path = path_select_list; path; path=path->name_next) { | 208 | for (path = path_select_list; path; path=path->name_next) { |
209 | |||
210 | /* reset disk result */ | ||
211 | disk_result = STATE_UNKNOWN; | ||
212 | |||
209 | me = path->best_match; | 213 | me = path->best_match; |
210 | 214 | ||
211 | /* Filters */ | 215 | /* Filters */ |
@@ -258,23 +262,25 @@ main (int argc, char **argv) | |||
258 | 262 | ||
259 | temp_result = get_status(dfree_units, path->freespace_units); | 263 | temp_result = get_status(dfree_units, path->freespace_units); |
260 | if (verbose >=3) printf("Freespace_units result=%d\n", temp_result); | 264 | if (verbose >=3) printf("Freespace_units result=%d\n", temp_result); |
261 | result = max_state( result, temp_result ); | 265 | disk_result = max_state( disk_result, temp_result ); |
262 | 266 | ||
263 | temp_result = get_status(dfree_pct, path->freespace_percent); | 267 | temp_result = get_status(dfree_pct, path->freespace_percent); |
264 | if (verbose >=3) printf("Freespace%% result=%d\n", temp_result); | 268 | if (verbose >=3) printf("Freespace%% result=%d\n", temp_result); |
265 | result = max_state( result, temp_result ); | 269 | disk_result = max_state( disk_result, temp_result ); |
266 | 270 | ||
267 | temp_result = get_status(dused_units, path->usedspace_units); | 271 | temp_result = get_status(dused_units, path->usedspace_units); |
268 | if (verbose >=3) printf("Usedspace_units result=%d\n", temp_result); | 272 | if (verbose >=3) printf("Usedspace_units result=%d\n", temp_result); |
269 | result = max_state( result, temp_result ); | 273 | disk_result = max_state( disk_result, temp_result ); |
270 | 274 | ||
271 | temp_result = get_status(dused_pct, path->usedspace_percent); | 275 | temp_result = get_status(dused_pct, path->usedspace_percent); |
272 | if (verbose >=3) printf("Usedspace_percent result=%d\n", temp_result); | 276 | if (verbose >=3) printf("Usedspace_percent result=%d\n", temp_result); |
273 | result = max_state( result, temp_result ); | 277 | disk_result = max_state( disk_result, temp_result ); |
274 | 278 | ||
275 | temp_result = get_status(dused_inodes_percent, path->usedinodes_percent); | 279 | temp_result = get_status(dused_inodes_percent, path->usedinodes_percent); |
276 | if (verbose >=3) printf("Usedinodes_percent result=%d\n", temp_result); | 280 | if (verbose >=3) printf("Usedinodes_percent result=%d\n", temp_result); |
277 | result = max_state( result, temp_result ); | 281 | disk_result = max_state( disk_result, temp_result ); |
282 | |||
283 | result = max_state(result, disk_result); | ||
278 | 284 | ||
279 | asprintf (&perf, "%s %s", perf, | 285 | asprintf (&perf, "%s %s", perf, |
280 | perfdata ((!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir, | 286 | perfdata ((!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir, |