Page 1 of 2
check_ms_windows_disk_load
Posted: Mon Jun 01, 2015 1:43 pm
by JohnFLi
I am trying to run a plugin
https://exchange.nagios.org/directory/P ... ad/details
and I am not having any luck. I am getting (No output on stdout) stderr:
When I run the powershell file manually on the windows box, it works.
When I try to run it from teh command line on the Nagios box, it doesn't seem to be doing anything.
becasue it's using a powershell script, I tried
https://assets.nagios.com/downloads/nag ... ios-XI.pdf (becuause its using the same process)
I get the same results with that also. "(No output on stdout) stderr:"
And from the nagios machine, it doesn't seem to do anything.
Code: Select all
[root@G1VPNAG03 libexec]# ./check_nrpe -H G1VPSAJAM01 -t 120 -p 5666 -c check_updates
[root@G1VPNAG03 libexec]#
I did the Set-ExecutionPolicy Unrestricted, and that is fine
The NSClient i am using is 0.4.1.105
any ideas?
Re: check_ms_windows_disk_load
Posted: Mon Jun 01, 2015 1:56 pm
by jolson
Please post your nsclient.ini file. A test you could perform is as follows.
open an administrative command prompt, and enter the following:
Code: Select all
net stop nscp
cd C:\Program Files\NSClient++
nscp.exe test
This will start the 'test' mode of NSClient - with this running in your command prompt, attempt to run your check from Nagios once more. Is there an error that is thrown?
Re: check_ms_windows_disk_load
Posted: Mon Jun 01, 2015 1:59 pm
by JohnFLi
while poking around..... I found somethign ODD
I went to /usr/local/nagios/libexec
it is listed as a 'plain text document' and has 0 bytes.
That just may be a problem.
Re: check_ms_windows_disk_load
Posted: Mon Jun 01, 2015 2:38 pm
by jolson
If you run the 'file' command on the nagios directory, what does it tell you?
I agree that it's extremely odd. Let us know what you find out.
Re: check_ms_windows_disk_load
Posted: Mon Jun 01, 2015 3:29 pm
by JohnFLi
i ran
copied check_nrpe from /usr/lib64/nagios/plugins to /usr/local/nagios/libexec and it seems to be working
Re: check_ms_windows_disk_load
Posted: Mon Jun 01, 2015 3:41 pm
by JohnFLi
well, I got nrpe working for the windows updates, but I still cant get it to work for check_ms_windows_disk_load
It works on the windows machine, but not from CLI on the nagios box.
Re: check_ms_windows_disk_load
Posted: Mon Jun 01, 2015 3:50 pm
by lmiltchev
Show us the actual command run from the command line along with the output of it. Also, post the "check_ms_windows_disk_load" command definition in the nsclient.ini file.
Re: check_ms_windows_disk_load
Posted: Mon Jun 01, 2015 4:32 pm
by JohnFLi
nsclient.ini
Code: Select all
; NRPE server - A simple server that listens for incoming NRPE connection and handles them.
NRPEServer = 1
...........
[/settings/external scripts/scripts]
check_ms_diskload=cmd /c echo C:\scripts\check_ms_windows_disk_load.ps1 $ARG1$; exit LastExitCode | powershell.exe -command –
output from command line:
Code: Select all
[root@G1VPNAG03 libexec]# ./check_nrpe -H G1VPSAJAM01 -t 60 -c check_ms_diskload
Missing expression after unary operator '-'.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordEx
ception
+ FullyQualifiedErrorId : MissingExpressionAfterOperator
[root@G1VPNAG03 libexec]#
The way the command in XI is set:
diskload1.jpg
Re: check_ms_windows_disk_load
Posted: Mon Jun 01, 2015 4:56 pm
by jolson
Please enter test mode and attempt to run the command from NSClient. Open an administrative command prompt:
Code: Select all
net stop nscp
cd C:\Program Files\NSClient++
nscp.exe test
After the 'test' prompt opens, type your command name into it and press Enter.
Does this return the desired result? If so, try running the check from your Nagios server as well. Any errors on the NSClient side of things?
What if you remove $ARG1$ from your command definition and replace it with exactly what you intend to run?
Re: check_ms_windows_disk_load
Posted: Mon Jun 01, 2015 5:18 pm
by JohnFLi
ok, here is what it says in test mode:
Code: Select all
d rvice\NSClient++.cpp:616 NSClient++ - 0,4,1,105 2014-04-28 Started!
l ce\simple_client.hpp:32 Enter command to inject or exit to terminate...
check_ms_diskload
d rvice\NSClient++.cpp:960 Injecting: check_ms_diskload...
d kExternalScripts.cpp:249 Command line: cmd /c echo C:\scripts\check_ms_window
s_disk_load.ps1 $ARG1$; exit LastExitCode | powershell.exe -command
As you can see....it did nothing.
I tried it with, and without $ARG1$
when I do try to add an argument in service managment, it says nor arguments allowed
diskload3.jpg
when I leave it as the documentation says
diskload4.jpg
in the NSCLient log, i all see is
Code: Select all
2015-06-01 16:16:15: e:c:\build\nscp\include\socket/server.hpp:212: Socket ERROR: The I/O operation has been aborted because of either a thread exit or an application request