check_load weird behavior in French config
Andreas Ericsson
ae at op5.se
Fri Feb 18 15:43:41 CET 2005
Serveur-Faucon Surveillance wrote:
> Hi all,
>
> The is somehow a weird behavior with check_load with my French
> Mandrake 10.x (plugins version 1.4)
>
> Somehow, when I reboot the server, check_load does not work anymore.
> I go on the console, /init.d/nrpe restart the program and everything
> is fine after. Is there someone with/had the same problem?
>
>
> --- all the tests ---
>
> On another normal system (rh9)
>
> root# /usr/local/nagios/libexec/check_load -w 20,15,10 -c 35,30,25 OK
> - load average: 0.37, 0.66, 0.82|load1=0;20;35;0 load5=0;15;30;0
> load15=0;10;25;0
>
> Everything is fine...
>
> On a English Mandrake 10.x
>
> root]# /usr/local/nagios/libexec/check_load -w 20,15,10 -c 35,30,25
> OK - load average: 0.31, 0.23,
> 0.20|load1=0.310000;20.000000;35.000000;0.000000
> load5=0.230000;15.000000;30.000000;0.000000
> load15=0.200000;10.000000;25.000000;0.000000
>
> Everything is fine...
>
> But... on a French Mandrake 10.x
>
> /usr/local/nagios/libexec/check_load -w 20,15,10 -c 35,30,25 Warning
> threshold must be float or float triplet! Usage: check_load -w
> WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15 check_load (-h |
> --help) for detailed help check_load (-V | --version) for version
> information
>
> So he needs some " " " since the command "w" returns with "," insted
> of "."
>
> root]# w 09:08:23 up 15:48, 1 user, load average: 0,00, 0,00, 0,00
> USER TTY LOGIN@ IDLE JCPU PCPU WHAT root pts/0
> 09:07 0.00s 0.10s 0.01s w
>
> root]# /usr/local/nagios/libexec/check_load -w "20,0","15,0","10,0"
> -c "35,0","30,0","25,0" OK - load average: 0,00, 0,00,
> 0,00|load1=0;20;35;0 load5=0;15;30;0 load15=0;10;25;0
>
> everything works now. But when I reboot, there is a critical
> situation. When I restart nrpe, everything is fine.
>
This has to do with locale settings. The french numbers locale appoints
',' to be the decimal point (decimal comma or whatever), which clashes
horribly with the plugins since it's using strtod() to get the
thresholds. strtod() barfs on more than one decimal point (decimal
comma, whatever), since any number can only have one decimal point
(comma...).
It's terribly involved to try to write code to parse all different
locales properly. The best bet would probably be to use a semi-colon,
but that would leave current users stumped because the shell will think
you're starting a new command. Like I said; Terribly involved.
>
>
> --------------------------------------------------- Alexandre Racine
> - www.gardienvirtuel.com Montréal, Québec, Canada
>
>
>
> ------------------------------------------------------- SF email is
> sponsored by - The IT Product Guide Read honest & candid reviews on
> hundreds of IT Products from real users. Discover which products
> truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
> _______________________________________________ Nagios-users mailing
> list Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please
> include Nagios version, plugin version (-v) and OS when reporting any
> issue. ::: Messages without supporting info will risk being sent to
> /dev/null
>
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Lead Developer
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list