Page 1 of 1
Error in check_jvm script
Posted: Tue May 23, 2017 5:30 am
by Poulami
Hi Team,
I am facing an issue while running the check_jvm script .
Whenever I run the script from nagios user, it shows below error message :
'UNKNOWN JVM is running with different username, run this script with UID 2000'
However, If I run this script from app user then it works fine.
EUID of nagios user = 2003
EUID of app user = 2000
How will I be able to run this script successfully from nagios user?
Note : Tomcat is running from app user.
Regards,
Poulami
Re: Error in check_jvm script
Posted: Tue May 23, 2017 12:30 pm
by dwhitfield
I assume
https://exchange.nagios.org//directory/ ... vm/details is what you are using? The instructions make it clear
it must be started with
the same USERid as the target JVM
Also, I found this bit useful in the readme (
https://fidanov.net/c0d3/nagios-plugins ... tor/README):
Usually the plugin is locally installed on monitored system and executed through NRPE.
The NRPE documentation can be high-level at points, but it will be useful if you are not familiar with NRPE:
https://assets.nagios.com/downloads/nag ... e/NRPE.pdf
If you do not like the current state of Java checking, I would suggest letting your requirements known at
https://github.com/nagios-plugins/nagio ... issues/279
Re: Error in check_jvm script
Posted: Wed May 24, 2017 8:57 am
by Poulami
I am pretty sure the script will work when this will be running through the user which is responsible for running tomcat.
Now in case of NRPE, i have configured nagios user in nrpe.cfg.
So if I run the script through NRPE will it work?
Re: Error in check_jvm script
Posted: Wed May 24, 2017 1:33 pm
by tgriep
When using the NRPE agent to run the check on the remote system, you would have to edit the /etc/sudoers file on the remote server and add the following entry. Adjust the command name if needed.
Code: Select all
nagios ALL=(ALL) NOPASSWD: /usr/local/nagios/libexec/check_jvm.sh
Then the command that is defined in the nrpe.cfg file would look like the example below. Replace <username> with the account that is associated with UID of 2000.
Code: Select all
command[check_jvm_nrpe]=/usr/bin/sudo -u <username> /usr/local/nagios/libexec/check_jvm.sh -n what ever options you need
Then restart the NRPE Agent and see if this fixes the issue for you.