Access lost to environment variables in 3.5.1.dfsg-2+b1

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
krpt
Posts: 4
Joined: Thu Oct 30, 2014 4:11 am

Access lost to environment variables in 3.5.1.dfsg-2+b1

Post by krpt »

Hi there,

Running in debian sid, since our last maj from nagios3-core:amd64 3.5.1-1+b1 -> 3.5.1.dfsg-2+b1, we lost access to env variables in plugin ( we run nagios3 as the nagios user and we use env vars for some plugins ).

Echoing 'env' in a simple shell plugin ran by nagios gives the 'NAGIOS_ARG8= ' output.

After googling I tried sourcing a script before launching nagios and other things without any success.

Any help would be greatly appreciated, Thanks !!

Mike
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Access lost to environment variables in 3.5.1.dfsg-2+b1

Post by Box293 »

In your nagios.cfg file what is the value of enable_environment_macros ?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
krpt
Posts: 4
Joined: Thu Oct 30, 2014 4:11 am

Re: Access lost to environment variables in 3.5.1.dfsg-2+b1

Post by krpt »

thx for trying to answer ;

enable_environment_macros=1

If I was not clear enough, it's System User's variable I can' t access no more, not macros defined in nagios
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Access lost to environment variables in 3.5.1.dfsg-2+b1

Post by sreinhardt »

When running env from the plugin, is that all that is returned, just the NAGIOS_ARG8=?
In addition to the env setting in nagios.cfg, what is the use_large_install_tweaks set to currently? This can override the enable_environment_macros setting if enabled, and disable env macros among other things.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
krpt
Posts: 4
Joined: Thu Oct 30, 2014 4:11 am

Re: Access lost to environment variables in 3.5.1.dfsg-2+b1

Post by krpt »

When running env from the plugin, is that all that is returned, just the NAGIOS_ARG8=?
Yes.
In addition to the env setting in nagios.cfg, what is the use_large_install_tweaks set to currently? This can override the enable_environment_macros setting if enabled, and disable env macros among other things.
I'm away from the server so can't verify for sure, but that's not a setting we have modified as far as I know, It should be set to its default value.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Access lost to environment variables in 3.5.1.dfsg-2+b1

Post by abrist »

krpt wrote: it's System User's variable I can' t access no more
Do you mean resource.cfg $USERn$ macros? If not, could you clarify what you are implying by the "System User's Variable"?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
krpt
Posts: 4
Joined: Thu Oct 30, 2014 4:11 am

Re: Access lost to environment variables in 3.5.1.dfsg-2+b1

Post by krpt »

I meant bashrc variables, variables displayed when typing 'env' in a shell. Used to work, now no more.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Access lost to environment variables in 3.5.1.dfsg-2+b1

Post by abrist »

Odd. I am unsure what changed in the debian build. Could you post your full nagios.cfg?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked