How can I add PATH variable to NRPE2?
My problem is that I have several python written plugins and they do not work in jails.
I have created quick workaround. A symlink /usr/bin/python2 -> /usr/local/bin/python2 , but I am not sure if this a proper way doing things as machine is jailed and I am sharing path with a basejail.
Without symlink I am ending up with :
I did some debugging and find out that NRPE2 does not set up proper paths.
created test file in /usr/local/libexec/nagios/check_testme on a target machine
Adjust /usr/local/etc/nrpe.conf with:
Restarted NRPE
On the nagios machine(Linux) I did this
Result shows that there is no path to fit with python (/usr/local/bin/python).
Does anyone had similar issue or know how to add paths to NRPE2?
My problem is that I have several python written plugins and they do not work in jails.
I have created quick workaround. A symlink /usr/bin/python2 -> /usr/local/bin/python2 , but I am not sure if this a proper way doing things as machine is jailed and I am sharing path with a basejail.
Without symlink I am ending up with :
Code:
root@monitor018:/usr/local/nagios/libexec# ./check_nrpe -H 10.113.113.123 -c check_mongo
NRPE: Unable to read output
I did some debugging and find out that NRPE2 does not set up proper paths.
created test file in /usr/local/libexec/nagios/check_testme on a target machine
Code:
#!/bin/sh
echo -------------------
env
echo -------------------
whoami
echo -------------------
Adjust /usr/local/etc/nrpe.conf with:
Code:
command[check_testme]=/usr/local/libexec/nagios/check_testme
allow_bash_command_substitution=1
allowed_hosts=127.0.0.1,10.24.14.41
command_timeout=60
connection_timeout=300
debug=0
dont_blame_nrpe=1
log_facility=daemon
nrpe_group=nagios
nrpe_user=nagios
pid_file=/var/run/nrpe2/nrpe2.pid
server_port=5666
Restarted NRPE
service nrpe2 restart
On the nagios machine(Linux) I did this
Code:
root@monitor023:/usr/local/nagios/libexec# ./check_nrpe -H 10.113.113.123 -c check_testme
PATH=/sbin:/bin:/usr/sbin:/usr/bin
PWD=/
HOME=/
NRPE_PROGRAMVERSION=2.15
NRPE_MULTILINESUPPORT=1
RC_PID=49882
-------------------
nagios
-------------------
Code:
root@product:/usr/local/etc # uname -a
FreeBSD product 10.2-RELEASE FreeBSD 10.2-RELEASE #0 r286666: Wed Aug 12 15:26:37 UTC 2015 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
Result shows that there is no path to fit with python (/usr/local/bin/python).
Does anyone had similar issue or know how to add paths to NRPE2?