项目作者: slauger

项目描述 :
A Nagios Plugin that emulates a full login process into Citrix Gateway (formerly Citrix NetScaler Gateway) and Storefront.
高级语言: Perl
项目地址: git://github.com/slauger/check_netscaler_gateway.git
创建时间: 2017-02-20T21:32:18Z
项目社区:https://github.com/slauger/check_netscaler_gateway

开源协议:Apache License 2.0

下载


check_netscaler_gateway Nagios Plugin

This is a Nagios monitoring plugin for the Citrix NetScaler Gateway. The plugin emulates a full login proccess on a NetScaler Gateway vServer and checks if there are any resources available.

  1. -bash# ./check_netscaler_gateway.pl -H citrix.example.com -u monitoring -p password -S Lab -v
  2. ** POST https://citrix.example.com/cgi/login ==> 302 Object Moved
  3. ** POST https://citrix.example.com/cgi/setclient?wica ==> 200 OK
  4. ** POST https://citrix.example.com/Citrix/LabWeb/Home/Configuration ==> 200 OK
  5. ** POST https://citrix.example.com/Citrix/LabWeb/Authentication/GetAuthMethods ==> 200 OK
  6. ** POST https://citrix.example.com/Citrix/LabWeb/GatewayAuth/Login ==> 200 OK
  7. ** POST https://citrix.example.com/Citrix/LabWeb/Resources/List ==> 200 OK
  8. ** GET https://citrix.example.com/cgi/logout ==> 200 OK
  9. NetScaler Gateway OK - Admin Desktop; CAD Desktop; Calculator; HDX Desktop; HDX TS Desktop; Server 2016 Desktop; Windows 8 Desktop; XA 2012 Desktop;

Install

Run the following commands to install all Perl dependencies (Monitoring::Plugin, LWP, JSON, HTTP::Cookies, Data::Dumper).

Enterprise Linux (CentOS, RedHat)

  1. yum install perl-libwww-perl perl-JSON perl-LWP-Protocol-https perl-Monitoring-Plugin perl-HTTP-Cookies perl-Data-Dumper

Debian and Ubuntu Linux

  1. apt-get install libwww-perl liblwp-protocol-https-perl libjson-perl libmonitoring-plugin-perl

Mac OS X

The preinstalled Perl distribution is missing the JSON and Monitoring::Plugin libaries. The best way is to install them is trough the cpanminus tool. The cpanminus tool can be installed trough brew.

  1. brew install cpanminus

Use the following commands to install the missing perl libaries.

  1. sudo cpanm JSON
  2. sudo cpanm Monitoring::Plugin

Usage

  1. Usage: check_netscaler_gateway -H <hostname> [ -u <username> ] [ -p <password> ] -S <store>
  2. [-w <warning>] [-c <critical>] [ -v|--verbose ] [ -d|--debug ] [ -t <timeout> ]
  3. -?, --usage
  4. Print usage information
  5. -h, --help
  6. Print detailed help screen
  7. -V, --version
  8. Print version information
  9. --extra-opts=[section][@file]
  10. Read options from an ini file. See https://www.monitoring-plugins.org/doc/extra-opts.html
  11. for usage and examples.
  12. -H, --hostname=STRING
  13. Hostname of the NetScaler appliance to connect to
  14. -u, --username=STRING
  15. Username to log into box as
  16. -p, --password=STRING
  17. Password for login username
  18. -S, --store=STRING
  19. Name of the Store in Storefront (default: Store)
  20. -w, --warning=INTEGER
  21. Warning threshold for the numbers of found applications
  22. -c, --critical=INTEGER
  23. Critical threshold for the numbers of found applications
  24. -d, --debug
  25. Debug mode, print out every single HTTP request
  26. -t, --timeout=INTEGER
  27. Seconds before plugin times out (default: 15)
  28. -v, --verbose
  29. Show details for command-line debugging (can repeat up to 3 times)

Configuration File

The plugin uses the Monitoring::Plugin Libary, so you can use —extra-opts and seperate the login crendetials from your nagios configuration.

  1. define command {
  2. command_name check_netscaler_gateway
  3. command_line $USER5$/3rdparty/check_netscaler_gateway/check_netscaler_gateway.pl -H $HOSTADDRESS$ --extra-opts=netscaler@$USER11$/plugins.ini -S $ARG1$
  4. }
  1. [netscaler]
  2. username=nagios
  3. password=password

Authors

Contributors

Changelog

See CHANGELOG