Skip to content

Latest commit

 

History

History
144 lines (107 loc) · 2.89 KB

File metadata and controls

144 lines (107 loc) · 2.89 KB

debug - Raw API Output

Note: All examples assume environment variables are set:

export NETSCALER_HOST=192.168.1.10
export NETSCALER_USER=nsroot
export NETSCALER_PASS=nsroot

See Environment Variables for details.

Display raw JSON output from the NITRO API for troubleshooting and discovery.

Basic Usage

check_netscaler -C debug -o lbvserver

Output:

OK: debug output
{
  "lbvserver": [
    {
      "name": "web_lb",
      "ipv46": "192.168.10.10",
      "port": 80,
      "servicetype": "HTTP",
      "state": "UP",
      "curstate": "UP",
      ...
    }
  ]
}

Use Cases

1. Discover available fields

Find out what fields are available for an object type:

check_netscaler -C debug -o system

2. Troubleshoot API responses

See exactly what the NITRO API returns:

check_netscaler -C debug -o hanode

3. Check specific object

View details of a specific named object:

check_netscaler -C debug -o lbvserver -n web_lb

4. Test API connectivity

Verify API access and authentication:

check_netscaler -C debug -o nsversion

Advanced Usage

Specify API endpoint

# Using stat endpoint (performance counters)
check_netscaler -C debug -o lbvserver --api stat

# Using config endpoint (configuration data)
check_netscaler -C debug -o lbvserver --api config

Pretty-printed JSON

The output is automatically pretty-printed for readability.

Common Object Types

System Information

check_netscaler -C debug -o nsversion
check_netscaler -C debug -o nshardware
check_netscaler -C debug -o system

Load Balancing

check_netscaler -C debug -o lbvserver
check_netscaler -C debug -o service
check_netscaler -C debug -o servicegroup

SSL/Certificates

check_netscaler -C debug -o sslcertkey
check_netscaler -C debug -o sslvserver

High Availability

check_netscaler -C debug -o hanode
check_netscaler -C debug -o hasync

Network

check_netscaler -C debug -o interface
check_netscaler -C debug -o vlan

Output Format

The debug command returns:

  • Status: Always OK (unless API error)
  • Message: "debug output"
  • JSON: Pretty-printed NITRO API response

Exit Codes

  • 0 (OK) - API request successful, data displayed
  • 3 (UNKNOWN) - API error or cannot retrieve data

Tips

  • Use debug before creating new monitoring checks
  • Helps identify correct field names for perfdata, matches, etc.
  • Shows actual NITRO API response structure
  • Always returns OK status (for successful API calls)
  • Output is JSON-formatted for easy parsing
  • Use --api stat for performance counters
  • Use --api config for configuration data
  • Combine with jq for advanced JSON filtering: check_netscaler ... | jq
  • Very useful for building custom perfdata or matches checks