check_xendesktop_available_machines

check_xendesktop_available_machines

Powershell Script to check how many machines are available in a Citrix XenDesktop Desktopgroup with Icinga/Nagios + NRPE/NSClient++
The script has to be executed on the server which is running XenDesktop Brokerservice.

Usage

ARGUMENTS

  1. Name of the Desktopgroup which should be checked
  2. warning value
  3. critical value

NRPE Handler Command to use with NSClient++


command[check_xendesktop_available_machines]=cmd /c echo scripts\check_xendesktop_available_machines.ps1 "$ARG1$" "$ARG2$" "$ARG3$"; exit($lastexitcode) | powershell.exe -command -

Nagios/Icinga Command


define command {
        command_name                    check_xendesktop_available_machines
        command_line                    $USER1$/check_nrpe -t 175 -H $HOSTADDRESS$ -p 5666 -c check_xendesktop_available_machines -a $ARG1$ $ARG2$ $ARG3$
        register                        1
}