nrpe bash script & functions
Posted: Tue Jan 27, 2015 2:02 am
hi @all,
I wrote a bash script to make some checks. I execute this script via the nrpe- agent. When I execute this script direct on the host, everything is fine.
But when I use the nrpe agent, the function which I defined in my script are executet directly without calling this function.
Example:
#!/bin/bash
RESULT=INIT'
function f_ok {
echo "OK: "${RESULT}
exit 0
}
if [ -d XXX]; then
do some tests
NOT_FALL_FUNCTION
fi
NOT_FALL_FUNCTION
…
The agent calls only f_ok direct and my scripts stops with "OK INIT" to do anything else.
NRPE Version: 2.13
Nagios XI 2011R2.2
Any ideas?
Thanks
bjoern
I wrote a bash script to make some checks. I execute this script via the nrpe- agent. When I execute this script direct on the host, everything is fine.
But when I use the nrpe agent, the function which I defined in my script are executet directly without calling this function.
Example:
#!/bin/bash
RESULT=INIT'
function f_ok {
echo "OK: "${RESULT}
exit 0
}
if [ -d XXX]; then
do some tests
NOT_FALL_FUNCTION
fi
NOT_FALL_FUNCTION
…
The agent calls only f_ok direct and my scripts stops with "OK INIT" to do anything else.
NRPE Version: 2.13
Nagios XI 2011R2.2
Any ideas?
Thanks
bjoern