Page 1 of 1

Tomcat Monitoring Graph Showing in Bytes not in GBs

Posted: Wed Apr 07, 2021 9:09 am
by ar0431
Tomcat monitoring graph showing Bytes not in GBs. Is there any way to fix this? Please see the attached file.

Re: Tomcat Monitoring Graph Showing in Bytes not in GBs

Posted: Wed Apr 07, 2021 9:37 am
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'"

Re: Tomcat Monitoring Graph Showing in Bytes not in GBs

Posted: Thu Apr 08, 2021 1:12 pm
by ar0431
anyone have any idea on this???

Re: Tomcat Monitoring Graph Showing in Bytes not in GBs

Posted: Thu Apr 08, 2021 2:58 pm
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

Re: Tomcat Monitoring Graph Showing in Bytes not in GBs

Posted: Thu Apr 08, 2021 3:09 pm
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

Re: Tomcat Monitoring Graph Showing in Bytes not in GBs

Posted: Thu Apr 08, 2021 4:06 pm
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

Re: Tomcat Monitoring Graph Showing in Bytes not in GBs

Posted: Fri Apr 09, 2021 8:48 am
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.

Re: Tomcat Monitoring Graph Showing in Bytes not in GBs

Posted: Fri Apr 09, 2021 4:05 pm
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