Home Directory

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Directory

Thundr

Reviews(1)
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!