[Nagiosplug-devel] [ nagiosplug-Patches-1531899 ] check_disk percentages fix

SourceForge.net noreply at sourceforge.net
Mon Jul 31 20:13:39 CEST 2006


Patches item #1531899, was opened at 2006-07-31 14:13
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1531899&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Bugfix
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: maemigh (maemigh)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_disk percentages fix

Initial Comment:
CVS check_disk (1.74) is outputting inode percentages
in an odd manner due to remnants of old code.  I've
created a patch to fix the output as well as add an
additional option for user choice of output.

The new option give the user the choice of printing
disk/inode percentages as % used or % free.

perfdata output still needs to be looked at.


60a61,63
> /* If nonzero, display percents as % of space used
rather than free */
> static int show_used_pct = 0;
> 
160c163
<   double dused_inodes_percent;
---
>   double dused_inodes_percent, dfree_inodes_percent;
249a253
>       dfree_inodes_percent = 100 - dused_inodes_percent;
278,286d281
<       
< 
< 
< 
<       /* Moved this computation up here so we can add it
<        * to perf */
<       inode_space_pct = (1 - dused_inodes_percent) * 100;
< 
< 
304c299
<                   dfree_pct);
---
>                   (show_used_pct ? dused_pct :
dfree_pct));
308c303
<           asprintf(&output, "%s inode=%.0f%%);",
output, (1 - dused_inodes_percent) * 100);
---
>           asprintf(&output, "%s inode=%.0f%%);",
output, (show_used_pct ? dused_inodes_percent :
dfree_inodes_percent) );
385a381
>     {"used", no_argument, 0, 'f'},
404c400
<     c = getopt_long (argc, argv,
"+?VqhveCt:c:w:K:W:u:p:x:X:mklME", longopts, &option);
---
>     c = getopt_long (argc, argv,
"+?VqhveCt:c:w:K:W:u:p:x:X:mklMEU", longopts, &option);
548a545,547
>     case 'U': /* Display output percentage as % free */
>       show_used_pct = 1;
>       break;
720a720,721
>   printf (" %s\n", "-U --used");
>   printf ("    %s\n", _("Display output percentage as
% free"));
737c738
<   printf ("[-m] [-e] [-W limit] [-K limit] [-v] [-q]
[-E]\n");
---
>   printf ("[-m] [-e] [-W limit] [-K limit] [-v] [-q]
[-E] [-U]\n");

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

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




More information about the Devel mailing list