Tuesday, 12 August 2014

How to monitor Glassfish memory usage on zabbix - SOLVED!

In case that you need monitoring of your glassfish application server java memory consumption you can use asadmin get directive. With this you can get all necessary information about glassfish resources. How to get only java memory information?

server#./asadmin get -m server.jvm.memory.*heap*
server.jvm.memory.committedheapsize-count-count = 2428174336
server.jvm.memory.committedheapsize-count-description = Amount of memory in bytes that is committed for the Java virtual machine to use
server.jvm.memory.committedheapsize-count-lastsampletime = 1407835165699


This will give you all memory information that you need but this is maybe to much. Usually all you want is committed heap size, used heap size and max heap size.

server#./asadmin get -m server.jvm.memory.*heap* |grep count-count
server.jvm.memory.committedheapsize-count-count = 2428174336
server.jvm.memory.committednonheapsize-count-count = 550043648
server.jvm.memory.initheapsize-count-count = 62795648
server.jvm.memory.initnonheapsize-count-count = 539426816
server.jvm.memory.maxheapsize-count-count = 2863333376
server.jvm.memory.maxnonheapsize-count-count = 1124073472
server.jvm.memory.usedheapsize-count-count = 200077448
server.jvm.memory.usednonheapsize-count-count = 121870448

From here you can see all information that you need!
From here you can grep information that you need and add them in zabbix agent and zabbix server.

No comments: