FS#52873 - [nrpe] PATH and other environment variables not set with NRPE 3.x
Attached to Project:
Community Packages
Opened by Moritz Bunkus (mbunkus) - Monday, 06 February 2017, 16:30 GMT
Last edited by Jonathan Steel (jsteel) - Sunday, 26 February 2017, 20:18 GMT
Opened by Moritz Bunkus (mbunkus) - Monday, 06 February 2017, 16:30 GMT
Last edited by Jonathan Steel (jsteel) - Sunday, 26 February 2017, 20:18 GMT
|
Details
Description:
Since the recent upgrade of Arch's NRPE package to >= 3.0 the PATH environment variable and other environment variables aren't set if the `nrpe_user` configuration variable is set to a numeric ID instead of a user name. This is unfortunately Arch's default configuration; it ships with `nrpe_user=31`. It seems no other distribution ships with a numeric `nrpe_user` by default, otherwise this would surely have come up earlier. This is a bug newly introduced in NRPE 3.0, to be more precise, in its function for cleaning the environment, which calls `getpwnam(nrpe_user)`, and that fails, obviously. I've already report this upstream: https://github.com/NagiosEnterprises/nrpe/issues/96 I'm also reporting it here in order to make it easier for other affected Arch users to figure out what's wrong and why their checks are suddenly failing. Additional info: * package version: nrpe 3.0.1-2 * config: default configuration Steps to reproduce: 1. Add a check to NRPE that executes a Perl script which in turn dumps %ENV somewhere 2. Restart nrpe.service 3. Execute that check via `check_nrpe -H localhost -c yourcheck` 4. Observe output generated by 1. |
This task depends upon
Closed by Jonathan Steel (jsteel)
Sunday, 26 February 2017, 20:18 GMT
Reason for closing: Fixed
Additional comments about closing: 3.0.1-3
Sunday, 26 February 2017, 20:18 GMT
Reason for closing: Fixed
Additional comments about closing: 3.0.1-3
I am aware of Arch's policy not to modify upstream. However, things such as this are done often enough as far as I can tell.
My own workaround is not to use your nrpe.cfg file but my own in which I'm using the user names. pacdiff takes care of showing me what's changed after updating the package, and I simply skip the hunks that modify nrpe_user/nrpe_group. Do I wish I wouldn't have had to spend a couple of hours debuging this (for which I definitely blame upstream, not you!)? Absolutely. Can I live with the current situation? I sure can.
Yes, the only change needed to make this problem go away is the nrpe.cfg file. Nothing has to be changed during compilation.
Thanks!