Hi lmiltchev,
I have tried your solution, but it's still not working.
Thanks,
Rudy
Custom plugin running fine in command line not in Nagios
Re: Custom plugin running fine in command line not in Nagios
Can you show us the actual command that works from the CLI, and the output of it?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Custom plugin running fine in command line not in Nagios
Hi,
I have tried that as well and still not working out.
Thanks,
Rudy
I have tried that as well and still not working out.
Thanks,
Rudy
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Custom plugin running fine in command line not in Nagios
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.
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
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
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
You do not have the required permissions to view the files attached to this post.
Re: Custom plugin running fine in command line not in Nagios
xtremax,
Can you run the following _After_ you run your plugin to verify the return code is what you expect.
Thanks,
-Yancy
Can you run the following _After_ you run your plugin to verify the return code is what you expect.
Code: Select all
echo $?
-Yancy
Re: Custom plugin running fine in command line not in Nagios
Hi,
I have attached the screenshot as requested.
Thanks,
Rudy
I have attached the screenshot as requested.
Thanks,
Rudy
You do not have the required permissions to view the files attached to this post.
Re: Custom plugin running fine in command line not in Nagios
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
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
You do not have the required permissions to view the files attached to this post.
Re: Custom plugin running fine in command line not in Nagios
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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Custom plugin running fine in command line not in Nagios
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.
Thanks for you suggestion, finally it's working. I copied over the config file to /usr/local/nagios/libexec/ and now it's okay.