Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #6857] Run CheckCommands with C locale (workaround for comma vs dot and plugin api bug) #1859

Closed
icinga-migration opened this issue Aug 5, 2014 · 13 comments
Labels
enhancement New feature or request
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/6857

Created by gvegidy on 2014-08-05 17:01:25 +00:00

Assignee: gbeutner
Status: Resolved (closed on 2015-02-09 13:22:21 +00:00)
Target Version: 2.3.0
Last Update: 2015-02-09 13:22:21 +00:00 (in Redmine)


As part of the Graphite performance data mess in #6550, #6855 and #6851 we have seen several times that the performance data returned by some checks is dependent on the locale of the system. Although the plugin specification states that this is not allowed, we should find a way to deal with plugins having these kinds of bugs in a more user friendly way.

One idea would be to set the LC_* and LANG environment variables by default to "en_US.utf8" when calling CheckCommands.

Changesets

2015-02-09 13:21:42 +00:00 by (unknown) 6168489

Set LC_NUMERIC=C for all processes on *NIX

fixes #6857

Relations:

@icinga-migration
Copy link
Author

Updated by gbeutner on 2014-08-06 07:17:35 +00:00

One thing we could do is to set LC_NUMERIC to 'C':

$ LC_NUMERIC=de_DE.utf8 /usr/lib/nagios/plugins/check_ssh 127.0.0.1
SSH OK - OpenSSH_6.0p1 Debian-4+deb7u2 (protocol 2.0) | time=0,004906s;;;0,000000;10,000000
$ LC_NUMERIC=C /usr/lib/nagios/plugins/check_ssh 127.0.0.1
SSH OK - OpenSSH_6.0p1 Debian-4+deb7u2 (protocol 2.0) | time=0.004890s;;;0.000000;10.000000

@icinga-migration
Copy link
Author

Updated by gbeutner on 2014-08-11 10:32:49 +00:00

  • Subject changed from Run CheckCommands with english locale to Run CheckCommands with POSIX locale

@icinga-migration
Copy link
Author

Updated by gbeutner on 2014-08-11 10:33:11 +00:00

  • Subject changed from Run CheckCommands with POSIX locale to Run CheckCommands with C locale

@icinga-migration
Copy link
Author

Updated by fmbiete on 2014-08-19 17:09:01 +00:00

I was having this problem.
Setting only LC_NUMERIC=C would be safe, but setting LC_* or LANG would break a few checks for me.

But, I think the best solution would be add LC_NUMERIC=C in /etc/sysconfig/icinga2 or point to that in the documentation. Hardcode the locale for the check executions doesn't seems a flexible solution.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-08-20 15:46:39 +00:00

Apparently the Nagios/Monitoring Plugin API specification is incorrect if the locale isn't set properly. The printf's inside the plugins will put ',' or '.' depending on thei locale violating the plugin api specification. The Monitoring Plugins project will probably fix that, but it's highly unlikely that the existing environments will install plugin updates that fast.

I'm not sure if hardcoding the LC_NUMERIC into the execution process makes much sense. Maybe it does make sense as an environment variable for all plugin check commands we ship with icinga2, and for the rest, we'll add documentation for the users to set it through the init script.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-09-03 15:30:28 +00:00

  • Subject changed from Run CheckCommands with C locale to Run CheckCommands with C locale (workaround for comma vs dot and plugin api bug)

@icinga-migration
Copy link
Author

Updated by tgelf on 2014-09-10 14:30:33 +00:00

fmbiete wrote:

But, I think the best solution would be add LC_NUMERIC=C in /etc/sysconfig/icinga2

**
I'd strongly opt for LC_ALL=C (or =POSIX) at startup time. It IMO makes no sense to run a localized deamon.

Setting only LC_NUMERIC=C would be safe, but setting LC_* or LANG would break a few checks for me.

Could you provide some more details here? I mean, what kind of check breaks with LC_ALL=C?

Best,
Thomas

@icinga-migration
Copy link
Author

Updated by fmbiete on 2014-09-11 14:21:32 +00:00

Correct me if I'm wrong, but:

If you run icinga daemon as C, I couldn't have service names or host names with non english characters, they would be stored with the idodb module wrongly, wouldn't they?

Also, although the checks are not locale sensitive, some arguments I use with them are localized, those callings will fail?

check_user_logged.pl --fullname "Francisco Miguel Biete Bañón"

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-02-09 09:56:24 +00:00

  • Target Version set to 2.3.0

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-02-09 12:33:04 +00:00

  • Estimated Hours set to 2

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-02-09 12:41:27 +00:00

  • Assigned to set to gbeutner

@icinga-migration
Copy link
Author

Updated by Anonymous on 2015-02-09 13:22:21 +00:00

  • Status changed from New to Resolved
  • Done % changed from 0 to 100

Applied in changeset 6168489.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-11-04 15:59:14 +00:00

  • Relates set to 10536

@icinga-migration icinga-migration added enhancement New feature or request Checker labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.3.0 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant