Custom NCPA Plugin - sudo warning
Posted: Fri Sep 03, 2021 11:58 am
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.
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.