Monitor Cluster shared volumes
Posted: Tue Jun 14, 2016 11:03 am
Hello,
I have an already set-up Nagios Core that uses this script in order to monitor some Hyper-v Cluster shared volumes
https://exchange.nagios.org/directory/P ... 1442825460
I noticed though that the code is a little bit changed and the warning and critical values are static inside the code and not passing through as an argument:
So I tried to change that and uncomented the above lines in order to pass them through from my nagios service definition.
Here is my service definition:
Command Definition:
and nscient.ini
and Nagios returns this:
I have tried many different ways to pass my arguments (with and without quotes, with and without spaces...)and all result in some kind of Argument passing error.
Any help would be greatly apreciated.
Thanks
Anna
I have an already set-up Nagios Core that uses this script in order to monitor some Hyper-v Cluster shared volumes
https://exchange.nagios.org/directory/P ... 1442825460
I noticed though that the code is a little bit changed and the warning and critical values are static inside the code and not passing through as an argument:
Code: Select all
Param(
[parameter(Mandatory=$true)]
[alias("n")]
$csvname)
#[parameter(Mandatory=$true)]
#[alias("w")]
#$warnlevel,
#[parameter(Mandatory=$true)]
#[alias("c")]
#$critlevel)
#$csvname="Cluster Storage 4"
$warnlevel=80
$critlevel=90Here is my service definition:
Code: Select all
define service
{use generic-service,graphed-service
service_description Cluster: Volume 3 free disk space
check_command check_hyperv_csv_freespaceTest!Cluster Storage 4!90!95}
Code: Select all
define command {
command_name check_hyperv_csv_freespaceTest
command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c check_hyperv_csv_freespace -a "$ARG1$" "$ARG2$" "$ARG3$"
} Code: Select all
check_hyperv_csv_freespace=cmd /c echo scripts\mine.ps1 -n "$ARG1$" -w "$ARG2$" -c "$ARG3$"; exit($lastexitcode) | powershell.exe -command -Code: Select all
Status Information: scriptsmine.ps1 -n ARG1$ -w "90 -c "95": exit($lastexitcode)
Performance Data: 'powershell.exe'=0 '-command'=0 '-'=0Any help would be greatly apreciated.
Thanks
Anna