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
nrpe bash script & functions
Re: nrpe bash script & functions
Could you post the configuration for how the check_nrpe is setup for your bash script?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: nrpe bash script & functions
Do you mean the command definition on the nagios host?
$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
arg1: check_filecount
$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
arg1: check_filecount
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: nrpe bash script & functions
No, how about the configuration line in the NRPE config.ramann wrote:Do you mean the command definition on the nagios host?
$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
arg1: check_filecount
Thanks