[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.
sh.shekhar89
Posts: 52
Joined: Fri Oct 10, 2014 3:17 pm

[Help] check_process_memory.sh configuration

Post 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 ??
Attachments
Error
Error
check_process_memory.sh
Plugin
(2.28 KiB) Downloaded 424 times
sh.shekhar89
Posts: 52
Joined: Fri Oct 10, 2014 3:17 pm

Re: [Help] check_process_memory.sh configuration

Post by sh.shekhar89 »

Can any one help me on this?? :cry:
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: [Help] check_process_memory.sh configuration

Post 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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sh.shekhar89
Posts: 52
Joined: Fri Oct 10, 2014 3:17 pm

Re: [Help] check_process_memory.sh configuration

Post by sh.shekhar89 »

Hi abrist,

How i can fix this issue and can configure?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: [Help] check_process_memory.sh configuration

Post 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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sh.shekhar89
Posts: 52
Joined: Fri Oct 10, 2014 3:17 pm

Re: [Help] check_process_memory.sh configuration

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: [Help] check_process_memory.sh configuration

Post 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:

Code: Select all

nmap 192.168.160.129 -p 12489
Also, make sure the nsclient service is running on the remote host.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sh.shekhar89
Posts: 52
Joined: Fri Oct 10, 2014 3:17 pm

Re: [Help] check_process_memory.sh configuration

Post 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:

Code: Select all

nmap 192.168.160.129 -p 12489
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]#
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: [Help] check_process_memory.sh configuration

Post 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"
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sh.shekhar89
Posts: 52
Joined: Fri Oct 10, 2014 3:17 pm

Re: [Help] check_process_memory.sh configuration

Post 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]#
Locked