well, maybe I’m wrong, but usually, when there’s a difference between running manually a script and nagios running the script, it comes from one of the two problems:
- “working directory”: when you run manually the script, you’re in the directory of the script; whereas, when nagios runs the scripts … it runs it from another directory (don’t ask me which, I realize now that I don’t know :)). Anyway, all the relatives paths will fail because of that.
So try to only put absolute path
ie: prefere /var/nagios/bin/my_dir_to_be_checked instead of …/nagios/my_dir_to_be_checked
-the other source of problems may be the rights on the script … but it is usually easy to detect/troubleshoot; just have a quick look at that
I hope it helps you; if not, don’t hesitate to rephrase your question