nrpe.cfg not passing through a global environment variable.
Posted: Wed Mar 27, 2019 6:38 am
Hi,
We have an issue were the nrpe_user is configured to use nagios. However when the nagios user is called, it ignores the environment variables configured in bash.bashrc and profile.d/appenv.sh.
When the environment variable is hardcoded within our scripts this then does work.
I have seen messages about this happening in the event the nrpe_user has been assigned a numeric variable but as you can see in the below configuration (npre.cfg) this is not the case:
log_file=/var/log/nrpe.log
debug=1
pid_file=/var/run/nagios/nrpe.pid
server_port=5666
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=127.0.0.1,::1
dont_blame_nrpe=1
allow_bash_command_substitution=0
command_timeout=60
connection_timeout=300
command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib/nagios/plugins/check_load -r -w .15,.10,.05 -c .30,.25,.20
command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200
include=/etc/nagios/nrpe_local.cfg
include_dir=/etc/nagios/nrpe.d/
TIA - any help would be gratefully received
We have an issue were the nrpe_user is configured to use nagios. However when the nagios user is called, it ignores the environment variables configured in bash.bashrc and profile.d/appenv.sh.
When the environment variable is hardcoded within our scripts this then does work.
I have seen messages about this happening in the event the nrpe_user has been assigned a numeric variable but as you can see in the below configuration (npre.cfg) this is not the case:
log_file=/var/log/nrpe.log
debug=1
pid_file=/var/run/nagios/nrpe.pid
server_port=5666
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=127.0.0.1,::1
dont_blame_nrpe=1
allow_bash_command_substitution=0
command_timeout=60
connection_timeout=300
command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib/nagios/plugins/check_load -r -w .15,.10,.05 -c .30,.25,.20
command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200
include=/etc/nagios/nrpe_local.cfg
include_dir=/etc/nagios/nrpe.d/
TIA - any help would be gratefully received