Return code 126


I installed Nagios onto a box of mine which has CGI running suexec, since it’s being used to host customers as well. However I keep getting these types of errors:

Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios 1.0b4 *****\n\nNotification Type: PROBLEM\nHost:\nState: DOWN\nAddress:\nInfo: /bin/ping -n -U -c 1\n\nDate/Time: Sat Mar 12 08:46:33 PST 2005\n" | /bin/mail -s "Host DOWN alert for!" [[email protected]](mailto:[email protected])" resulted in a return code of 126. Make sure the script or binary you are trying to execute actually exists...

Because of this Nagios can’t send mail, can’t perform ping, etc. Any commands outside of the user’s home directory basically is offlimits it seems.

How do I go about fixing this problem? Nagios gives me such a huge headache. :evil:


Like anything that is new, it takes time to learn it. Just try mastering anything like rrdtoold, or even linux in general and I/you get headaches.
If the nagios user doesn’t have access to /bin/ping commands, then I suspect that is a big problem. Try su - nagios and run the commands by hand. You might want to follow the install intstructions again, and don’t skip anything. I know every time I setup nagios, I do it by the docs, not by memory.