check_ms_windows_disk_load

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
JohnFLi
Posts: 559
Joined: Mon Jun 17, 2013 3:11 pm

check_ms_windows_disk_load

Post 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?
Everybody is somebody else’s weirdo
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: check_ms_windows_disk_load

Post 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?
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
User avatar
JohnFLi
Posts: 559
Joined: Mon Jun 17, 2013 3:11 pm

Re: check_ms_windows_disk_load

Post 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.
Everybody is somebody else’s weirdo
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: check_ms_windows_disk_load

Post by jolson »

If you run the 'file' command on the nagios directory, what does it tell you?

Code: Select all

file /usr/local/nagios
I agree that it's extremely odd. Let us know what you find out.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
User avatar
JohnFLi
Posts: 559
Joined: Mon Jun 17, 2013 3:11 pm

Re: check_ms_windows_disk_load

Post by JohnFLi »

i ran

Code: Select all

yum install check_nrpe
copied check_nrpe from /usr/lib64/nagios/plugins to /usr/local/nagios/libexec and it seems to be working
Everybody is somebody else’s weirdo
User avatar
JohnFLi
Posts: 559
Joined: Mon Jun 17, 2013 3:11 pm

Re: check_ms_windows_disk_load

Post 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.
Everybody is somebody else’s weirdo
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_ms_windows_disk_load

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
JohnFLi
Posts: 559
Joined: Mon Jun 17, 2013 3:11 pm

Re: check_ms_windows_disk_load

Post 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
You do not have the required permissions to view the files attached to this post.
Everybody is somebody else’s weirdo
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: check_ms_windows_disk_load

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

Code: Select all

check_ms_diskload
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?
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
User avatar
JohnFLi
Posts: 559
Joined: Mon Jun 17, 2013 3:11 pm

Re: check_ms_windows_disk_load

Post 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
You do not have the required permissions to view the files attached to this post.
Everybody is somebody else’s weirdo
Locked