The idea is to monitor Hyper-V failover disks.
From the commandline on the host I get this line working:
Code: Select all
PS C:\Program Files\NSClient++\scripts> .\check_csv_freespace.ps1 -n ZWEB_CSV01 -w 80 -c 90
OK - ZWEB_CSV01 total: 240GB, used: 81GB (33%), free: 159GB (66%) | 'ZWEB_CSV01 used_space'=81Gb;192;216;0;240The ncp.ini puzzles me. Is that the same as the nsclient.ini?
I assumed it is, so I went ahead and made these changes to it.
Code: Select all
[/settings/external scripts/wrappings]
bat = scripts\\%SCRIPT% %ARGS%
ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -
command[check_csv_freespace]=cmd /c echo .check_csv_freespace.ps1 -n $ARG1$ -w $ARG2$ -c $ARG3$ | powershell.exe -command -
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\wrapper.vbs %SCRIPT% %ARGS%
[/settings/external scripts/wrapped scripts]
check_files = check_files.vbs $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$ $ARG9$ $ARG10$ $ARG11$ $ARG12$ $ARG13$ $ARG14$
check_nbu_backup = check_nbu_backstat2.ps1 $ARG1$
check_csv = check_csv.ps1
check_csv_freespace = check_csv_freespace.ps1
[/settings/external scripts/alias]
alias_updates = check_csv -warning 80 -critical 75
[/settings/external scripts]
allow arguments = 1
allow nasty characters = 1
allow nasty_meta_chars = 1
timeout = 60
Code: Select all
define command {
command_name check_csv_freespace
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_csv_freespace -a $ARG1$
}Code: Select all
define service {
host_name hyper14
service_description check Cluster Shared Volume Freespace
check_command check_csv_freespace!ZWEB_CSV01 80 90
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
first_notification_delay 0
notification_period standbyuren
notification_options n
notifications_enabled 0
contacts Team 1
register 1
}
Code: Select all
C:\Program Files\NSClient++\scripts\check_csv_freespace.ps1 : Cannot process
command because of one or more missing mandatory parameters: csvname warnlevel
critlevel.
At line:1 char:1
+ scripts\\\\check_csv_freespace.ps1 ; exit($lastexitcode)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [check_csv_freespace.ps1],
ParameterBindingException
+ FullyQualifiedErrorId : MissingMandatoryParameter,check_csv_freespace.ps1
Must have been staring at it too long, as I fail to see where..
some technotes:
Host is a Windows 2012 64 bit server with Powershell version 4.0 in a Hyper-V cluster
Nagios Xi server is 2012R2.5
I've been using Xi to create and edit commands.
Any thoughts?