[Help] check_process_memory.sh configuration

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: [Help] check_process_memory.sh configuration

Post by sreinhardt »

Did you have a user logged into Windows at that time? It looks like the query went correctly, but you may not have had explorer running as it was not consuming any memory. We should be able to check the nscp.exe binary like you initially posted with:

Code: Select all

./check_nt -H 192.168.160.129 -p 12489 -v COUNTER -l "\\Process(nscp.exe)\\Working Set"
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
sh.shekhar89
Posts: 52
Joined: Fri Oct 10, 2014 3:17 pm

Re: [Help] check_process_memory.sh configuration

Post by sh.shekhar89 »

sreinhardt wrote:Did you have a user logged into Windows at that time? It looks like the query went correctly, but you may not have had explorer running as it was not consuming any memory. We should be able to check the nscp.exe binary like you initially posted with:

Code: Select all

./check_nt -H 192.168.160.129 -p 12489 -v COUNTER -l "\\Process(nscp.exe)\\Working Set"

Hi sreinhardt,

i got the same output :
" [root@nagios libexec]# ./check_nt -H 192.168.160.129 -p 12489 -v COUNTER -l "\\Process(nscp.exe)\\Working Set"
0
[root@nagios libexec]# "

And users have logged into windows.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: [Help] check_process_memory.sh configuration

Post by lmiltchev »

Open the Performance Monitor, right-click on the perf counter and see what is the "exact" name under the "Data" tab. Most probably, you will need to run:

Code: Select all

./check_nt -H 192.168.160.129 -p 12489 -v COUNTER -l "\\Process(explorer)\\Working Set"
instead of

Code: Select all

./check_nt -H 192.168.160.129 -p 12489 -v COUNTER -l "\\Process(explorer.exe)\\Working Set"
Example:

Code: Select all

[root@testbox libexec]# ./check_nt -H 192.168.x.x -s password -p 12489 -v COUNTER -l "\\Process(explorer)\\Working Set"
99512300
[root@testbox libexec]# ./check_nt -H 192.168.x.x -s password -p 12489 -v COUNTER -l "\\Process(firefox)\\Working Set"
754577000
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
Pitone_Maledetto
Posts: 69
Joined: Fri Jul 01, 2016 4:11 am
Location: Liverpool, United Kingdom

Re: [Help] check_process_memory.sh configuration

Post by Pitone_Maledetto »

Hi all,
I know this thread is very old but my comment could help someone now.

The error is encountered because in the plugin script the default check_nt port is set to 1248 instead of 12489.
That means that if you don't specify the port number with -p then it defaults to the wrong one and you get a "Connection refused" therefore the rest of the script will fail.

Moreover bc does not support -r switch anymore so take it out.

Regards
"It is impossible to work in information technology without also engaging in social engineering"
Jaron Lanier
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: [Help] check_process_memory.sh configuration

Post by lmiltchev »

Thanks for the feedback, Pitone_Maledetto!

@sh.shekhar89 it's been almost 3 years since your last post, so I am going to lock this topic. If you have any more issues, please start a new thread. If you want to reopen the existing thread, PM me or anyone on the Nagios support forum. We will unlock it for you. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked