Page 1 of 1

Issues in monitoring the Java Heap Memory

Posted: Thu Mar 29, 2018 3:59 am
by nai70966
Hi,

I need to monitor java heap memory on one of the servers. I tried 2 scripts for the same. One is check_jstat.sh (https://exchange.nagios.org/directory/P ... at/details) and the other is check_jvm.sh (https://exchange.nagios.org/directory/P ... vm/details).

With check_jstat.sh I can monitor the java heap memory with the pid, but as the pid is not static/stable so this doesn't work and with check_jvm.sh I can monitor the java heap memory from the application/java name, but the issue over here is that I cannot execute this script from the nagios user because the java application is under the oracle user.

This is the error I get if I run the script from nagios user :
[nagios@servername libexec]$ ./check_jvm.sh --name Dweblogic.Name=Portal -k weblogic -p heap -w 100 -c 200
UNKNOWN JVM is running with different username, run this script with UID 500

So, what can be the solution for this? Or is there any other alternative or script to monitor the java heap memory?
Requesting you to help me in this.


--
Thanks,
Sayali.

Re: Issues in monitoring the Java Heap Memory

Posted: Thu Mar 29, 2018 10:34 am
by tacolover101
it looks to be a permission issue of some sort. this post has some helpful things to look at - https://support.nagios.com/forum/viewto ... 16&t=43925

a work around, would be to use jmx and expose an ip:port to be polled on. then use jmx - https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Re: Issues in monitoring the Java Heap Memory

Posted: Thu Mar 29, 2018 1:08 pm
by scottwilkerson
I have to agree with @tacolover101, almost all java monitoring is done through JMX