Build precise queries to find exactly what you need
Press ESC to close
Hi, i have probe this plugin, and it works only with root user, i have added the config in /etc/sudoers but mi execution with user nagios is the following:
-bash-4.1$ cd /srv/nagios/libexec/ -bash-4.1$ ./check_jstat.sh -s tomcat6 Could not attach to 11922 CRITICAL: Can’t get GC statistics
I think that the problem is in jstat, which don´t have permissions to see all java process (all users).
I add permisions to /etc/sudoers:
nagios ALL=(root) NOPASSWD: /usr/bin/jstat
And modify the plugin included “sudo” in calls to jstat lines:
gc=$(sudo jstat -gc $pid | tail -1 | sed -e ‘s/[ ][ ]*/ /g’)
gccapacity=$(sudo jstat -gccapacity $pid | tail -1 | sed -e ‘s/[ ][ ]*/ /g’)
And works perfectly!
If there is any alternative solution may be welcome 🙂
Good work!
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!