[STDERR][EC 126]/bin/sh: Cannot execute binary file
[STDERR][EC 126]/bin/sh: Cannot execute binary file
nagiosdeva 2.6.32-279.5.1.el6.x86_64 x86_64
CentOS release 6.3 (Final)
I believe this must be something obvious that I have missed. I have refreshed my dev. environment and the default local host checks indicate the following:
[STDERR][EC 126]/bin/sh: /usr/local/nagios/libexec/check_ping: cannot execute binary file
However, I can execute the check without a problem manually from the command line?
Thanks in advance,
CentOS release 6.3 (Final)
I believe this must be something obvious that I have missed. I have refreshed my dev. environment and the default local host checks indicate the following:
[STDERR][EC 126]/bin/sh: /usr/local/nagios/libexec/check_ping: cannot execute binary file
However, I can execute the check without a problem manually from the command line?
Thanks in advance,
Re: [STDERR][EC 126]/bin/sh: Cannot execute binary file
Can you try running it as the Nagios user?
Code: Select all
su nagios -c '/usr/local/nagios/libexec/check_ping'
Re: [STDERR][EC 126]/bin/sh: Cannot execute binary file
Command line as nagios user works fine. I only have the problem from the check in the web interface.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: [STDERR][EC 126]/bin/sh: Cannot execute binary file
Can you send the output of the following command
thanks
Code: Select all
ls -l /usr/local/nagios/libexec/check_ping
Re: [STDERR][EC 126]/bin/sh: Cannot execute binary file
[root@nagiosdeva ~]# ls -l /usr/local/nagios/libexec/check_ping
-rwxr-xr-x. 1 root root 99658 Jun 6 16:15 /usr/local/nagios/libexec/check_ping
-rwxr-xr-x. 1 root root 99658 Jun 6 16:15 /usr/local/nagios/libexec/check_ping
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: [STDERR][EC 126]/bin/sh: Cannot execute binary file
Can you send the command from your /usr/local/nagios/etc/commands.cfg that you are trying to run from nagios that is producing this error
Re: [STDERR][EC 126]/bin/sh: Cannot execute binary file
check_xi_host_ping
$USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$,$ARG2$ -c $ARG3$,$ARG4$ -p 5
check_xi_host_http
$USER1$/check_http -H $HOSTADDRESS$ $ARG1$
check_icmp
$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$
$USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$,$ARG2$ -c $ARG3$,$ARG4$ -p 5
check_xi_host_http
$USER1$/check_http -H $HOSTADDRESS$ $ARG1$
check_icmp
$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$
Re: [STDERR][EC 126]/bin/sh: Cannot execute binary file
Just to rule out any permissions issues, lets try adding the following permissions to the file and see the issue resolves itself:
Code: Select all
chmod +x /usr/local/nagios/libexec/check_ping
Re: [STDERR][EC 126]/bin/sh: Cannot execute binary file
No change...For the record, I believe I mentioned previously, that all commands work from the command line. The problem seems to be from the web interface?
Re: [STDERR][EC 126]/bin/sh: Cannot execute binary file
Agreed, but the Nagios Core daemon is what executes the check from the command-line as the nagios user, and the output is simply displayed in the browser.
What do you get from running:
What do you get from running:
Code: Select all
whereis ping