sensu-plugins / sensu-plugins-java

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

Usage of sudo in check-java-heap-pcnt.rb #7

Closed rahulsh1 closed 7 years ago

rahulsh1 commented 7 years ago

Is there any particular reason for using sudo while running the jps and jstat commands? The "user" under which the script runs should have the correct permissions to check for status of process and calculate the heap usage.

I see this error while running the check. output: sudo: sorry, you must have a tty to run sudo

rahulsh1 commented 7 years ago

I added the following to /etc/sudoers

sensu   ALL=(ALL)       NOPASSWD: ALL
Defaults:sensu !requiretty