Skip to content

Instantly share code, notes, and snippets.

@jaimegago
Last active June 21, 2023 18:36

Revisions

  1. jaimegago renamed this gist Mar 5, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. jaimegago created this gist Mar 5, 2015.
    16 changes: 16 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    #!/usr/bin/python -tt

    import requests

    user = 'nsroot'
    password = 'nsroot'
    netscaler = 'my_netscaler_fqdn_or_ip'

    url = 'http://%s/nitro/v1/config/' % netscaler
    response = requests.get(url, auth=(user, password))
    data = response.json()
    for config_object in data['configobjects']:
    stat_url_test = 'http://%s/nitro/v1/stat/%s' % (netscaler, config_object)
    response = requests.get(stat_url_test, auth=(user, password))
    if response.status_code == 200:
    print config_object