[Nagiosplug-devel] [ nagiosplug-Patches-984174 ] Fix for check_disk.c Perfdata

SourceForge.net noreply at sourceforge.net
Fri Jul 2 14:12:03 CEST 2004


Patches item #984174, was opened at 2004-07-02 10:28
Message generated for change (Comment added) made by g_force
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397599&aid=984174&group_id=29880

Category: Perf data
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Garry W.  Cook (g_force)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix for check_disk.c Perfdata

Initial Comment:
Perfdata for check_disk was reporting wrong, -w and -c 
reported backwards when using %. Patch follows:

--- check_disk.c.orig   2004-07-02 
09:50:32.000000000 -0600
+++ check_disk.c.new    2004-07-02 
10:22:10.000000000 -0600
@@ -192,8 +192,8 @@
                        asprintf (&perf, "%s %s", perf,
                                  perfdata ((!strcmp
(file_system, "none") || display_mntp) ? me-
>me_devname : me->me_mountdir,
                                            
fsp.fsu_bavail*fsp.fsu_blocksize/mult, units,
-                                           TRUE, min ((uintmax_t)
psize-(uintmax_t)w_df, (uintmax_t)((1.0-w_dfp/100.0)
*psize)),
-                                           TRUE, min ((uintmax_t)
psize-(uintmax_t)c_df, (uintmax_t)((1.0-c_dfp/100.0)
*psize)),
+                                           TRUE, min ((uintmax_t)
psize-(uintmax_t)w_df, (uintmax_t)((w_dfp/100.0)
*psize)),
+                                           TRUE, min ((uintmax_t)
psize-(uintmax_t)c_df, (uintmax_t)((c_dfp/100.0)
*psize)),
                                            TRUE, 0,
                                            TRUE, psize));
                        if (disk_result==STATE_OK && erronly 
&& !verbose)

----------------------------------------------------------------------

>Comment By: Garry W.  Cook (g_force)
Date: 2004-07-02 15:10

Message:
Logged In: YES 
user_id=197417

OK, please disregard patch above. It did not behave the way
that I thought it did. New patch attached. If this one
doesn't work, I give up, but it seems to be correct now.
Keep in mind, that it does not display perfdata the way it
displays output. My output is in % free space, but the
perfdata is MB in use. 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397599&aid=984174&group_id=29880




More information about the Devel mailing list