[Nagiosplug-devel] Release 1.4.4

Andreas Behal andi at rz.hvb.sozvers.at
Thu Oct 12 15:14:23 CEST 2006


Hi,

well - if you mention check_disk:

As the 'stable' version from check_disk didn't work for me on AIX I 
decided to compile the HEAD-CVS which was much better, but still had one 
Bug concerning the -e (only show errors) flag, which never showed any 
errors.

I think this is due to some confusion with disk_result, result and 
tmp_result:

bash#> grep disk_result 
nagios-plugins-HEAD-200610121152/plugins/check_disk.c
 >
 >  int disk_result = STATE_UNKNOWN;
 >      if (disk_result==STATE_OK && erronly && !verbose)
 >      if (disk_result!=STATE_OK || verbose>=0) {

So, disk_result is set only once and never touched after. I have made a 
patch that works for me (do not hit me If i get something totally wrong 
-  I'm on this list since yesterday ..)

best regards,

Andreas


--- nagios-plugins-HEAD-200610102352/plugins/check_disk.c       
2006-08-14 11:04:16.000000000 +0200
+++ nagios-plugins-HEAD-200610102352/plugins/check_disk.c.new   
2006-10-11 11:33:14.000000000 +0200
@@ -206,6 +206,10 @@

   /* Process for every path in list */
   for (path = path_select_list; path; path=path->name_next) {
+
+    /* reset the 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,





Ton Voon wrote:
> Hi!
>
> I want to get a release a 1.4.4 out because there's lots of good stuff 
> currently in CVS HEAD and I keep referring people to use that, so we 
> might as well release it.
>
> I've got to add in perf data back into check_disk, but that is 
> probably the only item that is outstanding on my list. Is there 
> anything else that needs to be done for the next release?




More information about the Devel mailing list