[Varnish] #727: Tiny Patch: Human readable nagios output
    Varnish 
    varnish-bugs at varnish-cache.org
       
    Thu Mar 10 10:42:25 CET 2011
    
    
  
#727: Tiny Patch: Human readable nagios output
-------------------------+--------------------------------------------------
 Reporter:  sascha       |       Owner:  tfheen
     Type:  enhancement  |      Status:  new   
 Priority:  normal       |   Milestone:        
Component:  build        |     Version:  trunk 
 Severity:  normal       |    Keywords:        
-------------------------+--------------------------------------------------
Changes (by tfheen):
  * owner:  => tfheen
Old description:
> as mentioned in #710, I suggest a little change to make big number easier
> readable:
>
> {{{
> ~/varnish-svn-trunk/varnish-tools/nagios# svn diff
> Index: check_varnish.c
> ===================================================================
> --- check_varnish.c     (revision 4936)
> +++ check_varnish.c     (working copy)
> @@ -31,6 +31,7 @@
>   */
>
>  #include <inttypes.h>
> +#include <locale.h>
>  #include <limits.h>
>  #include <stdint.h>
>  #include <stdio.h>
> @@ -200,7 +201,8 @@
>                 printf("Unknown parameter '%s'\n", param);
>
>         status = check_thresholds(value);
> -       printf("VARNISH %s: %s|%s=%jd\n", status_text[status], info,
> param, value);
> +       setlocale(LC_ALL, "");
> +       printf("VARNISH %s: %s (%'jd)|%s=%jd\n", status_text[status],
> info, value, param, value);
>         exit(status);
>  }
>
> }}}
>
> Cheers
>
> Sascha
New description:
 as mentioned in #710, I suggest a little change to make big number easier
 readable:
 {{{
 ~/varnish-svn-trunk/varnish-tools/nagios# svn diff
 Index: check_varnish.c
 ===================================================================
 --- check_varnish.c     (revision 4936)
 +++ check_varnish.c     (working copy)
 @@ -31,6 +31,7 @@
   */
  #include <inttypes.h>
 +#include <locale.h>
  #include <limits.h>
  #include <stdint.h>
  #include <stdio.h>
 @@ -200,7 +201,8 @@
                 printf("Unknown parameter '%s'\n", param);
         status = check_thresholds(value);
 -       printf("VARNISH %s: %s|%s=%jd\n", status_text[status], info,
 param, value);
 +       setlocale(LC_ALL, "");
 +       printf("VARNISH %s: %s (%'jd)|%s=%jd\n", status_text[status],
 info, value, param, value);
         exit(status);
  }
 }}}
 Cheers
 Sascha
--
Comment:
 This was fixed in https://github.com/varnish/varnish-
 nagios/commit/cd477fe0384a162c2fc9e06ae441b3908ca1afaa
-- 
Ticket URL: <http://varnish-cache.org/trac/ticket/727#comment:1>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator
    
    
More information about the varnish-bugs
mailing list