Page 1 of 2
[Help] check_process_memory.sh configuration
Posted: Fri Oct 24, 2014 2:19 pm
by sh.shekhar89
Hi Friends,
I am configuring check_process_memory.sh in my nagios server.
but i am getting following error and also no out put is returned [screenshot attached] :
"
[root@nagios libexec]# ./check_process_memory.sh -H 192.168.160.129 -P nscp.exe -w 5000 -c 6000
(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 nscp.exe: MB|UsedMemory=;5000;6000;;
"
I am attaching the configuration file.
can some one tell me why i am getting this error ??
Re: [Help] check_process_memory.sh configuration
Posted: Sun Oct 26, 2014 9:59 pm
by sh.shekhar89
Can any one help me on this??

Re: [Help] check_process_memory.sh configuration
Posted: Mon Oct 27, 2014 12:44 pm
by abrist
This plugin is actually running
check_nt, which is actually a windows checking utility:
command="\\$perfcount_name($process)\\$perfcount_value"
memory=`$pluginpath/check_nt -H $hostname -p $port -v COUNTER -l "$command" | tr -d '\n'`
mb=`echo "scale=0; $memory/1024000"|bc -l`
Is there a reason why you are not just running the check directly with check_nt?
Re: [Help] check_process_memory.sh configuration
Posted: Mon Oct 27, 2014 12:51 pm
by sh.shekhar89
Hi abrist,
How i can fix this issue and can configure?
Re: [Help] check_process_memory.sh configuration
Posted: Mon Oct 27, 2014 1:12 pm
by abrist
Could you answer my previous question:
abrist wrote:Is there a reason why you are not just running the check directly with check_nt?
Also, do you have a password configured for your nsclient connection?
Re: [Help] check_process_memory.sh configuration
Posted: Mon Oct 27, 2014 1:17 pm
by sh.shekhar89
hi abrist,
I am new to nagios, i dont know the answer to your question. i was searching in google find out the solution.
And I dont have password configured to my nsclient.
Re: [Help] check_process_memory.sh configuration
Posted: Mon Oct 27, 2014 2:00 pm
by abrist
First, lets make sure that you can connect to the remote host from the nagios server using check_nt. Run the following command from the cli on the nagios server:
Code: Select all
/usr/local/nagios/libexec/check_nt -H 192.168.160.129 -p 12489 -v CLIENTVERSION
If it does not work, check your windows nsclient ini file for password=<password>, and then try running the command with the specified password (I think it defaults to 'password'):
Code: Select all
/usr/local/nagios/libexec/check_nt -H 192.168.160.129 -p 12489 -s <password> -v CLIENTVERSION
If that does not work, check to see if the port is open:
Also, make sure the nsclient service is running on the remote host.
Re: [Help] check_process_memory.sh configuration
Posted: Mon Oct 27, 2014 2:05 pm
by sh.shekhar89
abrist wrote:First, lets make sure that you can connect to the remote host from the nagios server using check_nt. Run the following command from the cli on the nagios server:
Code: Select all
/usr/local/nagios/libexec/check_nt -H 192.168.160.129 -p 12489 -v CLIENTVERSION
If it does not work, check your windows nsclient ini file for password=<password>, and then try running the command with the specified password (I think it defaults to 'password'):
Code: Select all
/usr/local/nagios/libexec/check_nt -H 192.168.160.129 -p 12489 -s <password> -v CLIENTVERSION
If that does not work, check to see if the port is open:
Also, make sure the nsclient service is running on the remote host.
When i run the command, i got the following output :
[root@nagios libexec]# ./check_nt -H 192.168.160.129 -p 12489 -v CLIENTVERSION
NSClient++ 0,4,1,73 2012-12-17
[root@nagios libexec]#
Re: [Help] check_process_memory.sh configuration
Posted: Mon Oct 27, 2014 3:59 pm
by abrist
Alright, now check against a COUNTER:
Code: Select all
./check_nt -H 192.168.160.129 -p 12489 -v COUNTER -l "\\Process(explorer.exe)\\Working Set"
Re: [Help] check_process_memory.sh configuration
Posted: Mon Oct 27, 2014 9:16 pm
by sh.shekhar89
abrist wrote:Alright, now check against a COUNTER:
Code: Select all
./check_nt -H 192.168.160.129 -p 12489 -v COUNTER -l "\\Process(explorer.exe)\\Working Set"
Hi Abrist,
When I run the above command i got o in return :
[root@nagios libexec]# ./check_nt -H 192.168.160.129 -p 12489 -v COUNTER -l "\\Process(explorer.exe)\\Working Set"
0
[root@nagios libexec]#