I set up a custom script to check for RabbitMQ Partitions, dropped it in /usr/local/ncpa/plugins and can call it without issue from Nagios XI.
However, the response to the script includes the sudo warning message and that is what shows up in the dashboard. Full response:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
sudo: no tty present and no askpass program specified
OK: No Rabbit network partitions.
How do I suppress that sudo output and get only the script output in my service check? It looks like the other NCPA checks are suppressing that.
Custom NCPA Plugin - sudo warning
Re: Custom NCPA Plugin - sudo warning
Hi
does the plugin issue an "ssh" command?
If it does try using the -t option with it so "ssh" ---> "ssh -t"
If the above doesn't work, or you aren't using "ssh" in your plugin, please
provide the code for the plugin while redacting any passwords, etc.
You can also PM me the plugin, if you do then reply to this post once
you have PMed the file.
Thank you
does the plugin issue an "ssh" command?
If it does try using the -t option with it so "ssh" ---> "ssh -t"
If the above doesn't work, or you aren't using "ssh" in your plugin, please
provide the code for the plugin while redacting any passwords, etc.
You can also PM me the plugin, if you do then reply to this post once
you have PMed the file.
Thank you
Re: Custom NCPA Plugin - sudo warning
I'm using check_xi_ncpa to hit a bash script on the client side (in the plugins folder). So, check_xi_ncpa is handling the connection to the monitored host and executing the client side plugin. Again, the plugin is working fine. I'm just getting the additional sudo warning text returned. So, my service status shows
"We trust you have received the usual lecture from the local System"
the first line of the sudo warning... instead of the plugin output:
"OK: No Rabbit network partitions."
I've been searching for docs on check_xi_ncpa and can only find check_ncpa docs. Are there any differences? Is there a switch that might affect ? I'm comparing built in service check commands and don't see anything sudo specific.
I'll look at using !lecture per user in sudoers and see where that gets me.
"We trust you have received the usual lecture from the local System"
the first line of the sudo warning... instead of the plugin output:
"OK: No Rabbit network partitions."
I've been searching for docs on check_xi_ncpa and can only find check_ncpa docs. Are there any differences? Is there a switch that might affect ? I'm comparing built in service check commands and don't see anything sudo specific.
I'll look at using !lecture per user in sudoers and see where that gets me.
Re: Custom NCPA Plugin - sudo warning
Nevermind. This is more related to using sudo in the client side script than the call to check_ncpa. Consider this a non-issue.