Page 2 of 3
Re: Custom plugin running fine in command line not in Nagios
Posted: Thu Oct 10, 2013 9:45 pm
by xtremax
Hi lmiltchev,
I have tried your solution, but it's still not working.
Thanks,
Rudy
Re: Custom plugin running fine in command line not in Nagios
Posted: Fri Oct 11, 2013 10:53 am
by lmiltchev
Can you show us the actual command that works from the CLI, and the output of it?
Re: Custom plugin running fine in command line not in Nagios
Posted: Tue Oct 15, 2013 10:05 pm
by xtremax
Hi,
I have tried that as well and still not working out.
Thanks,
Rudy
Re: Custom plugin running fine in command line not in Nagios
Posted: Wed Oct 16, 2013 11:23 am
by scottwilkerson
Am I understanding you correctly, the plugin you created doesn't work from the CLI either?
You will need the plugin to work properly from the CLI before you can get it to work in Nagios.
If it is working from the command line, can you show the command as lmiltchev asked.
Thanks.
Re: Custom plugin running fine in command line not in Nagios
Posted: Thu Oct 17, 2013 12:05 am
by xtremax
Hi,
Sorry for my late response, I am confused and just realised that I need to go to page 2 to see your reply.
I have attached a screenshot for running my script from CLI.
Thanks,
Rudy
Re: Custom plugin running fine in command line not in Nagios
Posted: Thu Oct 17, 2013 10:00 am
by yancy
xtremax,
Can you run the following _After_ you run your plugin to verify the return code is what you expect.
Thanks,
-Yancy
Re: Custom plugin running fine in command line not in Nagios
Posted: Fri Oct 18, 2013 1:07 am
by xtremax
Hi,
I have attached the screenshot as requested.
Thanks,
Rudy
Re: Custom plugin running fine in command line not in Nagios
Posted: Fri Oct 18, 2013 4:54 am
by xtremax
Hi,
I have been looking through this issue and found this capture_plugin.pl script online (
http://www.waggy.at/nagios/capture_plugin.htm).
This plugin used on top of another plugin to capture the real error message that can't be seen. And I have applied it to my plugin to check the error message.
Here is the actual error message:
ERROR: /root/s3cfg: Permission denied
ERROR: Configuration file not available.
ERROR: Consider using --configure parameter to create one.
The error shown that Nagios does not have permission to the config file that needed by s3cmd. To fix this, I've tried to set the owner of this config file to nagios:nagios and also root:root.
However it's still not working with the same error message, may I know what permission that I need to provide for this config file?
Thanks,
Rudy
Re: Custom plugin running fine in command line not in Nagios
Posted: Fri Oct 18, 2013 9:59 am
by abrist
Remove the config from /root. Try placing the config in the nagios home directory /home/nagios or in another folder that nagios has rights to. /root is usually locked down.
Re: Custom plugin running fine in command line not in Nagios
Posted: Mon Oct 21, 2013 12:16 am
by xtremax
Hi abrist,
Thanks for you suggestion, finally it's working. I copied over the config file to /usr/local/nagios/libexec/ and now it's okay.