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
Error in check_jvm script
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Error in check_jvm script
I assume https://exchange.nagios.org//directory/ ... vm/details is what you are using? The instructions make it clear
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
Also, I found this bit useful in the readme (https://fidanov.net/c0d3/nagios-plugins ... tor/README):it must be started with
the same USERid as the target JVM
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.pdfUsually the plugin is locally installed on monitored system and executed through NRPE.
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
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?
Now in case of NRPE, i have configured nagios user in nrpe.cfg.
Code: Select all
nrpe_user=nagios
Re: Error in check_jvm script
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.
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.
Then restart the NRPE Agent and see if this fixes the issue for you.
Code: Select all
nagios ALL=(ALL) NOPASSWD: /usr/local/nagios/libexec/check_jvm.sh
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
Be sure to check out our Knowledgebase for helpful articles and solutions!