Skip to main content

Nagios/Icinga monitoring plugin for Citrix NetScaler ADC using NITRO REST API

Project description

check_netscaler

CI PyPI Python License: MIT

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-ssl for HTTP instead of -s for 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]"

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 env attribute, 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

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

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

check_netscaler-2.3.1.tar.gz (51.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

check_netscaler-2.3.1-py3-none-any.whl (39.7 kB view details)

Uploaded Python 3

File details

Details for the file check_netscaler-2.3.1.tar.gz.

File metadata

  • Download URL: check_netscaler-2.3.1.tar.gz
  • Upload date:
  • Size: 51.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for check_netscaler-2.3.1.tar.gz
Algorithm Hash digest
SHA256 e603f9a5c771599f11c4a727d6da5fd6fa4c1ac503b99f813e3957c4c35d8057
MD5 7b98dc5961f48336a51a7a108a3b3968
BLAKE2b-256 41eda3b89026ccbec0137b7142c098e576fb403c65547dfe11d18cfa890f0494

See more details on using hashes here.

Provenance

The following attestation bundles were made for check_netscaler-2.3.1.tar.gz:

Publisher: release.yml on slauger/check_netscaler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file check_netscaler-2.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for check_netscaler-2.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 86a5adbec472a011a01f63316c8c87429c8d26f7fb47d31dd0adc097dd840fdc
MD5 65c3b8d23e302cc0a8c55eda2cccb0bf
BLAKE2b-256 3a127a02db0d4eda7c2c8b533015c5bf76d2ad82412851c4ee81db6e7353cade

See more details on using hashes here.

Provenance

The following attestation bundles were made for check_netscaler-2.3.1-py3-none-any.whl:

Publisher: release.yml on slauger/check_netscaler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page