Page 1 of 3

Need Help in Configuring Process Memory Usage

Posted: Wed Mar 02, 2016 10:32 am
by CloudOps
Hi All,

I am trying to configure process memory usage on windows but getting bellow errro :

Plugin : https://exchange.nagios.org/directory/P ... ng/details

[root@VM-NAGIOSXI-TEST libexec]# ./check_process_memory.sh -H 172.26.2.12 -p 1248 -P java.exe -w 85 -c 90
(standard_in) 1: illegal character: R
(standard_in) 1: illegal character: I
(standard_in) 1: illegal character: T
(standard_in) 1: illegal character: I
(standard_in) 1: syntax error
(standard_in) 1: illegal character: L
(standard_in) 1: illegal character: S
(standard_in) 1: syntax error
./check_process_memory.sh: line 67: [: -ge: unary operator expected
./check_process_memory.sh: line 71: [: -ge: unary operator expected
OK: Used Memory of java.exe: MB|UsedMemory=;85;90;;
[root@VM-NAGIOSXI-TEST libexec]#


Can any one tell what i am missing? is there any other way to monitor memory or CPU usage of single process?

Re: Need Help in Configuring Process Memory Usage

Posted: Wed Mar 02, 2016 3:19 pm
by rkennedy
What is the result if you run the command using check_nt? It looks like this script is just parsing the data that check_nt would produce.

Re: Need Help in Configuring Process Memory Usage

Posted: Thu Mar 03, 2016 9:01 am
by CloudOps
rkennedy wrote:What is the result if you run the command using check_nt? It looks like this script is just parsing the data that check_nt would produce.
Hi Kennedy, Can you tell me command to run it??

Re: Need Help in Configuring Process Memory Usage

Posted: Thu Mar 03, 2016 10:29 am
by CloudOps
Hello Kennedy,

i am able to get information using checkcounter, i want to set critical and warning alerts for this counter, can you guide me on this??

For CPU

[root@VM-NAGIOSXI-TEST libexec]# ./check_nrpe -H 172.26.2.13 -c CheckCounter -a "Counter:oracel_CPU_Usage_in%=\\Process(oracle)\\% Processor Time" ShowAll
OK: oracel_CPU_Usage_in%: 0|'oracel_CPU_Usage_in%'=0


For Memory :

[root@VM-NAGIOSXI-TEST libexec]# ./check_nrpe -H 172.26.2.13 -c CheckCounter -a "Counter:oracle_Memory_Usage_inBytes=\\Process(oracle)\\Working Set" ShowAll
OK: oracle_Memory_Usage_inBytes: 1.42291e+009|'oracle_Memory_Usage_inBytes'=1422909440


Also for memory can we get the output in MB? currently its giving output in bytes. Please help me on this.

Re: Need Help in Configuring Process Memory Usage

Posted: Thu Mar 03, 2016 5:52 pm
by lmiltchev
Can you open the "Performance Monitor", right-click on both counters, select "Properties", and show us a screenshot of the window?

Re: Need Help in Configuring Process Memory Usage

Posted: Thu Mar 03, 2016 5:57 pm
by jolson
i want to set critical and warning alerts for this counter, can you guide me on this??
You can set them in your check command itself - see this documentation: http://docs.nsclient.org/reference/Chec ... eckcounter

Re: Need Help in Configuring Process Memory Usage

Posted: Thu Mar 03, 2016 6:00 pm
by Box293
This KB article shows examples with warning and critical values:

https://support.nagios.com/kb/article.php?id=127
CloudOps wrote:Also for memory can we get the output in MB? currently its giving output in bytes. Please help me on this.
I don't beleive NSClient++ has a way of converting values, you would have to write a wrapper script to do that.

Re: Need Help in Configuring Process Memory Usage

Posted: Mon Mar 14, 2016 4:49 pm
by CloudOps
jolson wrote:
i want to set critical and warning alerts for this counter, can you guide me on this??
You can set them in your check command itself - see this documentation: http://docs.nsclient.org/reference/Chec ... eckcounter

Hello Jolson,

I tried but not succeeded. Can you give me some example?? for process CPU usage also,can we use same check counters with critical and warning?? Please give me some example for understanding.

Thanks,
Shailesh

Re: Need Help in Configuring Process Memory Usage

Posted: Tue Mar 15, 2016 9:55 am
by rkennedy
Can you show us what you attempted to do that didn't work so we can go from there?

Re: Need Help in Configuring Process Memory Usage

Posted: Tue Mar 15, 2016 10:21 am
by CloudOps
rkennedy wrote:Can you show us what you attempted to do that didn't work so we can go from there?
Hi rkennedy,

I tried this but giving value as critical

CRITICAL: oracle_Memory_Usage_inBytes: 1.47789e+009 > critical|'oracle_Memory_Usage_inBytes'=1477894144;80;90
[root@VM-NAGIOSXI-TEST libexec]# ./check_nrpe -H 172.26.2.13 -c CheckCounter -a "Counter:oracle_Memory_Usage_inBytes=\\Process(oracle)\\Working Set" ShowAll MaxWarn=80 MaxCrit=90
CRITICAL: oracle_Memory_Usage_inBytes: 1.47449e+009 > critical|'oracle_Memory_Usage_inBytes'=1474490368;80;90
[root@VM-NAGIOSXI-TEST libexec]#


Also the output which i am getting is different. both are different values[ Screenshot attached]

I have added also tried to get Output in MB But its not giving :

[root@VM-NAGIOSXI-TEST libexec]# ./check_nrpe -H 172.26.2.13 -c CheckCounter -a "Counter:oracle_Memory_Usage_inMBytes=\\Process(oracle)\\Working Set" ShowAll MaxWarn=80 MaxCrit=90
CRITICAL: oracle_Memory_Usage_inMBytes: 1.47677e+009 > critical|'oracle_Memory_Usage_inMBytes'=1476771840;80;90