Memory usage monitoring for process

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Memory usage monitoring for process

Post by kalyanpabolu »

Hello,

We have tried making the changes to the script as per your suggestion and the output was altogether different. It did not give correct output.

After that I have reverted the changes and we are again getting approx 10 MB difference in the output.

Is there any other way we can monitor this?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Memory usage monitoring for process

Post by ssax »

In the windows task manager, expand the column for memory so you can see what it's showing, it's currently cutoff and is only showing Memory (Private.... Let us know what it shows.

Try changing the plugin to use:

Code: Select all

perfcount_value="Working Set - Private"
Try this one as well:

Code: Select all

./check_nrpe -H 10.50.10.51 -p 5666 -t 60 -c CheckCounter -a 'Counter:JavaService=\Process(JavaService)\Working Set- Private' ShowAll
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Memory usage monitoring for process

Post by kalyanpabolu »

Hello,

PFA the complete screenshot for your reference. If you compare the output with the screenshot value, we can see 10 MB difference.
[root@monprdmgtss03 plugins]# ./check_process_memory.sh -H 10.50.10.51 -p 12489 -P JavaService -w 1000 -c 5000
WARNING: Used Memory of JavaService: 1769 MB|UsedMemory=1769;1000;5000;;
[root@monprdmgtss03 plugins]#


Also, I tried all below commands.

[root@monprdmgtss03 plugins]# ./check_nrpe -H 10.50.10.51 -p 5666 -t 60 -c CheckCounter -a 'Counter:JavaService=\Process(JavaService)\Working Set- Private' ShowAll
CRIT: Counter not found: \Process(JavaService)\Working Set- Private: The specified counter could not be found. (C0000BB9)
[root@monprdmgtss03 plugins]#


[root@monprdmgtss03 plugins]# ./check_nrpe -H 10.50.10.51 -p 5666 -t 60 -c CheckCounter -a 'Counter:JavaService=\Process(JavaService)\Private Working Set' ShowAll CRIT: Counter not found: \Process(JavaService)\Private Working Set: The specified counter could not be found. (C0000BB9)
[root@monprdmgtss03 plugins]#


[root@monprdmgtss03 plugins]# ./check_nrpe -H 10.50.10.51 -p 5666 -t 60 -c CheckCounter -a 'Counter:JavaService=\Process(JavaService)\Memory(Private Working Set)' ShowAll
CRIT: Counter not found: \Process(JavaService)\Memory(Private Working Set): The specified counter could not be found. (C0000BB9)
[root@monprdmgtss03 plugins]#

Please suggest.
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Memory usage monitoring for process

Post by ssax »

You were really close (you were missing a space before the dash, there is a space before and after the dash), try this one:

Code: Select all

./check_nrpe -H 10.50.10.51 -p 5666 -t 60 -c CheckCounter -a 'Counter:JavaService=\Process(JavaService)\Working Set - Private' ShowAll
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Memory usage monitoring for process

Post by kalyanpabolu »

Hello,

Thanks a lot!!
it is working fine now.

[root@monprdmgtss03 plugins]# ./check_process_memory.sh -H 10.50.10.51 -p 12489 -P JavaService -w 1000 -c 5000
WARNING: Used Memory of JavaService: 1855 MB|UsedMemory=1855;1000;5000;;
[root@monprdmgtss03 plugins]#

Could you please help me with command and service definition here.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Memory usage monitoring for process

Post by ssax »

Put the plugin in /usr/local/nagios/libexec and do this:

Code: Select all

chown apache.nagios /usr/local/nagios/libexec/check_process_memory.sh
chmod ug+x /usr/local/nagios/libexec/check_process_memory.sh
Command Name: check_process_memory
Command Line:

Code: Select all

$USER1$/check_process_memory.sh -H $HOSTADDRESS$ -p 12489 -P '$ARG1$' $ARG2$
On your service:

Check Command: check_process_memory
$ARG1$: JavaService
$ARG2$: -w 1000 -c 5000

See here for any questions:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Memory usage monitoring for process

Post by kalyanpabolu »

Hello,

Thank you for your support!!
We are good to close the ticket.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Memory usage monitoring for process

Post by scottwilkerson »

kalyanpabolu wrote:Hello,

Thank you for your support!!
We are good to close the ticket.
Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked