Cisco Nexus 9000 Series NX-API CLI, Release 9.3(x)
Loading...
- Cisco Nexus 9000 Series NX-API CLI Reference, Release 9.3x
- About NX-API CLI
- New and Changed
- AAA Commands
- Accounting Commands
- Banner Commands
- Bash Shell Commands
- BGP Commands
- Boot Commands
- Callhome Commands
- CDP Commands
- CFS Commands
- Checkpoint Commands
- CLI Commands
- Clock Commands
- Config-Replace Commands
- Diagnostic Commands
- Dot1Q Commands
- Dot1X Commands
- Environment Commands
- Event Manager Commands
- FHRP Commands
- FIPS Commands
- Host Commands
- HSRP Commands
- Install Commands
- Interface Commands
- IP Commands
- IPv6 Commands
- ISIS Commands
- Key Commands
- L2 Protocol Commands
- LACP Commands
- Line Commands
- LLDP Commands
- Logging Commands
- MAC-Address Commands
- Maintenance Commands
- Module Commands
- NAT Commands
- NTP Commands
- NVE Commands
- NXAPI Commands
- OSPF Commands
- Password Commands
- Port-Channel Commands
- Port-Profile Commands
- Port-Security Commands
- Process Commands
- RADIUS Commands
- Redundancy Commands
- RMON Commands
- Role Commands
- Rollback Commands
- Route Map Commands
- Snapshot Commands
- SNMP Commands
- Socket Commands
- Spanning-Tree Commands
- SSH Commands
- Switchname Commands
- Switch-Profile Commands
- System Commands
- TACACS Commands
- Telnet Commands
- Terminal Commands
- Track Commands
- User Account Commands
- User Passphrase Commands
- Users Commands
- Version Commands
- VLAN Commands
- vPC Commands
- VRRPv3 Commands
- VRRS Commands
show sockets client tcp
Python
Copy
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 sockets client tcp",
"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 sockets client tcp",
"msg": "Success",
"code": "200",
"body": {
"TABLE_cl_sk": {
"ROW_cl_sk": [
{
"prefix": "",
"client-name": "dcos-xinetd",
"pid": 29001,
"No-of-clients": 3
},
{
"prefix": "",
"client-name": "sla_r",
"pid": 30259,
"No-of-clients": 100
},
{
"prefix": "",
"client-name": "sla_s",
"pid": 30258,
"No-of-clients": 56
},
{
"prefix": "",
"client-name": "nginx_1_fe",
"pid": 31175,
"No-of-clients": 4
},
{
"prefix": "",
"client-name": "nginx_1_fe",
"pid": 31181,
"No-of-clients": 5
},
{
"prefix": "",
"client-name": "snmpd",
"pid": 28997,
"No-of-clients": 2
},
{
"prefix": "",
"client-name": "dcos_sshd",
"pid": 11425,
"No-of-clients": 2
},
{
"prefix": "",
"client-name": "dcos_sshd",
"pid": 11441,
"No-of-clients": 2,
"TABLE_sp_cl": {
"ROW_sp_cl": {
"can-requests": 209958,
"can-unblocks": 182575,
"can-misses": 26808,
"sel-drops": 575,
"sel-wakes": 182575
}
}
}
]
},
"TABLE_total_clients": {
"ROW_total_clients": {
"socket-type": "TCP",
"total-clients": 8
}
}
}
}
}
}
}