Page 1 of 1

[Help] check_winproc_ram configuration

Posted: Mon Apr 20, 2015 10:50 am
by sh.shekhar89
Hello friends,

I am looking for plugin which will monitor the memory usage of a single process on windows.

I found one plugin, but i am getting some code error after running the command :

plugin : http://exchange.nagios.org/directory/Pl ... ge/details

can some one help in configuring?

Please let me if is there any other plugin that will work for my requirement??

Re: [Help] check_winproc_ram configuration

Posted: Mon Apr 20, 2015 10:52 am
by tmcdonald
Can you provide more information? What error code are you getting?

Re: [Help] check_winproc_ram configuration

Posted: Mon Apr 20, 2015 12:33 pm
by sh.shekhar89
tmcdonald wrote:Can you provide more information? What error code are you getting?
Hello tmcdonald, i am getting the below error :

[root@test libexec]# ./check_winproc_ram -H 192.168.199.1 --warning 4000 --critical -4500 -s check_svchost_exe
./check_winproc_ram: line 172: let: WERT2=*1024: syntax error: operand expected (error token is "*1024")
./check_winproc_ram: line 179: [: -ge: unary operator expected
./check_winproc_ram: line 185: [: -ge: unary operator expected
: KB - ok|'ram'=;4096000;-4608000
[root@test libexec]#
can you help me in fixig this problem.

Re: [Help] check_winproc_ram configuration

Posted: Mon Apr 20, 2015 4:50 pm
by tmcdonald
Please run the plugin like so and share the /tmp/output.txt file:

Code: Select all

bash -x ./check_winproc_ram -H 192.168.199.1 --warning 4000 --critical -4500 -s check_svchost_exe | tee /tmp/output.txt

Re: [Help] check_winproc_ram configuration

Posted: Wed Apr 22, 2015 2:51 pm
by sh.shekhar89
tmcdonald wrote:Please run the plugin like so and share the /tmp/output.txt file:

Code: Select all

bash -x ./check_winproc_ram -H 192.168.199.1 --warning 4000 --critical -4500 -s check_svchost_exe | tee /tmp/output.txt

Hello tmcdonald,
here is the output when i run the above command :

[root@test libexec]# bash -x ./check_winproc_ram -H 192.168.199.1 --warning 4000 --critical -4500 -s check_svchost_exe | tee /tmp/output.txt
+ GREP=/bin/grep
+ CUT=/usr/bin/cut
+ AWK=/usr/bin/awk
+ SED=/bin/sed
+ NRPE=/usr/local/nagios/libexec/check_nrpe
++ /bin/basename ./check_winproc_ram
+ PROGNAME=check_winproc_ram
++ /bin/sed -e 's,[\/][^\/][^\/]*$,,'
++ echo ./check_winproc_ram
+ PROGPATH=.
+ REVISION='Revision 1.0'
+ AUTHOR='(c) 2009 Guenther Orth (http://www.enbiz.de/)'
+ STATE_OK=0
+ STATE_WARNING=1
+ STATE_CRITICAL=2
+ STATE_UNKNOWN=3
+ STATE_DEPENDENT=4
+ '[' 8 -lt 1 ']'
+ thresh_warn=
+ thresh_crit=
+ externalias=
+ HOSTNAME=
+ exitstatus=1
+ test -n -H
+ case "$1" in
+ HOSTNAME=192.168.199.1
+ shift
+ shift
+ test -n --warning
+ case "$1" in
+ thresh_warn=4000
+ shift
+ shift
+ test -n --critical
+ case "$1" in
+ thresh_crit=-4500
+ shift
+ shift
+ test -n -s
+ case "$1" in
+ externalias=check_svchost_exe
+ shift
+ shift
+ test -n ''
++ /bin/grep K
++ /usr/local/nagios/libexec/check_nrpe -H 192.168.199.1 -c check_svchost_exe
+ NRPERUN=
++ /usr/bin/awk '/[ 0-9\. ]/ {print $5}'
++ /bin/sed 's/\.//2'
++ echo
+ WERT=
++ /usr/bin/cut -d ' ' -f 1
++ echo
+ SERVICENAME=
+ result=ok
+ exitstatus=0
+ let 'WERT2=*1024'
./check_winproc_ram: line 172: let: WERT2=*1024: syntax error: operand expected (error token is "*1024")
+ let 'thresh_warn_KB=4000*1024'
+ let 'thresh_crit_KB=-4500*1024'
+ '[' 4000 '!=' '' ']'
+ '[' -ge 4000 ']'
./check_winproc_ram: line 179: [: -ge: unary operator expected
+ '[' -4500 '!=' '' ']'
+ '[' -ge -4500 ']'
./check_winproc_ram: line 185: [: -ge: unary operator expected
+ echo ': KB - ok|'\''ram'\''=;4096000;-4608000'
: KB - ok|'ram'=;4096000;-4608000
+ exit 0

Re: [Help] check_winproc_ram configuration

Posted: Wed Apr 22, 2015 8:01 pm
by Box293
So the plugin is missing some error checking, it's doing stuff to variables that are empty.

Basically the NRPERUN and WERT variables are empty.

What is the output from this command:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 192.168.199.1 -c check_svchost_exe|/bin/grep K

Re: [Help] check_winproc_ram configuration

Posted: Thu Apr 23, 2015 9:43 am
by sh.shekhar89
Box293 wrote:So the plugin is missing some error checking, it's doing stuff to variables that are empty.

Basically the NRPERUN and WERT variables are empty.

What is the output from this command:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 192.168.199.1 -c check_svchost_exe|/bin/grep K

When i run the above command i did not return any output box293.

Re: [Help] check_winproc_ram configuration

Posted: Thu Apr 23, 2015 4:28 pm
by tgriep
Could you post your nsc.ini file from your Windows Host? It should be in the following folder

Code: Select all

C:\Program Files\NSClient++