sensu-plugins / sensu-plugins-java

Sensu Java Plugins
http://sensu-plugins.io
MIT License
5 stars 25 forks source link

metrics-java-heap-graphite.rb requires sensu to have sudo access, I can't figure out how to restrict. #10

Closed bradenwright closed 7 years ago

bradenwright commented 7 years ago

So I'm not sure if it should require sudo access, I note on the README page/an example or 2 would be nice. Anyways I've been able to get metrics-java-heap-graphite.rb to run on sensu but only by setting up:

Defaults:sensu !requiretty

sensu ALL = NOPASSWD:ALL

I've tried all sorts of combinations of files to allow like

sensu ALL = NOPASSWD: /opt/sensu/embedded/bin/metrics-java-heap-graphite.rb, /opt/sensu/embedded/bin/metrics-java-heap-graphite.sh

but I just can't seem to figure it out. Some help would be much appreciated

majormoses commented 7 years ago

I think its probably that you need to include the jps command as well.

majormoses commented 7 years ago

related: https://github.com/sensu-plugins/sensu-plugins-java/issues/9#issuecomment-280748978

majormoses commented 7 years ago

@bradenwright can you see if using it as eric suggested works for you?

majormoses commented 7 years ago

closing due to inactivity.