Monitor old memory heap usage JVM on Nagios xi

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
nym240
Posts: 13
Joined: Thu Feb 15, 2018 5:56 pm

Monitor old memory heap usage JVM on Nagios xi

Post by nym240 »

I'm trying to monitor JVM heap usage for a weblogic server on Nagios xi. Although using check_jvm did the trick, it only shows the total heap usage.
i need to view/monitor heap usage breakdown for old, heap, young and perm memory. is there a way to do it here? Thanks
User avatar
danderson
Posts: 234
Joined: Wed Aug 09, 2023 10:05 am

Re: Monitor old memory heap usage JVM on Nagios xi

Post by danderson »

Thanks for reaching out @nym240,

When I run java -jar /usr/local/nagios/libexec/check_jvm.jar --help I get the following message

Code: Select all

usage: check_jvm.jar [-c <arg>] [-C <arg>] [-h] [-p <arg>] [-s <arg>] [-t
       <arg>] [-u <arg>] [-v] [-w <arg>]
Monitor an application server (Tomcat, JBoss/Wildfly, Jetty, GlassFish)
instance remotely via JMX.
 -c,--critical <arg>      A list of nagios critical threhsolds. At least
                          one of this and warning must be entered.
 -C,--check-types <arg>   A list of the checks that should be run. Valid
                          checks: Uptime, MemorySimpleNonHeap,
                          MemorySimpleHeap, MemoryEden, MemorySurvivor,
                          MemoryOld, MemoryCodeCache,
                          MemoryCompressedClass, MemoryMetaspace,
                          ClassCount, ThreadCount, ProcessCPUUsage, and
                          SystemCPUUsage. Tomcat servers also have the
                          checks RequestsPerMinute, BytesPerMinute,
                          BytesPerRequest, ErrorsPerMinute, and
                          ProcessingTimePerRequest. Note:
                          RequestsPerMinute, BytesPerMinute,
                          BytesPerRequest, ErrorsPerMinute, and
                          ProcessingTimePerRequest also require the name
                          of the relevant request processor. For example,
                          "RequestsPerMinute:http-nio-0.0.0.0-8080". For
                          rate-based checks, a negative value may be
                          returned after a counter is reset.
 -h,--help                Print this message and exit.
 -p,--password <arg>      A password to pass to the JMX connection (should
                          be used in conjunction with the username option
 -s,--service-url <arg>   The full JMX service URL of your JVM (defaults
                          to localhost). This will be similar to
                          'service:jmx:rmi:///jndi/rmi://<host>:<port>/jmx
                          rmi'
 -t,--server-type <arg>   The name of the server brand you're using.
                          Should be one of {tomcat, jboss, jetty,
                          glassfish, other}. Defaults to 'other'. Wildfly
                          users may use 'jboss'.
 -u,--username <arg>      A username to pass to the JMX connection (should
                          be used in conjunction with the password option
 -v,--version             Print the version information and exit.
 -w,--warning <arg>       A list of nagios warning thresholds. At least
                          one of this and critical must be entered.
Please report issues at our support forums:
https://support.nagios.com/forum/
So it looks like you can monitor MemoryOld and MemorySimpleHeap with the -C option but I'm not sure if the other options translate to what you're looking for.
nym240
Posts: 13
Joined: Thu Feb 15, 2018 5:56 pm

Re: Monitor old memory heap usage JVM on Nagios xi

Post by nym240 »

Thanks @danderson, this will do the trick. I was able to use the MemoryOld argument.
User avatar
danderson
Posts: 234
Joined: Wed Aug 09, 2023 10:05 am

Re: Monitor old memory heap usage JVM on Nagios xi

Post by danderson »

I'm glad to hear this resolved your issue, let me know if you have any other questions.