I am writing a plugin for munin to monitor something on our Ubuntu Linux server (which is on Amazon EC2). The plugin requires running a programme /usr/sbin/rabbitmqctl
via sudo
.
I have the following line in /etc/sudoers
:
munin ALL = NOPASSWD: /usr/sbin/rabbitmqctl list_queues
As you can see the munin
user (which is the user that runs the script) is allowed execute the command /usr/sbin/rabbitmqctl list_queues
via sudo without a password. I have confirmed this works by sudo -u munin -s
and running it.
However in the munin logs (/var/log/munin/munin-node.log
), I get lots of output for the plugin like this:
2013/06/28-11:35:26 [28107] sudo: no tty present and no askpass program specified
And there is no data in the graph.
At the end of my /etc/sudoers
file, I have this, which is commonly suggested as a solution:
Defaults !requiretty
However it doesn't fix it. The common suggestion of "uncomment that line in /etc/sudoers" doens't work either because there isn't anything in that file.
Is there a way to allow my munin plugin to call something via sudo
?
Update №1: The munin plugin is executed by munin-node on the server, that's run as the munin user, I can't change all of munin to run everything as root.