Skip to main content

check_netscaler_gateway

CI PyPI version Python versions License

Nagios/Icinga monitoring plugin for Citrix NetScaler Gateway. The plugin emulates a full login process on a NetScaler Gateway vServer, authenticates against StoreFront through the gateway and checks if there are any resources (published applications and desktops) available for the monitoring user.

Features

  • 🔑 Simulates a complete end-user login through the gateway, not just a TCP or HTTP check
  • 🔀 Supports both authentication flows: classic (/cgi/login) and nFactor (firmware 13.1 and later) with automatic detection
  • 📦 Lists the published resources and checks minimum thresholds (-w/-c)
  • 📊 Emits performance data (number of available resources)
  • 🐍 Pure Python with a single runtime dependency (requests), also available as standalone binaries
  • 🛠️ Debug mode prints all HTTP requests and responses with credentials masked

Quick Start

pip install check_netscaler_gateway

check_netscaler_gateway -H citrix.example.com -u monitoring -p password -S Store
NetScaler Gateway OK - Admin Desktop; CAD Desktop; Calculator; HDX Desktop; | 'resources'=4;;;0;

Usage

check_netscaler_gateway -H <hostname> -u <username> -p <password> [-S <store>]
                        [-w <warning>] [-c <critical>] [-t <timeout>]
                        [--auth-mode {auto,classic,nfactor}]
                        [--verify] [--ca-file <path>] [-v] [-d]
Option Description
-H, --hostname Hostname of the NetScaler Gateway vServer (env: NETSCALER_GATEWAY_HOST)
-u, --username Username for the login simulation (env: NETSCALER_GATEWAY_USER)
-p, --password Password for the login username (env: NETSCALER_GATEWAY_PASS)
-S, --store Name of the store in StoreFront. Auto detected from the login flow when omitted (falls back to Store)
-w, --warning Warning threshold: minimum number of expected applications
-c, --critical Critical threshold: minimum number of expected applications
-t, --timeout Request timeout in seconds (default: 15)
--auth-mode Authentication flow: auto (default), classic or nfactor
--verify Verify TLS certificates (disabled by default, like v1.x)
--ca-file Path to a CA bundle for TLS verification
-v, --verbose Print one line per HTTP request to stderr
-d, --debug Print all HTTP requests and responses to stderr (credentials masked)

Authentication flows

The plugin emulates a real browser session: it loads the login page first and sends an Origin header with the login request. Firmware builds since 13.1-63.x reject POST /cgi/login requests without an Origin header (redirect to /vpn/index.html with NSC_VPNERR=4001), which is what broke the Perl version of this plugin. Gateways using the RfWebUI theme speak the nFactor protocol instead of the classic /cgi/login flow; the plugin detects this automatically, use --auth-mode to pin a flow explicitly. Multi-factor setups (OTP, EULA, more than one factor) are not supported and are reported as UNKNOWN.

Migration from v1.x (Perl)

The command line options -H, -u, -p, -S, -w, -c, -t, -v and -d are compatible, existing Nagios and Icinga command definitions keep working after replacing check_netscaler_gateway.pl with the new binary or console script. TLS certificate verification stays disabled by default; enable it with --verify or --ca-file.

Icinga 2

See examples/icinga2/check_netscaler_gateway.conf for a CheckCommand definition.

Development

python3 -m venv .venv
source .venv/bin/activate
make install
make ci

The test suite runs against a bundled mock gateway server (Flask) that implements both authentication flows, no real NetScaler required:

python -m tests.mocks.gateway_server --port 8080 --mode nfactor

License

Licensed under the Apache License, Version 2.0.

Metadata

Release files for check-netscaler-gateway 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for check-netscaler-gateway 2.0.1
File Size Uploaded
check_netscaler_gateway-2.0.1.tar.gz 23.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for check-netscaler-gateway 2.0.1
File Interpreter ABI Platform
check_netscaler_gateway-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 44.8 kB

Release files / check_netscaler_gateway-2.0.1.tar.gz

Download URL check_netscaler_gateway-2.0.1.tar.gz
Size 23.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e92444e45e901a5d7be90171d8f2546db4e867505a0cd88acc67dc0a0a92d913
BLAKE2b-256 checksum
How to use checksums
3d855ce444e23305712be51751e5542069e49b52712a8b8bd9bd903cc5944ae4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / check_netscaler_gateway-2.0.1-py3-none-any.whl

Download URL check_netscaler_gateway-2.0.1-py3-none-any.whl
Size 21.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdca08f62816d484026446ffbb21163a013f8fe9ee65160a64cf838cb0b6d5ee
BLAKE2b-256 checksum
How to use checksums
244793a80ec90b156bb6db2180182998478b3540111c1a70c6ed60ce0db274d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page