Nagios/Icinga monitoring plugin for Citrix NetScaler ADC using NITRO REST API
Project description
check_netscaler
Nagios/Icinga monitoring plugin for Citrix NetScaler (ADC) using the NITRO REST API.
Version 2.0 - Python Rewrite
This is a complete Python rewrite of check_netscaler. All 16 check commands are implemented with comprehensive test coverage and full CI/CD integration.
Looking for the stable Perl version (v1.x)? See tags < 2.0.0 for the legacy Perl implementation.
Breaking Changes from v1.x
- HTTPS is now default - Use
--no-sslfor HTTP instead of-sfor HTTPS - Environment variable support added:
NETSCALER_HOST,NETSCALER_USER,NETSCALER_PASS
Features
Monitor your NetScaler without SNMP:
- Virtual Servers - Load balancer, VPN, GSLB, Content Switching, AAA
- Services & Service Groups - State and member quorum monitoring
- SSL Certificates - Expiration warnings
- High Availability - HA status and sync monitoring
- System Resources - CPU, memory, disk usage thresholds
- Network Interfaces - Interface status and statistics
- License Management - License expiration tracking
- NTP Synchronization - Time sync validation
- Configuration - Unsaved config detection
- Performance Data - Generic metric collection for any NITRO object
Advanced Features
- Regex-based filtering (
--filter/--limit) - Custom performance data labels
- Flexible threshold formats
- Multiple Python versions supported (3.8-3.12)
Requirements
Python >= 3.8
requests >= 2.31.0
Installation
From PyPI (Recommended)
pip install check_netscaler
From Source
git clone https://github.com/slauger/check_netscaler.git
cd check_netscaler
# Install
pip install .
# For development
pip install -e ".[dev]"
Pre-built Binaries (Standalone)
For systems without Python or pip, download standalone executables from the Releases page:
- Linux:
check_netscaler-linux - macOS:
check_netscaler-macos - Windows:
check_netscaler-windows.exe
These binaries are built with PyInstaller and include all dependencies. No Python installation required.
# Linux/macOS example
chmod +x check_netscaler-linux
./check_netscaler-linux --help
# Windows example
check_netscaler-windows.exe --help
Quick Start
# Check all load balancer vServers
check_netscaler -H 192.168.1.10 -u nsroot -p nsroot -C state -o lbvserver
# Check SSL certificate expiration
check_netscaler -H 192.168.1.10 -C sslcert -w 60 -c 30
# Check CPU usage
check_netscaler -H 192.168.1.10 -C above -o system -n cpuusagepcnt -w 75 -c 90
# Check HA status
check_netscaler -H 192.168.1.10 -C hastatus
# Check NTP sync
check_netscaler -H 192.168.1.10 -C ntp -w "o=0.03" -c "o=0.05"
Using Environment Variables (Recommended)
For improved security and convenience, use environment variables instead of command-line arguments:
# Export credentials once
export NETSCALER_HOST=192.168.1.10
export NETSCALER_USER=monitoring
export NETSCALER_PASS=SecurePassword123
# Now run checks without passing credentials
check_netscaler -C state -o lbvserver
check_netscaler -C sslcert -w 60 -c 30
check_netscaler -C hastatus
Why use environment variables?
- Security: Credentials are not visible in process listings (
ps,top,/proc) - Convenience: Set once, use in multiple commands
- Best Practice: Follows patterns from other monitoring plugins (PostgreSQL, MySQL)
- Integration: Works seamlessly with Icinga 2
envattribute, Nagios/systemd environments
Command-line arguments always override environment variables if both are provided.
Available Commands
| Command | Description |
|---|---|
state |
vServer/service/servicegroup/server state monitoring |
above/below |
Threshold-based checks (CPU, memory, disk, etc.) |
sslcert |
SSL certificate expiration |
hastatus |
High availability status |
interfaces |
Network interface monitoring |
servicegroup |
Service group member quorum |
perfdata |
Generic performance data collection |
license |
License expiration |
ntp |
NTP synchronization status |
nsconfig |
Unsaved configuration detection |
matches/matches_not |
String matching in API responses |
staserver |
STA server availability |
hwinfo |
Hardware information |
debug |
Raw API output for troubleshooting |
Documentation
- CLI Reference - Complete command-line options reference
- Command Examples - Detailed usage for every command
- Icinga 2 Integration - CheckCommand definitions
- Nagios Integration - Command and service configurations
Development
Running Tests
# Run all tests
pytest tests/
# With coverage
pytest tests/ --cov=check_netscaler --cov-report=html
# Linting
ruff check check_netscaler/ tests/
# Formatting
black check_netscaler/ tests/
CI/CD
GitHub Actions pipeline runs automatically on every push:
- Matrix testing on Python 3.8, 3.9, 3.10, 3.11, 3.12
- Linting with ruff
- Code formatting with black
- Type checking with mypy
- Comprehensive test suite with pytest
License
MIT License - See LICENSE
Contributors
- slauger - Original author
- macampo
- Velociraptor85
- bb-ricardo
- DerInti
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file check_netscaler-2.4.0.tar.gz.
File metadata
- Download URL: check_netscaler-2.4.0.tar.gz
- Upload date:
- Size: 51.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f3a90aa24bd6730c6e550dffbe89408e6c774261ceea9b142a084adf5244ecc
|
|
| MD5 |
1a96015fe3bf3db636a688ccb6736b86
|
|
| BLAKE2b-256 |
9a497be04f4cfa94894efa07ab0b19e1232ef7ed833c00b7b6d6d2653cbd744e
|
Provenance
The following attestation bundles were made for check_netscaler-2.4.0.tar.gz:
Publisher:
release.yml on slauger/check_netscaler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
check_netscaler-2.4.0.tar.gz -
Subject digest:
0f3a90aa24bd6730c6e550dffbe89408e6c774261ceea9b142a084adf5244ecc - Sigstore transparency entry: 810102957
- Sigstore integration time:
-
Permalink:
slauger/check_netscaler@f4eb81ae5aa323a7e131271d3328f792ec307df2 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/slauger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f4eb81ae5aa323a7e131271d3328f792ec307df2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file check_netscaler-2.4.0-py3-none-any.whl.
File metadata
- Download URL: check_netscaler-2.4.0-py3-none-any.whl
- Upload date:
- Size: 40.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99a2857a0c6efbba7acbd2bbb637480dde2071c2ce59eb4d3f71dfe364178175
|
|
| MD5 |
b1c030b4aaea54dd52c38651322484ac
|
|
| BLAKE2b-256 |
403ccaf1080a851796db4f14b779db493753d0af6a274849ff209d0f3b00ae55
|
Provenance
The following attestation bundles were made for check_netscaler-2.4.0-py3-none-any.whl:
Publisher:
release.yml on slauger/check_netscaler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
check_netscaler-2.4.0-py3-none-any.whl -
Subject digest:
99a2857a0c6efbba7acbd2bbb637480dde2071c2ce59eb4d3f71dfe364178175 - Sigstore transparency entry: 810102963
- Sigstore integration time:
-
Permalink:
slauger/check_netscaler@f4eb81ae5aa323a7e131271d3328f792ec307df2 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/slauger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f4eb81ae5aa323a7e131271d3328f792ec307df2 -
Trigger Event:
push
-
Statement type: