Monitoring Windows Disk Load issue
Posted: Thu Nov 30, 2017 6:10 am
Hello all:
I'm having issues trying to configure this script "Monitoring Windows Disk Load" i have founded here: http://exchange.nagios.org/directory/Pl ... ad/details
thanks!
I'm having issues trying to configure this script "Monitoring Windows Disk Load" i have founded here: http://exchange.nagios.org/directory/Pl ... ad/details
i have created edited the nsclient++ file and restarted the service... here is where the output:Put the script in the NSClient++ scripts folder, preferably in a subfolder Powershell.
In the nsclient.ini configuration file, define the script like this:
check_ms_win_disk_load = cmd /c echo scripts\powershell\check_ms_win_disk_load.ps1 $ARG1$; exit $LastExitCode | powershell.exe /noprofile -command -
Make a command in Nagios like this:
check_ms_win_disk_load => $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -t 60 -c check_ms_win_disk_load $ARG1$
Configure your service in Nagios. Make use of the above created command. Configure something similar like this as $ARG1$:
-a '-dl C -ms 5 -rqw 20 -rqc 50'
when i run the script with PowerShell on the windows Machine, it works:; A list of scripts available to run from the CheckExternalScripts module. Syntax is: <command>=<script> <arguments>
[/settings/external scripts/scripts]
check_ms_win_disk_load = cmd /c echo scripts\powershell\check_ms_win_disk_load.ps1 $ARG1$; exit $LastExitCode | powershell.exe /noprofile -command -
; A list of wrapped scripts (ie. scruts using a template mechanism). The template used will be defined by the extension of the script.
[/settings/external scripts/wrapped scripts]
check_ms_win_disk_load = check_ms_win_disk_load
I have also added the command and service in NagiosPS C:\Program Files\NSClient++\scripts\PowerShell> .\check_ms_win_disk_load.ps1
OK: Drive C: Avg of 2 samples: {Rate (Read: 0.00000MB/s)(Write: 0.08783MB/s)} {Avg Nr of (Reads: 0.00000r/s)(Writes: 3.99644w/s)} {Latency (Read: 0.00000ms)(Write: 0.51248ms)} {Queue Length (Read: 0.00000ql)(Write: 0.00204ql)} | 'Read_Latency'=0.00000ms 'Write_Latency'=0.51248ms 'Read_Queue'=0.00000ql 'Write_Queue'=0.00204ql 'Number_of_Reads'=0.00000r/s 'Number_of_Writes'=3.99644w/s 'Read_Rate'=0.00000MB/s 'Write_Rate'=0.08783MB/s
But when i run the command from Nagios or Command line, i have no outputcheck_ms_win_disk_load => $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -t 60 -c check_ms_win_disk_load $ARG1$ $ARG2$
NsClient log on the windows machine only shows the following output[root@nagios libexec]# ./check_nrpe -H 172.X.X.X -p 5666 -t 60 -c check_ms_win_disk_load -dl C -ms 5 -rqw 20 -rqc 50
[root@nagios libexec]#
Can anyone please assist?2017-11-30 08:04:01: error:c:\source\master\modules\CheckExternalScripts\CheckExternalScripts.cpp:541: Failed to find wrapping for type: none
thanks!