show event manager environment all

show event manager environment all

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 event manager environment all",
  "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 event manager environment all",
        "msg": "Success",
        "code": "200",
        "body": {
          "environment-details": "                default-reason : EEM action.\n                       emailto : admin@anyplace.com\n"
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show event manager environment all 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 event manager environment all
                default-reason : EEM action.
                       emailto : admin@anyplace.com


show event manager event-types all

show event manager event-types all

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 event manager event-types all",
  "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 event manager event-types all",
        "msg": "Success",
        "code": "200",
        "body": {
          "event-types": "Name : System_switchover\nDescription : switchover related events\nEvent Parameters : $vdc_no, $srv_name\nPublisher : sysmgr\nDefault Action : collect information about sup state\n\nName : VDC_Events\nDescription : VDC create, delete and hap-reset events\nEvent Parameters : $vdc_no, $srv_name\nPublisher : sysmgr\nDefault Action : collect information about sysmgr state in that vdc\n\nName : File_System_Events\nDescription : partition /dev/shm or /mnt/pss usage events\nEvent Parameters : $vdc_no, $srv_name\nPublisher : sysmgr\nDefault Action : collect file system information\n\nName : Standby_Events\nDescription : gsync and vdc create events from standby\nEvent Parameters : $vdc_no, $srv_name\nPublisher : sysmgr\nDefault Action : collect information about sysmgr state\n\nName : HAP_Reset\nDescription : HAP Reset in VDC\nEvent Parameters : $vdc_no, $srv_name\nPublisher : sysmgr\nDefault Action : collect information about sysmgr state in that vdc\n\nName : Plugin_Events\nDescription : load Plugin related events\nEvent Parameters : $vdc_no, $srv_name\nPublisher : sysmgr\nDefault Action : collect information about sysmgr state\n\nName : Service_Memory_Event\nDescription : Service Memory Usage Events. Action: Syslog\nEvent Parameters : majoralert, minoralert, clearalert, moduleno, vdc\nPublisher : sysmgr\nDefault Action : None\n\nName : Switchover_Event\nDescription : Switchover count exceeded events\nEvent Parameters : swovercount, swoverthreshold\nPublisher : sysmgr\nDefault Action : collect information about sysmgr state\n\nName : internal-link-failure\nDescription : internal link failure\nEvent Parameters : lcmod, lcunit, lcport, fmmod, fmunit, fmport\nPublisher : XBM Manager\nDefault Action : power cycle the module\n\nName : oir\nDescription : OIR event\nEvent Parameters : devicetype, eventtype, devicenum\nPublisher : Platform Manager\nDefault Action : None\n\nName : fanabsent\nDescription : Fan Absent Event \nEvent Parameters : devicenum, time\nPublisher : Platform Manager\nDefault Action : None\n\nName : fanbad\nDescription : Fan Bad Event \nEvent Parameters : devicenum, time\nPublisher : Platform Manager\nDefault Action : None\n\nName : memory\nDescription : Memory Alerts \nEvent Parameters : memstate\nPublisher : Platform Manager\nDefault Action : None\n\nName : temperature\nDescription : Temperature Sensor Event \nEvent Parameters : modnum, sensornum, major_minor\nPublisher : Platform Manager\nDefault Action : Shutdown on major temperature threshold\n\nName : poweroverbudget\nDescription : Power Over Budget Event \nEvent Parameters : \nPublisher : Platform Manager\nDefault Action : Syslog\n\nName : pfm_airflow\nDescription : Platform Fan Airflow Alerts \nEvent Parameters : dir, count, f2b_fans, f2b_ps_fans, b2f_fans, b2f_ps_fans\nPublisher : Platform Manager\nDefault Action : None\n\nName : module-failure\nDescription : Module failure\nEvent Parameters : err, module\nPublisher : LC Manager\nDefault Action : power cycle the module\n\nName : module-status\nDescription : Module status\nEvent Parameters : status, module\nPublisher : LC Manager\nDefault Action : none\n\nName : snmp\nDescription : SNMP MIB object monitoring\nEvent Parameters : param1, param2\nPublisher : SNMP\nDefault Action : None\n\nName : cli\nDescription : EEM CLI command filter\nEvent Parameters : _syslog_msg\nPublisher : CLI events publisher\nDefault Action : \n\nName : cli\nDescription : EEM CLI command filter\nEvent Parameters : command\nPublisher : CLI events publisher\nDefault Action : \n\nName : cdp\nDescription : EEM CDP filter\nEvent Parameters : CdpEvent\nPublisher : CDP events publisher\nDefault Action : \n\nName : link_flap\nDescription : Link Flaps\nEvent Parameters : interface, cause\nPublisher : Ethernet Port Manager\nDefault Action : Error Disable the port\n\nName : storm_control\nDescription : Traffic on a port exceeds configured thresholds\nEvent Parameters : interface, cause\nPublisher : Ethernet Port Manager\nDefault Action : None\n\nName : debug_1\nDescription : Internal event used by apps to indicate faults.\nEvent Parameters : interface, cause\nPublisher : Ethernet Port Manager\nDefault Action : None\n\nName : debug_2\nDescription : Internal event used by apps to indicate faults.\nEvent Parameters : interface, cause\nPublisher : Ethernet Port Manager\nDefault Action : None\n\nName : debug_3\nDescription : Internal event used by apps to indicate faults.\nEvent Parameters : interface, cause\nPublisher : Ethernet Port Manager\nDefault Action : None\n\nName : debug_4\nDescription : Internal event used by apps to indicate faults.\nEvent Parameters : interface, cause\nPublisher : Ethernet Port Manager\nDefault Action : None\n\nName : reinit_no_flap\nDescription : Reinit No Flap\nEvent Parameters : interface, cause\nPublisher : Ethernet Port Manager\nDefault Action : Error Disable the port\n\nName : route_inconsistent\nDescription : A route is inconsistent in FIB\nEvent Parameters : \nPublisher : UFDM\nDefault Action : None\n\nName : route_missing_in_fib\nDescription : Route is missing in FIB\nEvent Parameters : \nPublisher : UFDM\nDefault Action : None\n\nName : route_extra\nDescription : An extra route in FIB\nEvent Parameters : \nPublisher : UFDM\nDefault Action : None\n\nName : Adjacency_extra\nDescription : An extra adjacency in FIB\nEvent Parameters : \nPublisher : UFDM\nDefault Action : None\n\nName : TCAM_usage_threshold\nDescription : TCAM usage threshold event\nEvent Parameters : \nPublisher : IPFIB\nDefault Action : None\n\nName : gold\nDescription : Test exceeds failure count threshold\nEvent Parameters : module_id, test_name, severity, testing_type, consecutive_failure_count\nPublisher : GOLD-diagnostic event publish\nDefault Action : Notify TestSrvc\n\nName : track\nDescription : Track object\nEvent Parameters : object, state\nPublisher : Object Tracking Manager\nDefault Action : none\n\nName : counter\nDescription : Named Counter Event\nEvent Parameters : counter_name, counter_value\nPublisher : MVSH\nDefault Action : None\n\nName : IDS_counter\nDescription : IDS counter event\nEvent Parameters : module_num, IDS_counter_name\nPublisher : Platform Config\nDefault Action : syslog"
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show event manager event-types all 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 event manager event-types all
Name : System_switchover
Description : switchover related events
Event Parameters : $vdc_no, $srv_name
Publisher : sysmgr
Default Action : collect information about sup state

Name : VDC_Events
Description : VDC create, delete and hap-reset events
Event Parameters : $vdc_no, $srv_name
Publisher : sysmgr
Default Action : collect information about sysmgr state in that vdc

Name : File_System_Events
Description : partition /dev/shm or /mnt/pss usage events
Event Parameters : $vdc_no, $srv_name
Publisher : sysmgr
Default Action : collect file system information

Name : Standby_Events
Description : gsync and vdc create events from standby
Event Parameters : $vdc_no, $srv_name
Publisher : sysmgr
Default Action : collect information about sysmgr state

Name : HAP_Reset
Description : HAP Reset in VDC
Event Parameters : $vdc_no, $srv_name
Publisher : sysmgr
Default Action : collect information about sysmgr state in that vdc

Name : Plugin_Events
Description : load Plugin related events
Event Parameters : $vdc_no, $srv_name
Publisher : sysmgr
Default Action : collect information about sysmgr state

Name : Service_Memory_Event
Description : Service Memory Usage Events. Action: Syslog
Event Parameters : majoralert, minoralert, clearalert, moduleno, vdc
Publisher : sysmgr
Default Action : None

Name : Switchover_Event
Description : Switchover count exceeded events
Event Parameters : swovercount, swoverthreshold
Publisher : sysmgr
Default Action : collect information about sysmgr state

Name : internal-link-failure
Description : internal link failure
Event Parameters : lcmod, lcunit, lcport, fmmod, fmunit, fmport
Publisher : XBM Manager
Default Action : power cycle the module

Name : oir
Description : OIR event
Event Parameters : devicetype, eventtype, devicenum
Publisher : Platform Manager
Default Action : None

Name : fanabsent
Description : Fan Absent Event
Event Parameters : devicenum, time
Publisher : Platform Manager
Default Action : None

Name : fanbad
Description : Fan Bad Event
Event Parameters : devicenum, time
Publisher : Platform Manager
Default Action : None

Name : memory
Description : Memory Alerts
Event Parameters : memstate
Publisher : Platform Manager
Default Action : None

Name : temperature
Description : Temperature Sensor Event
Event Parameters : modnum, sensornum, major_minor
Publisher : Platform Manager
Default Action : Shutdown on major temperature threshold

Name : poweroverbudget
Description : Power Over Budget Event
Event Parameters :
Publisher : Platform Manager
Default Action : Syslog

Name : pfm_airflow
Description : Platform Fan Airflow Alerts
Event Parameters : dir, count, f2b_fans, f2b_ps_fans, b2f_fans, b2f_ps_fans
Publisher : Platform Manager
Default Action : None

Name : module-failure
Description : Module failure
Event Parameters : err, module
Publisher : LC Manager
Default Action : power cycle the module

Name : module-status
Description : Module status
Event Parameters : status, module
Publisher : LC Manager
Default Action : none

Name : snmp
Description : SNMP MIB object monitoring
Event Parameters : param1, param2
Publisher : SNMP
Default Action : None

Name : cli
Description : EEM CLI command filter
Event Parameters : _syslog_msg
Publisher : CLI events publisher
Default Action :

Name : cli
Description : EEM CLI command filter
Event Parameters : command
Publisher : CLI events publisher
Default Action :

Name : cdp
Description : EEM CDP filter
Event Parameters : CdpEvent
Publisher : CDP events publisher
Default Action :

Name : link_flap
Description : Link Flaps
Event Parameters : interface, cause
Publisher : Ethernet Port Manager
Default Action : Error Disable the port

Name : storm_control
Description : Traffic on a port exceeds configured thresholds
Event Parameters : interface, cause
Publisher : Ethernet Port Manager
Default Action : None

Name : debug_1
Description : Internal event used by apps to indicate faults.
Event Parameters : interface, cause
Publisher : Ethernet Port Manager
Default Action : None

Name : debug_2
Description : Internal event used by apps to indicate faults.
Event Parameters : interface, cause
Publisher : Ethernet Port Manager
Default Action : None

Name : debug_3
Description : Internal event used by apps to indicate faults.
Event Parameters : interface, cause
Publisher : Ethernet Port Manager
Default Action : None

Name : debug_4
Description : Internal event used by apps to indicate faults.
Event Parameters : interface, cause
Publisher : Ethernet Port Manager
Default Action : None

Name : reinit_no_flap
Description : Reinit No Flap
Event Parameters : interface, cause
Publisher : Ethernet Port Manager
Default Action : Error Disable the port

Name : route_inconsistent
Description : A route is inconsistent in FIB
Event Parameters :
Publisher : UFDM
Default Action : None

Name : route_missing_in_fib
Description : Route is missing in FIB
Event Parameters :
Publisher : UFDM
Default Action : None

Name : route_extra
Description : An extra route in FIB
Event Parameters :
Publisher : UFDM
Default Action : None

Name : Adjacency_extra
Description : An extra adjacency in FIB
Event Parameters :
Publisher : UFDM
Default Action : None

Name : TCAM_usage_threshold
Description : TCAM usage threshold event
Event Parameters :
Publisher : IPFIB
Default Action : None

Name : gold
Description : Test exceeds failure count threshold
Event Parameters : module_id, test_name, severity, testing_type, consecutive_failure_count
Publisher : GOLD-diagnostic event publish
Default Action : Notify TestSrvc

Name : track
Description : Track object
Event Parameters : object, state
Publisher : Object Tracking Manager
Default Action : none

Name : counter
Description : Named Counter Event
Event Parameters : counter_name, counter_value
Publisher : MVSH
Default Action : None

Name : IDS_counter
Description : IDS counter event
Event Parameters : module_num, IDS_counter_name
Publisher : Platform Config
Default Action : syslog



show event manager events action-log

show event manager events action-log

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 event manager events action-log",
  "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 event manager events action-log",
        "msg": "Success",
        "code": "200",
        "body": {
          "action-log-data": "eem_event_time:03/27/2018,02:40:40 event_type:cli event_id:1 slot:active(1) vdc:1 severity:minor applets:zubin\neem_param_info:_syslog_msg = \"%VDC_MGR-2-VDC_ONLINE: vdc 1 has come online \"\nTraceback (most recent call last):\n  File \"/bootflash/scripts/eem_python_script_TC.py\", line 3, in <module>\n    cisco.cli (\"conf t ; int loopback 600-1000 ; shut ; no shut ; shut ; no shut ; shut ; no shut ; shut ; no shut\")\nAttributeError: 'module' object has no attribute 'cli'\nExecuting the following commands succeeded:\n            source eem_python_script_TC.py\n\negister(129): registered MTS_OPC_VSH_CMD_TLV(7679) with q\nfu_internal_walk_n_mts_register(129): registered MTS_OPC_SDWRAP_DEBUG_DUMP(1530) with q\nfu_internal_walk_n_mts_register(129): registered MTS_OPC_SYSLOG_FACILITY_OPR(185) with q\nfu_internal_walk_n_mts_register(129): registered MTS_OPC_SYSMGR_CFG_ACTION(1360) with q\nfu_internal_walk_n_mts_register(129): registered MTS_OPC_SYSMGR_CFG_SAVED(1361) with q\nDefault action execution successful\n\n\neem_event_time:04/25/2018,22:07:49 event_type:cli event_id:1 slot:active(1) vdc:1 severity:minor applets:zubin\neem_param_info:_syslog_msg = \"%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user\"\nExecuting the following commands succeeded:\n        syslog priority alerts msg zubinzubinzubinzubin\n\n\neem_event_time:04/25/2018,23:02:06 event_type:cli event_id:2 slot:active(1) vdc:1 severity:minor applets:zubin\neem_param_info:_syslog_msg = \"%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user\"\nExecuting the following commands succeeded:\n        syslog priority alerts msg zubinzubinzubinzubin\n\n\neem_event_time:04/25/2018,23:02:24 event_type:cli event_id:3 slot:active(1) vdc:1 severity:minor applets:zubin\neem_param_info:_syslog_msg = \"%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user\"\nExecuting the following commands succeeded:\n        syslog priority alerts msg zubinzubinzubinzubin\n\n\neem_event_time:04/25/2018,23:04:12 event_type:cli event_id:4 slot:active(1) vdc:1 severity:minor applets:zubin\neem_param_info:_syslog_msg = \"%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user\"\nExecuting the following commands succeeded:\n        syslog priority alerts msg zubinzubinzubinzubin\n\n\neem_event_time:04/25/2018,23:04:45 event_type:cli event_id:5 slot:active(1) vdc:1 severity:minor applets:zubin\neem_param_info:_syslog_msg = \"%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user\"\nExecuting the following commands succeeded:\n        syslog priority alerts msg zubinzubinzubinzubin\n\n\neem_event_time:04/26/2018,05:50:11 event_type:cli event_id:6 slot:active(1) vdc:1 severity:minor applets:zubin\neem_param_info:_syslog_msg = \"%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user\"\nExecuting the following commands succeeded:\n        syslog priority alerts msg zubinzubinzubinzubin\n\n\neem_event_time:04/26/2018,05:50:36 event_type:cli event_id:7 slot:active(1) vdc:1 severity:minor applets:zubin\neem_param_info:_syslog_msg = \"%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user\"\nExecuting the following commands succeeded:\n        syslog priority alerts msg zubinzubinzubinzubin\n\n\neem_event_time:04/26/2018,05:52:19 event_type:cli event_id:8 slot:active(1) vdc:1 severity:minor applets:zubin\neem_param_info:_syslog_msg = \"%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user\"\nExecuting the following commands succeeded:\n        syslog priority alerts msg zubinzubinzubinzubin\n\n\neem_event_time:04/26/2018,05:53:04 event_type:cli event_id:9 slot:active(1) vdc:1 severity:minor applets:zubin\neem_param_info:_syslog_msg = \"%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user\"\nExecuting the following commands succeeded:\n        syslog priority alerts msg zubinzubinzubinzubin\n\n\neem_event_time:07/29/2018,21:52:51 event_type:cli event_id:1 slot:active(1) vdc:1 severity:minor applets:test\neem_param_info:_syslog_msg = \"%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user\"\nExecuting the following commands succeeded:\n        syslog priority alerts msg testtesttest\n\n\n"
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show event manager events action-log 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 event manager events action-log
eem_event_time:03/27/2018,02:40:40 event_type:cli event_id:1 slot:active(1) vdc:1 severity:minor applets:test
eem_param_info:_syslog_msg = "%VDC_MGR-2-VDC_ONLINE: vdc 1 has come online "
Traceback (most recent call last):
  File "/bootflash/scripts/eem_python_script_TC.py", line 3, in 
    cisco.cli ("conf t ; int loopback 600-1000 ; shut ; no shut ; shut ; no shut ; shut ; no shut ; shut ; no shut")
AttributeError: 'module' object has no attribute 'cli'
Executing the following commands succeeded:
            source eem_python_script_TC.py

egister(129): registered MTS_OPC_VSH_CMD_TLV(7679) with q
fu_internal_walk_n_mts_register(129): registered MTS_OPC_SDWRAP_DEBUG_DUMP(1530) with q
fu_internal_walk_n_mts_register(129): registered MTS_OPC_SYSLOG_FACILITY_OPR(185) with q
fu_internal_walk_n_mts_register(129): registered MTS_OPC_SYSMGR_CFG_ACTION(1360) with q
fu_internal_walk_n_mts_register(129): registered MTS_OPC_SYSMGR_CFG_SAVED(1361) with q
Default action execution successful


eem_event_time:04/25/2018,22:07:49 event_type:cli event_id:1 slot:active(1) vdc:1 severity:minor applets:test
eem_param_info:_syslog_msg = "%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user"
Executing the following commands succeeded:
        syslog priority alerts msg testtesttest


eem_event_time:04/25/2018,23:02:06 event_type:cli event_id:2 slot:active(1) vdc:1 severity:minor applets:test
eem_param_info:_syslog_msg = "%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user"
Executing the following commands succeeded:
        syslog priority alerts msg testtesttest


eem_event_time:04/25/2018,23:02:24 event_type:cli event_id:3 slot:active(1) vdc:1 severity:minor applets:test
eem_param_info:_syslog_msg = "%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user"
Executing the following commands succeeded:
        syslog priority alerts msg testtesttest


eem_event_time:04/25/2018,23:04:12 event_type:cli event_id:4 slot:active(1) vdc:1 severity:minor applets:test
eem_param_info:_syslog_msg = "%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user"
Executing the following commands succeeded:
        syslog priority alerts msg testtesttest


eem_event_time:04/25/2018,23:04:45 event_type:cli event_id:5 slot:active(1) vdc:1 severity:minor applets:test
eem_param_info:_syslog_msg = "%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user"
Executing the following commands succeeded:
        syslog priority alerts msg testtesttest


eem_event_time:04/26/2018,05:50:11 event_type:cli event_id:6 slot:active(1) vdc:1 severity:minor applets:test
eem_param_info:_syslog_msg = "%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user"
Executing the following commands succeeded:
        syslog priority alerts msg testtesttest


eem_event_time:04/26/2018,05:50:36 event_type:cli event_id:7 slot:active(1) vdc:1 severity:minor applets:test
eem_param_info:_syslog_msg = "%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user"
Executing the following commands succeeded:
        syslog priority alerts msg testtesttest


eem_event_time:04/26/2018,05:52:19 event_type:cli event_id:8 slot:active(1) vdc:1 severity:minor applets:test
eem_param_info:_syslog_msg = "%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user"
Executing the following commands succeeded:
        syslog priority alerts msg testtesttest


eem_event_time:04/26/2018,05:53:04 event_type:cli event_id:9 slot:active(1) vdc:1 severity:minor applets:test
eem_param_info:_syslog_msg = "%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user"
Executing the following commands succeeded:
        syslog priority alerts msg testtesttest


eem_event_time:07/29/2018,21:52:51 event_type:cli event_id:1 slot:active(1) vdc:1 severity:minor applets:test
eem_param_info:_syslog_msg = "%SYSLOG-1-SYSTEM_MSG: Logging logfile (messages) cleared by user"
Executing the following commands succeeded:
        syslog priority alerts msg testtesttest


show event manager history events

show event manager history 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 event manager history 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 event manager history events",
        "msg": "Success",
        "code": "200",
        "body": {
          "history-events": "Event ID Time of Event        Event Type                   Slot       Policies\n1        03/27/2018 02:40:40  cli                          active(1)  zubin\n1        04/25/2018 22:07:49  cli                          active(1)  zubin\n2        04/25/2018 23:02:06  cli                          active(1)  zubin\n3        04/25/2018 23:02:24  cli                          active(1)  zubin\n4        04/25/2018 23:04:12  cli                          active(1)  zubin\n5        04/25/2018 23:04:45  cli                          active(1)  zubin\n6        04/26/2018 05:50:11  cli                          active(1)  zubin\n7        04/26/2018 05:50:36  cli                          active(1)  zubin\n8        04/26/2018 05:52:19  cli                          active(1)  zubin\n9        04/26/2018 05:53:04  cli                          active(1)  zubin\n1        07/29/2018 21:52:51  cli                          active(1)  test\n"
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show event manager history 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 event manager history events
Event ID Time of Event        Event Type                   Slot       Policies
1        03/27/2018 02:40:40  cli                          active(1)  zubin
1        04/25/2018 22:07:49  cli                          active(1)  zubin
2        04/25/2018 23:02:06  cli                          active(1)  zubin
3        04/25/2018 23:02:24  cli                          active(1)  zubin
4        04/25/2018 23:04:12  cli                          active(1)  zubin
5        04/25/2018 23:04:45  cli                          active(1)  zubin
6        04/26/2018 05:50:11  cli                          active(1)  zubin
7        04/26/2018 05:50:36  cli                          active(1)  zubin
8        04/26/2018 05:52:19  cli                          active(1)  zubin
9        04/26/2018 05:53:04  cli                          active(1)  zubin
1        07/29/2018 21:52:51  cli                          active(1)  test

show event manager system-policy all

show event manager system-policy all

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 event manager system-policy all",
  "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 event manager system-policy all",
        "msg": "Success",
        "code": "200",
        "body": {
          "sys-pol-details": "           Name : __BCM_USD_EEM_POLICY_CFAP_MEM\n    Description : Fatal CFAP_MEM_FAIL error\n    Overridable : Yes\n  Threshold Min : 1\n  Threshold Max : 20\n\n           Name : __BCM_USD_EEM_POLICY_CORRECTA\n    Description : correctable parity errors\n    Overridable : Yes\n  Threshold Min : 1\n  Threshold Max : 20\n\n           Name : __BCM_USD_EEM_POLICY_CORRECTE\n    Description : corrected parity errors syslog\n    Overridable : Yes\n  Threshold Min : 1\n  Threshold Max : 5\n\n           Name : __BCM_USD_EEM_POLICY_UNCORREC\n    Description : Uncorrectable parity errors syslog\n    Overridable : Yes\n  Threshold Min : 1\n  Threshold Max : 10\n\n           Name : __PortLoopback\n    Description : Do CallHome, log error and disable further HM testing on affected ports after 10 consecutive failures of GOLD \"PortLoopback\" test\n    Overridable : Yes\n\n           Name : __RewriteEngineLoopback\n    Description : Do CallHome, log error and disable further HM testing on affected ports after 10 consecutive failures of GOLD \"RewriteEngineLoopback\" test\n    Overridable : Yes\n\n           Name : __act2\n    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of  GOLD \"ACT2\" test\n    Overridable : Yes\n\n           Name : __asicmem\n    Description : Do CallHome and log error when GOLD \"AsicMemory\" test fails\n    Overridable : Yes\n\n           Name : __bootflash\n    Description : Do CallHome and log error when GOLD \"BootFlash\" test fails\n    Overridable : Yes\n\n           Name : __console\n    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of  GOLD \"Console\" test\n    Overridable : Yes\n\n           Name : __ethpm_debug_1\n    Description : Action: none\n    Overridable : Yes\n\n           Name : __ethpm_debug_2\n    Description : Action: none\n    Overridable : Yes\n\n           Name : __ethpm_debug_3\n    Description : Action: none\n    Overridable : Yes\n\n           Name : __ethpm_debug_4\n    Description : Action: none\n    Overridable : Yes\n\n           Name : __ethpm_link_flap\n    Description : More than 30 link flaps in 420 seconds interval. Action: Error Disable the port\n    Overridable : Yes\n\n           Name : __ethpm_reinit_no_flap\n    Description : More than 30 reinits in 420 seconds interval. Action: Error Disable the port\n    Overridable : Yes\n\n           Name : __fpgareg\n    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of  GOLD \"FpgaRegTest\" test\n    Overridable : Yes\n\n           Name : __gold_obfl\n    Description : Do CallHome and log error when GOLD\"OBFL\" test fails\n    Overridable : Yes\n\n           Name : __lcm_module_failure\n    Description : Power-cycle 2 times then power-down\n    Overridable : Yes\n\n           Name : __mce\n    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of  GOLD \"Mce\" test\n    Overridable : Yes\n\n           Name : __nvram\n    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of  GOLD \"NVRAM\" test\n    Overridable : Yes\n\n           Name : __pcie\n    Description : Do CallHome and log error when GOLD \"Pcie\" test fails\n    Overridable : Yes\n\n           Name : __pfm_fanabsent_any_singlefan\n    Description : syslog if any fanabsent for 180 minute(s)\n    Overridable : Yes\n\n           Name : __pfm_fanabsent_multi_fan\n    Description : Shutdown if multiple fans are together absent for 2 minute(s)\n    Overridable : Yes\n\n           Name : __pfm_fanbad_any_singlefan\n    Description : Syslog when fan goes bad \n    Overridable : Yes\n\n           Name : __pfm_mem\n    Description : Generate a syslog\n    Overridable : No\n\n           Name : __pfm_oppositefandir\n    Description : Generate a syslog\n    Overridable : Yes\n\n           Name : __pfm_power_over_budget\n    Description : Syslog warning for insufficient power overbudget\n    Overridable : Yes\n\n           Name : __pfm_tempev_major\n    Description : TempSensor Major Threshold.  Action: Shutdown\n    Overridable : Yes\n\n           Name : __pfm_tempev_minor\n    Description : TempSensor Minor Threshold.  Action: Syslog.\n    Overridable : Yes\n\n           Name : __primary_bootrom\n    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of GOLD \"PrimaryBootROM\" test\n    Overridable : Yes\n\n           Name : __real_time_clock\n    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of GOLD \"RealTimeClock\" test\n    Overridable : Yes\n\n           Name : __secondary_bootrom\n    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of GOLD \"SecondaryBootROM\" test\n    Overridable : Yes\n\n           Name : __sysmgr_not_active_six_sec\n    Description : plugin load delay event. check sysmgr and plugin state\n    Overridable : No\n\n           Name : __sysmgr_policy_mem_alert\n    Description : service memory usage event\n    Overridable : Yes\n\n           Name : __sysmgr_service_hap_reset\n    Description : service hap reset event. check the services at fault and look for the cores\n    Overridable : No\n\n           Name : __sysmgr_standby_to_gsync\n    Description : vdc on standby events. check sysmgr state and service gsync state\n    Overridable : No\n\n           Name : __sysmgr_standby_vdc_hap\n    Description : vdc on standby events. check sysmgr state and service gsync state\n    Overridable : No\n\n           Name : __sysmgr_stby_not_online\n    Description : vdc on standby events. check sysmgr state and service gsync state\n    Overridable : No\n\n           Name : __sysmgr_swover_count_alert\n    Description : Switchover count exceeded event. Default value: 5 switchovers within 4800 seconds.  Default action: All linecards will be powered down.\n    Overridable : Yes\n\n           Name : __sysmgr_swover_fail\n    Description : switchover event, check whether switchover succeeds, look for the reason of failure\n    Overridable : No\n\n           Name : __sysmgr_swover_ok\n    Description : switchover event, check whether switchover succeeds, look for the reason of failure\n    Overridable : No\n\n           Name : __sysmgr_vdc_creat_timeout\n    Description : vdc creation, deletion and hap reset event. check sysmgr state and look for the reason of failure\n    Overridable : No\n\n           Name : __sysmgr_vdc_del_timeout\n    Description : vdc creation, deletion and hap reset event. check sysmgr state and look for the reason of failure\n    Overridable : No\n\n           Name : __sysmgr_vdc_dev_shm_usage\n    Description : file system events, check flash and pss files\n    Overridable : No\n\n           Name : __sysmgr_vdc_hap_reset\n    Description : vdc creation, deletion and hap reset event. check sysmgr state and look for the reason of failure\n    Overridable : No\n\n           Name : __sysmgr_vdc_mnt_pss_usage\n    Description : file system events, check flash and pss files\n    Overridable : No\n\n           Name : __sysmgr_vdc_not_hotstandby\n    Description : vdc on standby events. check sysmgr state and service gsync state\n    Overridable : No\n\n           Name : __sysmgr_vdc_ungraceful_delet\n    Description : vdc creation, deletion and hap reset event. check sysmgr state and look for the reason of failure\n    Overridable : No\n\n           Name : __system_mgmt_bus\n    Description : Do CallHome, log error and disable further HM testing for that FAN or PowerSupply after 20 consecutive failures of GOLD \"SystemMgmtBus\" test\n    Overridable : Yes\n\n           Name : __usb\n    Description : Do CallHome and log error when GOLD \"USB\" test fails\n    Overridable : Yes\n\n           Name : __xbm_linkflap_policy\n    Description : More than 30 link flaps in 420 seconds interval. Action: Bring down FM, if more than one FM present else bring down LC\n    Overridable : Yes\n\n"
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show event manager system-policy all 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 event manager system-policy all
           Name : BCM_USD_EEM_POLICY_CFAP_MEM
    Description : Fatal CFAP_MEM_FAIL error
    Overridable : Yes
  Threshold Min : 1
  Threshold Max : 20

           Name : BCM_USD_EEM_POLICY_CORRECTA
    Description : correctable parity errors
    Overridable : Yes
  Threshold Min : 1
  Threshold Max : 20

           Name : BCM_USD_EEM_POLICY_CORRECTE
    Description : corrected parity errors syslog
    Overridable : Yes
  Threshold Min : 1
  Threshold Max : 5

           Name : BCM_USD_EEM_POLICY_UNCORREC
    Description : Uncorrectable parity errors syslog
    Overridable : Yes
  Threshold Min : 1
  Threshold Max : 10

           Name : PortLoopback
    Description : Do CallHome, log error and disable further HM testing on affected ports after 10 consecutive failures of GOLD "PortLoopback" test
    Overridable : Yes

           Name : RewriteEngineLoopback
    Description : Do CallHome, log error and disable further HM testing on affected ports after 10 consecutive failures of GOLD "RewriteEngineLoopback" test
    Overridable : Yes

           Name : act2
    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of  GOLD "ACT2" test
    Overridable : Yes

           Name : asicmem
    Description : Do CallHome and log error when GOLD "AsicMemory" test fails
    Overridable : Yes

           Name : bootflash
    Description : Do CallHome and log error when GOLD "BootFlash" test fails
    Overridable : Yes

           Name : console
    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of  GOLD "Console" test
    Overridable : Yes

           Name : ethpm_debug_1
    Description : Action: none
    Overridable : Yes

           Name : ethpm_debug_2
    Description : Action: none
    Overridable : Yes

           Name : ethpm_debug_3
    Description : Action: none
    Overridable : Yes

           Name : ethpm_debug_4
    Description : Action: none
    Overridable : Yes

           Name : ethpm_link_flap
    Description : More than 30 link flaps in 420 seconds interval. Action: Error Disable the port
    Overridable : Yes

           Name : ethpm_reinit_no_flap
    Description : More than 30 reinits in 420 seconds interval. Action: Error Disable the port
    Overridable : Yes

           Name : fpgareg
    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of  GOLD "FpgaRegTest" test
    Overridable : Yes

           Name : gold_obfl
    Description : Do CallHome and log error when GOLD"OBFL" test fails
    Overridable : Yes

           Name : lcm_module_failure
    Description : Power-cycle 2 times then power-down
    Overridable : Yes

           Name : mce
    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of  GOLD "Mce" test
    Overridable : Yes

           Name : nvram
    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of  GOLD "NVRAM" test
    Overridable : Yes

           Name : pcie
    Description : Do CallHome and log error when GOLD "Pcie" test fails
    Overridable : Yes

           Name : pfm_fanabsent_any_singlefan
    Description : syslog if any fanabsent for 180 minute(s)
    Overridable : Yes

           Name : pfm_fanabsent_multi_fan
    Description : Shutdown if multiple fans are together absent for 2 minute(s)
    Overridable : Yes

           Name : pfm_fanbad_any_singlefan
    Description : Syslog when fan goes bad
    Overridable : Yes

           Name : pfm_mem
    Description : Generate a syslog
    Overridable : No

           Name : pfm_oppositefandir
    Description : Generate a syslog
    Overridable : Yes

           Name : pfm_power_over_budget
    Description : Syslog warning for insufficient power overbudget
    Overridable : Yes

           Name : pfm_tempev_major
    Description : TempSensor Major Threshold.  Action: Shutdown
    Overridable : Yes

           Name : pfm_tempev_minor
    Description : TempSensor Minor Threshold.  Action: Syslog.
    Overridable : Yes

           Name : primary_bootrom
    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of GOLD "PrimaryBootROM" test
    Overridable : Yes

           Name : real_time_clock
    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of GOLD "RealTimeClock" test
    Overridable : Yes

           Name : secondary_bootrom
    Description : Do CallHome, log error and disable further HM testing after 20 consecutive failures of GOLD "SecondaryBootROM" test
    Overridable : Yes

           Name : sysmgr_not_active_six_sec
    Description : plugin load delay event. check sysmgr and plugin state
    Overridable : No

           Name : sysmgr_policy_mem_alert
    Description : service memory usage event
    Overridable : Yes

           Name : sysmgr_service_hap_reset
    Description : service hap reset event. check the services at fault and look for the cores
    Overridable : No

           Name : sysmgr_standby_to_gsync
    Description : vdc on standby events. check sysmgr state and service gsync state
    Overridable : No

           Name : sysmgr_standby_vdc_hap
    Description : vdc on standby events. check sysmgr state and service gsync state
    Overridable : No

           Name : sysmgr_stby_not_online
    Description : vdc on standby events. check sysmgr state and service gsync state
    Overridable : No

           Name : sysmgr_swover_count_alert
    Description : Switchover count exceeded event. Default value: 5 switchovers within 4800 seconds.  Default action: All linecards will be powered down.
    Overridable : Yes

           Name : sysmgr_swover_fail
    Description : switchover event, check whether switchover succeeds, look for the reason of failure
    Overridable : No

           Name : sysmgr_swover_ok
    Description : switchover event, check whether switchover succeeds, look for the reason of failure
    Overridable : No

           Name : sysmgr_vdc_creat_timeout
    Description : vdc creation, deletion and hap reset event. check sysmgr state and look for the reason of failure
    Overridable : No

           Name : sysmgr_vdc_del_timeout
    Description : vdc creation, deletion and hap reset event. check sysmgr state and look for the reason of failure
    Overridable : No

           Name : sysmgr_vdc_dev_shm_usage
    Description : file system events, check flash and pss files
    Overridable : No

           Name : sysmgr_vdc_hap_reset
    Description : vdc creation, deletion and hap reset event. check sysmgr state and look for the reason of failure
    Overridable : No

           Name : sysmgr_vdc_mnt_pss_usage
    Description : file system events, check flash and pss files
    Overridable : No

           Name : sysmgr_vdc_not_hotstandby
    Description : vdc on standby events. check sysmgr state and service gsync state
    Overridable : No

           Name : sysmgr_vdc_ungraceful_delet
    Description : vdc creation, deletion and hap reset event. check sysmgr state and look for the reason of failure
    Overridable : No

           Name : system_mgmt_bus
    Description : Do CallHome, log error and disable further HM testing for that FAN or PowerSupply after 20 consecutive failures of GOLD "SystemMgmtBus" test
    Overridable : Yes

           Name : usb
    Description : Do CallHome and log error when GOLD "USB" test fails
    Overridable : Yes

           Name : xbm_linkflap_policy
    Description : More than 30 link flaps in 420 seconds interval. Action: Bring down FM, if more than one FM present else bring down LC
    Overridable : Yes