Tomcat Monitoring graph Showing in Bytes not in GBs

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ar0431
Posts: 73
Joined: Tue May 21, 2019 12:05 pm

Tomcat Monitoring graph Showing in Bytes not in GBs

Post by ar0431 »

Tomcat monitoring graph showing Bytes not in GBs. Is there any way to fix this? Please see the attached file.
You do not have the required permissions to view the files attached to this post.
ar0431
Posts: 73
Joined: Tue May 21, 2019 12:05 pm

Re: Tomcat Monitoring graph Showing in Bytes not in GBs

Post by ar0431 »

This is the command Nagios is using. Note:- I remove the user name and password from the command. How we can use GB instead of bytes for the graphs and warning and critical threshold.

check_xi_ncpa!-t -P -M plugins/check_jvm.jar -q "args=-s service:jmx:rmi:///jndi/rmi:///jmxrmi,args=-u '',args=-p '',args=-t tomcat,args=-C 'MemorySimpleHeap,MemoryEden,MemorySurvivor,MemoryOld,MemorySimpleNonHeap,MemoryCodeCache,MemoryCompressedClass,MemoryMetaspace,ProcessCPUUsage,SystemCPUUsage,Uptime,ClassCount,ThreadCount',args=-w '53687091200,53687091200,53687091200,53687091200,53687091200,53687091200,53687091200,34359738368,50,70,1500000:,10000,250',args=-c '64424509440,64424509440,64424509440,64424509440,64424509440,64424509440,64424509440,68719476736,70,90,300000:,50000,390'"
ar0431
Posts: 73
Joined: Tue May 21, 2019 12:05 pm

Re: Tomcat Monitoring graph Showing in Bytes not in GBs

Post by ar0431 »

anyone have any idea on this???
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Tomcat Monitoring graph Showing in Bytes not in GBs

Post by vtrac »

Hi ar0431,
I looked on my Nagios XI VM and "check_xi_ncpa" used "check_ncpa.py" script (below):

Code: Select all

define command {
    command_name    check_xi_ncpa
    command_line    $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
}
Let try adding the "-u G" to your "check_ncpa.py" script and see what you get.
I don't have tomcat here so not able to test it.

Could you please try manually run this (ONE line) on the command prompt?

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -t -P -M plugins/check_jvm.jar -q "args=-s service:jmx:rmi:///jndi/rmi:///jmxrmi,args=-u '',args=-p '',args=-t tomcat,args=-C 'MemorySimpleHeap,MemoryEden,MemorySurvivor,MemoryOld,MemorySimpleNonHeap,MemoryCodeCache,MemoryCompressedClass,MemoryMetaspace,ProcessCPUUsage,SystemCPUUsage,Uptime,ClassCount,ThreadCount',args=-w '53687091200,53687091200,53687091200,53687091200,53687091200,53687091200,53687091200,34359738368,50,70,1500000:,10000,250',args=-c '64424509440,64424509440,64424509440,64424509440,64424509440,64424509440,64424509440,68719476736,70,90,300000:,50000,390'" -u G

NOTE: I put the "-u G" at the end, but you could try put it at the beginning if you like.

Please share outputs of the above command, if you can.



Regards,
Vinh
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Tomcat Monitoring graph Showing in Bytes not in GBs

Post by vtrac »

Hi
Here's a similar question I just found (searched) the forum:
https://support.nagios.com/forum/viewto ... =6&t=51737

Hoping that my last replied will work ... :-)


Regards,
Vinh
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Tomcat Monitoring graph Showing in Bytes not in GBs

Post by vtrac »

Hi,
One of our senior member of the team, which has tomcat, and was able to test this out with the "-u G" option.

Unfortunately, this did not work!!

Here's his quote:
Pretty sure dev would need to implement changes to make it work
Here's the command he used:

Code: Select all

[root@xid ~]# /usr/local/nagios/libexec/check_ncpa.py -H 192.168.23.86 -t 'Yk0LGDKF2i4Mi5tW' -P 5693 -M plugins/check_jvm.jar -a '-s "service:jmx:rmi:///jndi/rmi://localhost:9000/jmxrmi" -u tomcat -p tomcat -t tomcat -C "MemorySimpleHeap" -w 2: -c 1:' -u G

Heap-Allocated Memory returned OK with 23.33 MiB | tomcat_heap=24464328B;2:;1:;;
Sorry for the bad new.


Regards,
Vinh
ar0431
Posts: 73
Joined: Tue May 21, 2019 12:05 pm

Re: Tomcat Monitoring graph Showing in Bytes not in GBs

Post by ar0431 »

Looks like I have to write a script to convert the Bytes into GBs for graphs. But now a days every software is using memory in GBs. I have no idea why developers still using Bytes for scaling.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Tomcat Monitoring graph Showing in Bytes not in GBs

Post by vtrac »

Hi ar0431,
I understand your frustration, since this number is long and also do not have "," (comma).

I will bring this up on our next meeting with the DEV team.


Best Regards,
Vinh