show rmon alarms

show rmon alarms

import json

"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'

myheaders={'content-type':'application/json'}
payload={
  "ins_api":{
  "version": "1.0",
  "type": "cli_show",
  "chunk": "0",
  "sid": "1",
  "input": "show rmon alarms",
  "output_format": "json"
}

response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)


{

  "ins_api": {
    "type": "cli_show",
    "version": "1.0",
    "sid": "eoc",
    "outputs": {
      "output": {
        "input": "show rmon alarms",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_rmon_alarm": {
            "ROW_rmon_alarm": {
              "alaram-str": "Alarm 1 is active, owned by test",
              "ascii-buf-str": "Monitors 1.3.6.1.4.1.9.9.305.1.1.1.0 every 30 second(s)",
              "samp-type-str": " Taking absolute samples, last value was 7",
              "ris-trshod-str": "  Rising threshold is 10, assigned to event 1",
              "fall-trshod-str": "  Falling threshold is 2, assigned to event 2",
              "start-enable-str": " On startup enable rising or falling alarm"
            }
          }
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show rmon alarms command, see the CLI command reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show rmon alarms
Alarm 1 is active, owned by test
Monitors 1.3.6.1.4.1.9.9.305.1.1.1.0 every 30 second(s)
 Taking absolute samples, last value was 9
  Rising threshold is 10, assigned to event 1
  Falling threshold is 2, assigned to event 2
 On startup enable rising or falling alarm


show rmon events

show rmon events

import json

"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'

myheaders={'content-type':'application/json'}
payload={
  "ins_api":{
  "version": "1.0",
  "type": "cli_show",
  "chunk": "0",
  "sid": "1",
  "input": "show rmon events",
  "output_format": "json"
}

response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)


{

  "ins_api": {
    "type": "cli_show",
    "version": "1.0",
    "sid": "eoc",
    "outputs": {
      "output": {
        "input": "show rmon events",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_rmon_event": {
            "ROW_rmon_event": [
              {
                "ev-alaram-str": "Event 1 is active, owned by test",
                "ev-desc-str": "Description is cpu_util_raising",
                "ev-fir-cause": "log and trap to community public",
                "last-fired": "last fired never"
              },
              {
                "ev-alaram-str": "Event 2 is active, owned by test",
                "ev-desc-str": "Description is cpu_util_falling",
                "ev-fir-cause": "log and trap to community public",
                "last-fired": "last fired never"
              },
              {
                "ev-alaram-str": "Event 3 is active, owned by PMON@ERROR",
                "ev-desc-str": "Description is ERROR(3)",
                "ev-fir-cause": "nothing",
                "last-fired": "last fired never"
              },
              {
                "ev-alaram-str": "Event 4 is active, owned by PMON@WARNING",
                "ev-desc-str": "Description is WARNING(4)",
                "ev-fir-cause": "nothing",
                "last-fired": "last fired never"
              },
              {
                "ev-alaram-str": "Event 5 is active, owned by PMON@INFO",
                "ev-desc-str": "Description is INFORMATION(5)",
                "ev-fir-cause": "nothing",
                "last-fired": "last fired never"
              }
            ]
          }
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show rmon events command, see the CLI command reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show rmon events
Event 1 is active, owned by test
Description is cpu_util_raising
 Event firing causes log and trap to community public, last fired never
Event 2 is active, owned by test
Description is cpu_util_falling
 Event firing causes log and trap to community public, last fired never
Event 3 is active, owned by PMON@ERROR
Description is ERROR(3)
 Event firing causes nothing, last fired never
Event 4 is active, owned by PMON@WARNING
Description is WARNING(4)
 Event firing causes nothing, last fired never
Event 5 is active, owned by PMON@INFO
Description is INFORMATION(5)
 Event firing causes nothing, last fired never


show rmon info

show rmon info

import json

"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'

myheaders={'content-type':'application/json'}
payload={
  "ins_api":{
  "version": "1.0",
  "type": "cli_show",
  "chunk": "0",
  "sid": "1",
  "input": "show rmon info",
  "output_format": "json"
}

response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)


{

  "ins_api": {
    "type": "cli_show",
    "version": "1.0",
    "sid": "eoc",
    "outputs": {
      "output": {
        "input": "show rmon info",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_rmon_info": {
            "ROW_rmon_info": {
              "max-32-64-ala-str": "Maximum allowed 32 bit or 64 bit alarms : 512",
              "max-conf-32-ala-str": "Number of 32 bit alarms configured : 1",
              "max-conf-64-ala-str": "Number of 64 bit hcalarms configured : 0"
            }
          }
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show rmon info command, see the CLI command reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show rmon info
Maximum allowed 32 bit or 64 bit alarms : 512
Number of 32 bit alarms configured : 1
Number of 64 bit hcalarms configured : 0

show rmon logs

show rmon logs

import json

"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'

myheaders={'content-type':'application/json'}
payload={
  "ins_api":{
  "version": "1.0",
  "type": "cli_show",
  "chunk": "0",
  "sid": "1",
  "input": "show rmon logs",
  "output_format": "json"
}

response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)


{

  "ins_api": {
    "type": "cli_show",
    "version": "1.0",
    "sid": "eoc",
    "outputs": {
      "output": {
        "input": "show rmon logs",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_rmon_log": {
            "ROW_rmon_log": {
              "event-id-str": "Event 1",
              "rmon-pch": "    1 cpu_util_raisingRising ",
              "log-buff-str": "alarm 1, fired at 2018/07/29-21:04:38 ",
              "log-oid": "      iso.3.6.1.4.1.9.9.305.1.1.1.0=10 >= 10  "
            }
          }
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show rmon logs command, see the CLI command reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show rmon logs
Event 1
    1 cpu_util_raisingRising alarm 1, fired at 2018/07/29-21:04:38
      iso.3.6.1.4.1.9.9.305.1.1.1.0=10 >= 10