[Nagiosplug-checkins] nagiosplug/plugins check_disk.c,1.75,1.76

Ton Voon tonvoon at users.sourceforge.net
Thu Oct 12 15:58:45 CEST 2006


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv31296/plugins

Modified Files:
	check_disk.c 
Log Message:
Fixed output from -e in check_disk (Andreas Behal)


Index: check_disk.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_disk.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- check_disk.c	14 Aug 2006 09:04:16 -0000	1.75
+++ check_disk.c	12 Oct 2006 13:58:43 -0000	1.76
@@ -206,6 +206,10 @@
 
   /* 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 @@
 
       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,





More information about the Commits mailing list