[Nagiosplug-devel] [ nagiosplug-Bugs-1266157 ] Problems with LC_ALL and check_ping, check_load...
SourceForge.net
noreply at sourceforge.net
Wed Aug 24 14:49:32 CEST 2005
Bugs item #1266157, was opened at 2005-08-22 08:59
Message generated for change (Comment added) made by seanius
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1266157&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: Parsing problem
Group: snapshot rpm
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Alen Salamun (alien2108)
>Assigned to: M. Sean Finney (seanius)
Summary: Problems with LC_ALL and check_ping, check_load...
Initial Comment:
With the latest nagios_plugins
(nagios-plugins-1.4-2.rf) compiled by myself I have
problems with numerious check scripts.
For example if I run check_ping:
# ./check_ping1 -H 192.168.10.2 -w10,20% -c
50,50%/bin/ping -n -U -w 10 -c 5 192.168.10.2
CRITICAL - Could not interpret output from ping command
BUT:
LC_ALL=C ./check_ping1 -H 192.168.10.2 -w10,20% -c 50,50%
PING OK - Packet loss = 0%, RTA = 0.23 ms
Is this problem with plugins not correctly handling
locales? System is Linux Mandrake 10.0 with LC's:
LC_ADDRESS=sl_SI
LC_COLLATE=en_US
LC_CTYPE=en_US
LC_IDENTIFICATION=sl_SI
LC_MEASUREMENT=sl_SI
LC_MESSAGES=en_US
LC_MONETARY=sl_SI
LC_NAME=sl_SI
LC_NUMERIC=sl_SI
LC_PAPER=sl_SI
LC_SOURCED=1
LC_TELEPHONE=sl_SI
LC_TIME=en_US
MAILCHECK=60
----------------------------------------------------------------------
>Comment By: M. Sean Finney (seanius)
Date: 2005-08-24 17:48
Message:
Logged In: YES
user_id=226838
hi,
yes, the problem was the plugins seemed to be making some
bad assumptions about numerical formats. the real fix is to
set the LC_NUMERIC value to "POSIX" or "C", which leaves all
other locale-related stuff appropriately but gives the
plugin what it wants (namely, '.' as a decimal point instead
of ',').
check_ping and check_load (the two of which i'm aware were
having the locale/numeric scanning problems) both have been
fixed in cvs, and included in the latest 1.4.1 release of
the plugins. if you still have problems with other
check_commands, feel free to open a new bug report and let
me know.
----------------------------------------------------------------------
Comment By: Matteo (sgala2)
Date: 2005-08-24 07:19
Message:
Logged In: YES
user_id=755585
the problem seems to be in the parsing with scanf that when
you are in locale that have the comma as decimal separator
the scanf fail.
I fixed replacing in all plugin that i nedd the line
setlocale (LC_ALL, "");
with
setlocale (LC_ALL, "C");
all now work fine!
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1266157&group_id=29880
More information about the Devel
mailing list