show environment

show environment

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 environment",
  "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": {
        "outputs": {
            "output": {
                "body": {
                    "TABLE_tempinfo": {
                        "ROW_tempinfo": [
                            {
                                "alarmstatus": "ok", 
                                "curtemp": "46", 
                                "majthres": "92", 
                                "minthres": "85", 
                                "sensor": "ASIC", 
                                "tempmod": "1", 
                                "temptype": "Control"
                            }, 
                            {
                                "alarmstatus": "ok", 
                                "curtemp": "24", 
                                "majthres": "45", 
                                "minthres": "31", 
                                "sensor": "INTAKE", 
                                "tempmod": "1", 
                                "temptype": "Control"
                            }, 
                            {
                                "alarmstatus": "ok", 
                                "curtemp": "46", 
                                "majthres": "110", 
                                "minthres": "90", 
                                "sensor": "ASIC", 
                                "tempmod": "1", 
                                "temptype": "Monitor"
                            }, 
                            {
                                "alarmstatus": "ok", 
                                "curtemp": "24", 
                                "majthres": "70", 
                                "minthres": "40", 
                                "sensor": "INTAKE", 
                                "tempmod": "1", 
                                "temptype": "Monitor"
                            }
                        ]
                    }, 
                    "fandetails": {
                        "TABLE_faninfo": {
                            "ROW_faninfo": [
                                {
                                    "fanhwver": "--", 
                                    "fanmodel": "NXA-FAN-30CFM-F", 
                                    "fanname": "Fan-1", 
                                    "fanstatus": "ok"
                                }, 
                                {
                                    "fanhwver": "--", 
                                    "fanmodel": "NXA-FAN-30CFM-F", 
                                    "fanname": "Fan-2", 
                                    "fanstatus": "ok"
                                }, 
                                {
                                    "fanhwver": "--", 
                                    "fanmodel": "NXA-FAN-30CFM-F", 
                                    "fanname": "Fan-3", 
                                    "fanstatus": "ok"
                                }, 
                                {
                                    "fanhwver": "--", 
                                    "fanmodel": "NXA-FAN-30CFM-F", 
                                    "fanname": "Fan-4", 
                                    "fanstatus": "ok"
                                }, 
                                {
                                    "fanhwver": "--", 
                                    "fanmodel": "N2200-PAC-400W", 
                                    "fanname": "PS-1", 
                                    "fanstatus": "failure or missing"
                                }, 
                                {
                                    "fanhwver": "--", 
                                    "fanmodel": "N2200-PAC-400W", 
                                    "fanname": "PS-2", 
                                    "fanstatus": "ok"
                                }
                            ]
                        }, 
                        "fan_filter_status": "NotSupported"
                    }, 
                    "powersup": {
                        "TABLE_mod_pow_info": {
                            "ROW_mod_pow_info": {
                                "amps_alloced": "29.10", 
                                "amps_requested": "29.10", 
                                "mod_model": "N3K-C3548P-10GX-SUP", 
                                "modnum": "1", 
                                "modstatus": "powered-up", 
                                "watts_alloced": "349.20", 
                                "watts_requested": "349.20"
                            }
                        }, 
                        "TABLE_psinfo": {
                            "ROW_psinfo": [
                                {
                                    "amps": "0.00", 
                                    "input_type": "--", 
                                    "ps_status": "fail/not-powered-up", 
                                    "psmodel": "------------", 
                                    "psnum": "1", 
                                    "watts": "0.00"
                                }, 
                                {
                                    "amps": "33.00", 
                                    "input_type": "AC", 
                                    "ps_status": "ok", 
                                    "psmodel": "N2200-PAC-400W", 
                                    "psnum": "2", 
                                    "watts": "396.00"
                                }
                            ]
                        }, 
                        "power_summary": {
                            "available_pow": "46.80", 
                            "pow_used_by_mods": "0.00", 
                            "ps_redun_mode": "redundant", 
                            "ps_redun_op_mode": "Non-redundant", 
                            "reserve_sup": "349.20", 
                            "tot_pow_capacity": "396.00"
                        }, 
                        "voltage_level": "12"
                    }
                }, 
                "code": "200", 
                "input": "show environment", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

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

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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show environment


Fan:
------------------------------------------------------
Fan             Model                Hw         Status
------------------------------------------------------
Fan-1           NXA-FAN-30CFM-F      --         ok
Fan-2           NXA-FAN-30CFM-F      --         ok
Fan-3           NXA-FAN-30CFM-F      --         ok
Fan-4           NXA-FAN-30CFM-F      --         ok
PS-1            N2200-PAC-400W       --         failure or missing
PS-2            N2200-PAC-400W       --         ok

 Control Temperature
------------------------------------------------
 Sensor     MajorThresh   MinorThres   CurTemp
(Celsius) (Celsius) (Celsius) ------------------------------------------------ ASIC 92 85 46
INTAKE 45 31 24
------------------------------------------------ Monitor Temperature --------------------------------------------------------- Sensor MajorThresh MinorThres CurTemp Status (Celsius) (Celsius) (Celsius)
--------------------------------------------------------- ASIC 110 90 46 ok
INTAKE 70 40 24 ok
-------------------------------------------------------- Power Supply: Voltage: 12 Volts ----------------------------------------------------------- PS Model Input Power Current Status Type (Watts) (Amps)
----------------------------------------------------------- 1 -- -- -- -- fail/not-powered-up 2 N2200-PAC-400W AC 396.00 33.00 ok
Mod Model Power Current Power Current Status Requested Requested Allocated Allocated
(Watts) (Amps) (Watts) (Amps)
--- ---------------------- ------- ---------- --------- ---------- ---------- 1 N3K-C3548P-10GX-SUP 349.20 29.10 349.20 29.10 powered-up Power Usage Summary: -------------------- Power Supply redundancy mode: Redundant Power Supply redundancy operational mode: Non-redundant Total Power Capacity 396.00 W Power reserved for Supervisor(s) 349.20 W Power currently used by Modules 0.00 W ------------- Total Power Available 46.80 W -------------

show environment fan

show environment fan

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 environment fan",
  "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": {
        "outputs": {
            "output": {
                "body": {
                    "fandetails": {
                        "TABLE_faninfo": {
                            "ROW_faninfo": [
                                {
                                    "fanhwver": "--", 
                                    "fanmodel": "NXA-FAN-30CFM-F", 
                                    "fanname": "Fan-1", 
                                    "fanstatus": "ok"
                                }, 
                                {
                                    "fanhwver": "--", 
                                    "fanmodel": "NXA-FAN-30CFM-F", 
                                    "fanname": "Fan-2", 
                                    "fanstatus": "ok"
                                }, 
                                {
                                    "fanhwver": "--", 
                                    "fanmodel": "NXA-FAN-30CFM-F", 
                                    "fanname": "Fan-3", 
                                    "fanstatus": "ok"
                                }, 
                                {
                                    "fanhwver": "--", 
                                    "fanmodel": "NXA-FAN-30CFM-F", 
                                    "fanname": "Fan-4", 
                                    "fanstatus": "ok"
                                }, 
                                {
                                    "fanhwver": "--", 
                                    "fanmodel": "N2200-PAC-400W", 
                                    "fanname": "PS-1", 
                                    "fanstatus": "failure or missing"
                                }, 
                                {
                                    "fanhwver": "--", 
                                    "fanmodel": "N2200-PAC-400W", 
                                    "fanname": "PS-2", 
                                    "fanstatus": "ok"
                                }
                            ]
                        }, 
                        "fan_filter_status": "NotSupported"
                    }
                }, 
                "code": "200", 
                "input": "show environment fan", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

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

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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show environment fan


Fan:
------------------------------------------------------
Fan             Model                Hw         Status
------------------------------------------------------
Fan-1           NXA-FAN-30CFM-F      --         ok
Fan-2           NXA-FAN-30CFM-F      --         ok
Fan-3           NXA-FAN-30CFM-F      --         ok
Fan-4           NXA-FAN-30CFM-F      --         ok
PS-1            N2200-PAC-400W       --         failure or missing
PS-2            N2200-PAC-400W       --         ok

show environment fan detail

show environment fan detail

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 environment fan detail",
  "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": {
        "outputs": {
            "output": {
                "body": {
                    "fandetails": {
                        "TABLE_faninfodetail": {
                            "ROW_faninfodetail": [
                                {
                                    "airflowdir": "Front-to-Back", 
                                    "fanmodule": "1", 
                                    "fanno": "1", 
                                    "speedperc": "40", 
                                    "speedrpm": "7219"
                                }, 
                                {
                                    "airflowdir": "Front-to-Back", 
                                    "fanmodule": "1", 
                                    "fanno": "2", 
                                    "speedperc": "40", 
                                    "speedrpm": "5037"
                                }, 
                                {
                                    "airflowdir": "Front-to-Back", 
                                    "fanmodule": "2", 
                                    "fanno": "1", 
                                    "speedperc": "40", 
                                    "speedrpm": "7180"
                                }, 
                                {
                                    "airflowdir": "Front-to-Back", 
                                    "fanmodule": "2", 
                                    "fanno": "2", 
                                    "speedperc": "40", 
                                    "speedrpm": "5094"
                                }, 
                                {
                                    "airflowdir": "Front-to-Back", 
                                    "fanmodule": "3", 
                                    "fanno": "1", 
                                    "speedperc": "40", 
                                    "speedrpm": "7297"
                                }, 
                                {
                                    "airflowdir": "Front-to-Back", 
                                    "fanmodule": "3", 
                                    "fanno": "2", 
                                    "speedperc": "40", 
                                    "speedrpm": "5094"
                                }, 
                                {
                                    "airflowdir": "Front-to-Back", 
                                    "fanmodule": "4", 
                                    "fanno": "1", 
                                    "speedperc": "40", 
                                    "speedrpm": "7068"
                                }, 
                                {
                                    "airflowdir": "Front-to-Back", 
                                    "fanmodule": "4", 
                                    "fanno": "2", 
                                    "speedperc": "40", 
                                    "speedrpm": "5242"
                                }
                            ]
                        }, 
                        "TABLE_faninfodetail_ps": {
                            "ROW_faninfodetail_ps": [
                                {
                                    "airflowdir": "Fail/Shutdown", 
                                    "psmodule": "1", 
                                    "speedrpm": ""
                                }, 
                                {
                                    "airflowdir": "Front-to-Back", 
                                    "psmodule": "2", 
                                    "speedrpm": "10492"
                                }
                            ]
                        }
                    }
                }, 
                "code": "200", 
                "input": "show environment fan detail", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

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

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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show environment fan detail


Fan:
---------------------------------------------------
Module  Fan  Airflow        Speed(%)  Speed(RPM)
Direction
--------------------------------------------------- 1 1 Front-to-Back 40 7258
1 2 Front-to-Back 40 5046
2 1 Front-to-Back 40 7124
2 2 Front-to-Back 40 5103
3 1 Front-to-Back 40 7219
3 2 Front-to-Back 40 5094
4 1 Front-to-Back 40 7068
4 2 Front-to-Back 40 5162
Power Supply: --------------------------------------- Module Airflow Fan Speed(RPM)
Direction
--------------------------------------- 1 Fail/Shutdown
2 Front-to-Back 10492

show environment power

show environment power

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 environment power",
  "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": {
        "outputs": {
            "output": {
                "body": {
                    "powersup": {
                        "TABLE_mod_pow_info": {
                            "ROW_mod_pow_info": {
                                "amps_alloced": "29.10", 
                                "amps_requested": "29.10", 
                                "mod_model": "N3K-C3548P-10GX-SUP", 
                                "modnum": "1", 
                                "modstatus": "powered-up", 
                                "watts_alloced": "349.20", 
                                "watts_requested": "349.20"
                            }
                        }, 
                        "TABLE_psinfo": {
                            "ROW_psinfo": [
                                {
                                    "amps": "0.00", 
                                    "input_type": "--", 
                                    "ps_status": "fail/not-powered-up", 
                                    "psmodel": "------------", 
                                    "psnum": "1", 
                                    "watts": "0.00"
                                }, 
                                {
                                    "amps": "33.00", 
                                    "input_type": "AC", 
                                    "ps_status": "ok", 
                                    "psmodel": "N2200-PAC-400W", 
                                    "psnum": "2", 
                                    "watts": "396.00"
                                }
                            ]
                        }, 
                        "power_summary": {
                            "available_pow": "46.80", 
                            "pow_used_by_mods": "0.00", 
                            "ps_redun_mode": "redundant", 
                            "ps_redun_op_mode": "Non-redundant", 
                            "reserve_sup": "349.20", 
                            "tot_pow_capacity": "396.00"
                        }, 
                        "voltage_level": "12"
                    }
                }, 
                "code": "200", 
                "input": "show environment power", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

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

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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show environment power


Power Supply:
Voltage: 12 Volts
-----------------------------------------------------------
PS  Model                Input Power       Current   Status
                         Type  (Watts)     (Amps)
----------------------------------------------------------- 1 -- -- -- -- fail/not-powered-up 2 N2200-PAC-400W AC 396.00 33.00 ok
Mod Model Power Current Power Current Status Requested Requested Allocated Allocated
(Watts) (Amps) (Watts) (Amps)
--- ---------------------- ------- ---------- --------- ---------- ---------- 1 N3K-C3548P-10GX-SUP 349.20 29.10 349.20 29.10 powered-up Power Usage Summary: -------------------- Power Supply redundancy mode: Redundant Power Supply redundancy operational mode: Non-redundant Total Power Capacity 396.00 W Power reserved for Supervisor(s) 349.20 W Power currently used by Modules 0.00 W ------------- Total Power Available 46.80 W -------------

show environment power input

show environment power input

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 environment power input",
  "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": {
        "outputs": {
            "output": {
                "body": {
                    "powersup": {
                        "TABLE_psinputinfo": {
                            "ROW_psinputinfo": [
                                {
                                    "ps_input_current": "0.00", 
                                    "ps_input_voltage": "0.00", 
                                    "ps_output_current": "0.00", 
                                    "ps_output_voltage": "0.00", 
                                    "ps_power": "0.00", 
                                    "ps_slot": "1", 
                                    "ps_state": "fail/shutdown"
                                }, 
                                {
                                    "ps_input_current": "0.42", 
                                    "ps_input_voltage": "231.50", 
                                    "ps_output_current": "64.00", 
                                    "ps_output_voltage": "11.90", 
                                    "ps_power": "97.66", 
                                    "ps_slot": "7369986", 
                                    "ps_state": "ok"
                                }
                            ]
                        }, 
                        "total_power": "97.66  "
                    }
                }, 
                "code": "200", 
                "input": "show environment power input", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

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

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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show environment power input


Power Supply Input:
----------------------------------------------------------
PS  Voltage    Current    Power      Status 
    (Volt)     (Amp)      (Watt)
---------------------------------------------------------- 1 -- -- -- fail/shutdown
2 231.50 0.41 95.86 ok
---------------------------------------------------------- Total: 95.86

show environment temperature

show environment temperature

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 environment temperature",
  "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": {
        "outputs": {
            "output": {
                "body": {
                    "TABLE_tempinfo": {
                        "ROW_tempinfo": [
                            {
                                "alarmstatus": "ok", 
                                "curtemp": "46", 
                                "majthres": "92", 
                                "minthres": "85", 
                                "sensor": "ASIC", 
                                "tempmod": "1", 
                                "temptype": "Control"
                            }, 
                            {
                                "alarmstatus": "ok", 
                                "curtemp": "24", 
                                "majthres": "45", 
                                "minthres": "31", 
                                "sensor": "INTAKE", 
                                "tempmod": "1", 
                                "temptype": "Control"
                            }, 
                            {
                                "alarmstatus": "ok", 
                                "curtemp": "46", 
                                "majthres": "110", 
                                "minthres": "90", 
                                "sensor": "ASIC", 
                                "tempmod": "1", 
                                "temptype": "Monitor"
                            }, 
                            {
                                "alarmstatus": "ok", 
                                "curtemp": "24", 
                                "majthres": "70", 
                                "minthres": "40", 
                                "sensor": "INTAKE", 
                                "tempmod": "1", 
                                "temptype": "Monitor"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show environment temperature", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

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

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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show environment temperature

 Control Temperature
------------------------------------------------
 Sensor     MajorThresh   MinorThres   CurTemp
(Celsius) (Celsius) (Celsius) ------------------------------------------------ ASIC 92 85 46
INTAKE 45 31 24
------------------------------------------------ Monitor Temperature --------------------------------------------------------- Sensor MajorThresh MinorThres CurTemp Status (Celsius) (Celsius) (Celsius)
--------------------------------------------------------- ASIC 110 90 46 ok
INTAKE 70 40 24 ok
--------------------------------------------------------