Page 1 of 4

check_ms_win_disk_load error?

Posted: Mon Sep 21, 2015 1:41 pm
by hk44765
Hello,

I'm new to Nagios and attempting to use check_ms_win_disk_load script. However, I get the following error:

[root@vnlpnagios01 libexec]# ./check_nrpe -H hnwtcompu01 -t 60 -c check_ms_netstat
Missing expression after unary operator '-'.
At line:1 char:2
+ - <<<<
+ CategoryInfo : ParserError: (-:String) [], ParentContainsErrorR
ecordException
+ FullyQualifiedErrorId : MissingExpressionAfterOperator
[root@vnlpnagios01 libexec]#

Any clue?

Re: check_ms_win_disk_load error?

Posted: Mon Sep 21, 2015 2:30 pm
by hsmith
For some clarity here, which plugin are you trying to use?

The topic says check_ms_win_disk_load, and your command output says check_ms_netstat.

I just want to make sure we're on the same page for troubleshooting.

Re: check_ms_win_disk_load error?

Posted: Mon Sep 21, 2015 2:35 pm
by hk44765
Here is the link to the plugin I wish to leverage:

http://outsideit.net/check-ms-win-disk-load/

I changed updated the nsc.ini file with following:

check_ms_netstat=cmd /c echo scripts/check_ms_win_disk_load.ps1 $ARG1$; exit LastExitCode | powershell.exe -command –

check_ms_netstat is what I'm calling to evoke check_ms_win_disk_load.ps1 command:

Hiram

Re: check_ms_win_disk_load error?

Posted: Mon Sep 21, 2015 3:39 pm
by WillemDH
aha you say nsc.ini => This would imply you are using an older version of NSCLient. Could you please
1) try upgrading to 0.4.1.105
2) There was an error in my documentation (I repaired it) You need to make a command like this:

Code: Select all

check_ms_win_disk_load=cmd /c echo scripts/check_ms_win_disk_load.ps1 $ARG1$; exit LastExitCode | powershell.exe -command –
and refer to it like this:

Code: Select all

./check_nrpe -H hnwtcompu01 -t 60 -c check_ms_win_disk_load -a '-H localhost'
As you need to provide at least one argument...

Let us know if it helps.

Grtz

Willem

Re: check_ms_win_disk_load error?

Posted: Mon Sep 21, 2015 3:42 pm
by hsmith
Thank you for popping in and supporting this, Willem! :mrgreen:

Re: check_ms_win_disk_load error?

Posted: Mon Sep 21, 2015 3:47 pm
by hk44765
Ok...I'll try to upgrade nsclient as i'm running 0.3.9.328.

I'll report back results shortly.

Re: check_ms_win_disk_load error?

Posted: Mon Sep 21, 2015 3:59 pm
by WillemDH
Download 0.4.1.105. Later versions have other problems.

Re: check_ms_win_disk_load error?

Posted: Mon Sep 21, 2015 4:06 pm
by hk44765
I updated client as suggested and made change to nsc.ini file.

Getting a different error:

[root@vnlpnagios01 libexec]# ./check_nrpe -H hnwtcompu01 -t 60 -c check_ms_win_disk_load -a '-H localhost'
No handler for command: check_ms_win_disk_load

My syntax in the ini file is:

check_ms_win_disk_load=cmd /c echo scripts/check_ms_win_disk_load.ps1 $ARG1$; exit LastExitCode | powershell.exe -command –

File in scripts folder is named check_ms_win_disk_load.ps1.

Re: check_ms_win_disk_load error?

Posted: Tue Sep 22, 2015 1:39 am
by WillemDH
Did you restart nscp service after editing the nsclient.ini?

Re: check_ms_win_disk_load error?

Posted: Tue Sep 22, 2015 2:25 am
by hk44765
Yes. Restarted and troubleshoot with running cmd window open. While executing command via nagios server. Either my syntax is not correct or something wrong with my setup?