This section documents selected examples of NX-OS commands that are displayed as XML and JSON output.
This example shows how to display the unicast and multicast routing entries in hardware tables in JSON format:
switch(config)# show hardware profile status | json
{"total_lpm": ["8191", "1024"], "total_host": "8192", "max_host4_limit": "4096",
"max_host6_limit": "2048", "max_mcast_limit": "2048", "used_lpm_total": "9", "u
sed_v4_lpm": "6", "used_v6_lpm": "3", "used_v6_lpm_128": "1", "used_host_lpm_tot
al": "0", "used_host_v4_lpm": "0", "used_host_v6_lpm": "0", "used_mcast": "0", "
used_mcast_oifl": "2", "used_host_in_host_total": "13", "used_host4_in_host": "1
2", "used_host6_in_host": "1", "max_ecmp_table_limit": "64", "used_ecmp_table":
"0", "mfib_fd_status": "Disabled", "mfib_fd_maxroute": "0", "mfib_fd_count": "0"
}
switch(config)#
This example shows how to display the unicast and multicast routing entries in hardware tables in XML format:
switch(config)# show hardware profile status | xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns:nf="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="http://w
ww.cisco.com/nxos:1.0:fib">
<nf:data>
<show>
<hardware>
<profile>
<status>
<__XML__OPT_Cmd_dynamic_tcam_status>
<__XML__OPT_Cmd_dynamic_tcam_status___readonly__>
<__readonly__>
<total_lpm>8191</total_lpm>
<total_host>8192</total_host>
<total_lpm>1024</total_lpm>
<max_host4_limit>4096</max_host4_limit>
<max_host6_limit>2048</max_host6_limit>
<max_mcast_limit>2048</max_mcast_limit>
<used_lpm_total>9</used_lpm_total>
<used_v4_lpm>6</used_v4_lpm>
<used_v6_lpm>3</used_v6_lpm>
<used_v6_lpm_128>1</used_v6_lpm_128>
<used_host_lpm_total>0</used_host_lpm_total>
<used_host_v4_lpm>0</used_host_v4_lpm>
<used_host_v6_lpm>0</used_host_v6_lpm>
<used_mcast>0</used_mcast>
<used_mcast_oifl>2</used_mcast_oifl>
<used_host_in_host_total>13</used_host_in_host_total>
<used_host4_in_host>12</used_host4_in_host>
<used_host6_in_host>1</used_host6_in_host>
<max_ecmp_table_limit>64</max_ecmp_table_limit>
<used_ecmp_table>0</used_ecmp_table>
<mfib_fd_status>Disabled</mfib_fd_status>
<mfib_fd_maxroute>0</mfib_fd_maxroute>
<mfib_fd_count>0</mfib_fd_count>
</__readonly__>
</__XML__OPT_Cmd_dynamic_tcam_status___readonly__>
</__XML__OPT_Cmd_dynamic_tcam_status>
</status>
</profile>
</hardware>
</show>
</nf:data>
</nf:rpc-reply>
]]>]]>
switch(config)#
This example shows how to display LLDP timers that are configured on the switch in JSON format:
switch(config)# show lldp timers | json
{"ttl": "120", "reinit": "2", "tx_interval": "30", "tx_delay": "2", "hold_mplier
": "4", "notification_interval": "5"}
switch(config)#
This example shows how to display LLDP timers that are configured on the switch in XML format:
switch(config)# show lldp timers | xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns:nf="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="http://w
ww.cisco.com/nxos:1.0:lldp">
<nf:data>
<show>
<lldp>
<timers>
<__XML__OPT_Cmd_lldp_show_timers___readonly__>
<__readonly__>
<ttl>120</ttl>
<reinit>2</reinit>
<tx_interval>30</tx_interval>
<tx_delay>2</tx_delay>
<hold_mplier>4</hold_mplier>
<notification_interval>5</notification_interval>
</__readonly__>
</__XML__OPT_Cmd_lldp_show_timers___readonly__>
</timers>
</lldp>
</show>
</nf:data>
</nf:rpc-reply>
]]>]]>
switch(config)#
This example shows how to display ACL statistics in XML format.switch-1(config-acl)# show ip access-lists acl-test1 | xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:1.0:aclmgr" xmlns:nf="urn:ietf:p
arams:xml:ns:netconf:base:1.0">
<nf:data>
<show>
<__XML__OPT_Cmd_show_acl_ip_ipv6_mac>
<ip_ipv6_mac>ip</ip_ipv6_mac>
<access-lists>
<__XML__OPT_Cmd_show_acl_name>
<name>acl-test1</name>
<__XML__OPT_Cmd_show_acl_capture>
<__XML__OPT_Cmd_show_acl_expanded>
<__XML__OPT_Cmd_show_acl___readonly__>
<__readonly__>
<TABLE_ip_ipv6_mac>
<ROW_ip_ipv6_mac>
<op_ip_ipv6_mac>ip</op_ip_ipv6_mac>
<show_summary>0</show_summary>
<acl_name>acl-test1</acl_name>
<statistics>enable</statistics>
<frag_opt_permit_deny>permit-all</frag_opt_permit_deny>
<TABLE_seqno>
<ROW_seqno>
<seqno>10</seqno>
<permitdeny>permit</permitdeny>
<ip>ip</ip>
<src_ip_prefix>192.0.2.1/24</src_ip_prefix>
<dest_any>any</dest_any>
</ROW_seqno>
</TABLE_seqno>
</ROW_ip_ipv6_mac>
</TABLE_ip_ipv6_mac>
</__readonly__>
</__XML__OPT_Cmd_show_acl___readonly__>
</__XML__OPT_Cmd_show_acl_expanded>
</__XML__OPT_Cmd_show_acl_capture>
</__XML__OPT_Cmd_show_acl_name>
</access-lists>
</__XML__OPT_Cmd_show_acl_ip_ipv6_mac>
</show>
</nf:data>
</nf:rpc-reply>
]]>]]>
switch-1(config-acl)#
This example shows how to display ACL statistics in JSON format.switch-1(config-acl)# show ip access-lists acl-test1 | json
{"TABLE_ip_ipv6_mac": {"ROW_ip_ipv6_mac": {"op_ip_ipv6_mac": "ip", "show_summar
y": "0", "acl_name": "acl-test1", "statistics": "enable", "frag_opt_permit_deny
": "permit-all", "TABLE_seqno": {"ROW_seqno": {"seqno": "10", "permitdeny": "pe
rmit", "ip": "ip", "src_ip_prefix": "192.0.2.1/24", "dest_any": "any"}}}}}
switch-1(config-acl)#
The following example shows how to display the switch's redundancy status in JSON format.switch-1# show system redundancy status | json
{"rdn_mode_admin": "HA", "rdn_mode_oper": "None", "this_sup": "(sup-1)", "this_
sup_rdn_state": "Active, SC not present", "this_sup_sup_state": "Active", "this
_sup_internal_state": "Active with no standby", "other_sup": "(sup-1)", "other_
sup_rdn_state": "Not present"}
nxosv2#
switch-1#
This example shows how to display the switch's redundancy information in JSON Pretty Native format.switch-1# show system redundancy status | json-pretty native
{
"rdn_mode_admin": "HA",
"rdn_mode_oper": "None",
"this_sup": "(sup-1)",
"this_sup_rdn_state": "Active, SC not present",
"this_sup_sup_state": "Active",
"this_sup_internal_state": "Active with no standby",
"other_sup": "(sup-1)",
"other_sup_rdn_state": "Not present"
}
switch-1#
The following example shows how to display the switch's OSPF routing parameters in JSON Native format.switch-1# show ip ospf | json native
{"TABLE_ctx":{"ROW_ctx":[{"ptag":"Blah","instance_number":4,"cname":"default","
rid":"0.0.0.0","stateful_ha":"true","gr_ha":"true","gr_planned_only":"true","gr
_grace_period":"PT60S","gr_state":"inactive","gr_last_status":"None","support_t
os0_only":"true","support_opaque_lsa":"true","is_abr":"false","is_asbr":"false"
,"admin_dist":110,"ref_bw":40000,"spf_start_time":"PT0S","spf_hold_time":"PT1S"
,"spf_max_time":"PT5S","lsa_start_time":"PT0S","lsa_hold_time":"PT5S","lsa_max_
time":"PT5S","min_lsa_arr_time":"PT1S","lsa_aging_pace":10,"spf_max_paths":8,"m
ax_metric_adver":"false","asext_lsa_cnt":0,"asext_lsa_crc":"0","asopaque_lsa_cn
t":0,"asopaque_lsa_crc":"0","area_total":0,"area_normal":0,"area_stub":0,"area_
nssa":0,"act_area_total":0,"act_area_normal":0,"act_area_stub":0,"act_area_nssa
":0,"no_discard_rt_ext":"false","no_discard_rt_int":"false"},{"ptag":"100","ins
tance_number":3,"cname":"default","rid":"0.0.0.0","stateful_ha":"true","gr_ha":
"true","gr_planned_only":"true","gr_grace_period":"PT60S","gr_state":"inactive"
,"gr_last_status":"None","support_tos0_only":"true","support_opaque_lsa":"true"
,"is_abr":"false","is_asbr":"false","admin_dist":110,"ref_bw":40000,"spf_start_
time":"PT0S","spf_hold_time":"PT1S","spf_max_time":"PT5S","lsa_start_time":"PT0
S","lsa_hold_time":"PT5S","lsa_max_time":"PT5S","min_lsa_arr_time":"PT1S","lsa_
aging_pace":10,"spf_max_paths":8,"max_metric_adver":"false","asext_lsa_cnt":0,"
asext_lsa_crc":"0","asopaque_lsa_cnt":0,"asopaque_lsa_crc":"0","area_total":0,"
area_normal":0,"area_stub":0,"area_nssa":0,"act_area_total":0,"act_area_normal"
:0,"act_area_stub":0,"act_area_nssa":0,"no_discard_rt_ext":"false","no_discard_
rt_int":"false"},{"ptag":"111","instance_number":1,"cname":"default","rid":"0.0
.0.0","stateful_ha":"true","gr_ha":"true","gr_planned_only":"true","gr_grace_pe
riod":"PT60S","gr_state":"inactive","gr_last_status":"None","support_tos0_only"
:"true","support_opaque_lsa":"true","is_abr":"false","is_asbr":"false","admin_d
ist":110,"ref_bw":40000,"spf_start_time":"PT0S","spf_hold_time":"PT1S","spf_max
_time":"PT5S","lsa_start_time":"PT0S","lsa_hold_time":"PT5S","lsa_max_time":"PT
5S","min_lsa_arr_time":"PT1S","lsa_aging_pace":10,"spf_max_paths":8,"max_metric
_adver":"false","asext_lsa_cnt":0,"asext_lsa_crc":"0","asopaque_lsa_cnt":0,"aso
paque_lsa_crc":"0","area_total":0,"area_normal":0,"area_stub":0,"area_nssa":0,"
act_area_total":0,"act_area_normal":0,"act_area_stub":0,"act_area_nssa":0,"no_d
iscard_rt_ext":"false","no_discard_rt_int":"false"},{"ptag":"112","instance_num
ber":2,"cname":"default","rid":"0.0.0.0","stateful_ha":"true","gr_ha":"true","g
r_planned_only":"true","gr_grace_period":"PT60S","gr_state":"inactive","gr_last
_status":"None","support_tos0_only":"true","support_opaque_lsa":"true","is_abr"
:"false","is_asbr":"false","admin_dist":110,"ref_bw":40000,"spf_start_time":"PT
0S","spf_hold_time":"PT1S","spf_max_time":"PT5S","lsa_start_time":"PT0S","lsa_h
old_time":"PT5S","lsa_max_time":"PT5S","min_lsa_arr_time":"PT1S","lsa_aging_pac
e":10,"spf_max_paths":8,"max_metric_adver":"false","asext_lsa_cnt":0,"asext_lsa
_crc":"0","asopaque_lsa_cnt":0,"asopaque_lsa_crc":"0","area_total":0,"area_norm
al":0,"area_stub":0,"area_nssa":0,"act_area_total":0,"act_area_normal":0,"act_a
rea_stub":0,"act_area_nssa":0,"no_discard_rt_ext":"false","no_discard_rt_int":"
false"}]}}
switch-1#
The following example shows how to display OSPF routing parameters in JSON Pretty Native format.switch-1# show ip ospf | json-pretty native
{
"TABLE_ctx": {
"ROW_ctx": [{
"ptag": "Blah",
"instance_number": 4,
"cname": "default",
"rid": "0.0.0.0",
"stateful_ha": "true",
"gr_ha": "true",
"gr_planned_only": "true",
"gr_grace_period": "PT60S",
"gr_state": "inactive",
"gr_last_status": "None",
"support_tos0_only": "true",
"support_opaque_lsa": "true",
"is_abr": "false",
"is_asbr": "false",
"admin_dist": 110,
"ref_bw": 40000,
"spf_start_time": "PT0S",
"spf_hold_time": "PT1S",
"spf_max_time": "PT5S",
"lsa_start_time": "PT0S",
"lsa_hold_time": "PT5S",
"lsa_max_time": "PT5S",
"min_lsa_arr_time": "PT1S",
"lsa_aging_pace": 10,
"spf_max_paths": 8,
"max_metric_adver": "false",
"asext_lsa_cnt": 0,
"asext_lsa_crc": "0",
"asopaque_lsa_cnt": 0,
"asopaque_lsa_crc": "0",
"area_total": 0,
"area_normal": 0,
"area_stub": 0,
"area_nssa": 0,
"act_area_total": 0,
"act_area_normal": 0,
"act_area_stub": 0,
"act_area_nssa": 0,
"no_discard_rt_ext": "false",
"no_discard_rt_int": "false"
}, {
"ptag": "100",
"instance_number": 3,
"cname": "default",
"rid": "0.0.0.0",
"stateful_ha": "true",
"gr_ha": "true",
"gr_planned_only": "true",
"gr_grace_period": "PT60S",
"gr_state": "inactive",
... content deleted for brevity ...
"max_metric_adver": "false",
"asext_lsa_cnt": 0,
"asext_lsa_crc": "0",
"asopaque_lsa_cnt": 0,
"asopaque_lsa_crc": "0",
"area_total": 0,
"area_normal": 0,
"area_stub": 0,
"area_nssa": 0,
"act_area_total": 0,
"act_area_normal": 0,
"act_area_stub": 0,
"act_area_nssa": 0,
"no_discard_rt_ext": "false",
"no_discard_rt_int": "false"
}]
}
}
switch-1#
The following example shows how to display the IP route summary in XML format. switch-1# show ip route summary | xml
<?xml version="1.0" encoding="ISO-8859-1"?> <nf:rpc-reply xmlns="http://www.cisco.com/nxos:1.0:urib" xmlns:nf="urn:ietf:params:xml:ns:netconf:base:1.0">
<nf:data>
<show>
<ip>
<route>
<__XML__OPT_Cmd_urib_show_ip_route_command_ip>
<__XML__OPT_Cmd_urib_show_ip_route_command_unicast>
<__XML__OPT_Cmd_urib_show_ip_route_command_topology>
<__XML__OPT_Cmd_urib_show_ip_route_command_l3vm-info>
<__XML__OPT_Cmd_urib_show_ip_route_command_rpf>
<__XML__OPT_Cmd_urib_show_ip_route_command_ip-addr>
<__XML__OPT_Cmd_urib_show_ip_route_command_protocol>
<__XML__OPT_Cmd_urib_show_ip_route_command_summary>
<__XML__OPT_Cmd_urib_show_ip_route_command_vrf>
<__XML__OPT_Cmd_urib_show_ip_route_command___readonly__>
<__readonly__>
<TABLE_vrf>
<ROW_vrf>
<vrf-name-out>default</vrf-name-out>
<TABLE_addrf>
<ROW_addrf>
<addrf>ipv4</addrf>
<TABLE_summary>
<ROW_summary>
<routes>938</routes>
<paths>1453</paths>
<TABLE_unicast>
<ROW_unicast>
<clientnameuni>am</clientnameuni>
<best-paths>2</best-paths>
</ROW_unicast>
<ROW_unicast>
<clientnameuni>local</clientnameuni>
<best-paths>105</best-paths>
</ROW_unicast>
<ROW_unicast>
<clientnameuni>direct</clientnameuni>
<best-paths>105</best-paths>
</ROW_unicast>
<ROW_unicast>
<clientnameuni>broadcast</clientnameuni>
<best-paths>203</best-paths>
</ROW_unicast>
<ROW_unicast>
<clientnameuni>ospf-10</clientnameuni>
<best-paths>1038</best-paths>
</ROW_unicast>
</TABLE_unicast>
<TABLE_route_count>
<ROW_route_count>
<mask_len>8</mask_len>
<count>1</count>
</ROW_route_count>
<ROW_route_count>
<mask_len>24</mask_len>
<count>600</count>
</ROW_route_count>
<ROW_route_count>
<mask_len>31</mask_len>
<count>13</count>
</ROW_route_count>
<ROW_route_count>
<mask_len>32</mask_len>
<count>324</count>
</ROW_route_count>
</TABLE_route_count>
</ROW_summary>
</TABLE_summary>
</ROW_addrf>
</TABLE_addrf>
</ROW_vrf>
</TABLE_vrf>
</__readonly__>
</__XML__OPT_Cmd_urib_show_ip_route_command___readonly__>
</__XML__OPT_Cmd_urib_show_ip_route_command_vrf>
</__XML__OPT_Cmd_urib_show_ip_route_command_summary>
</__XML__OPT_Cmd_urib_show_ip_route_command_protocol>
</__XML__OPT_Cmd_urib_show_ip_route_command_ip-addr>
</__XML__OPT_Cmd_urib_show_ip_route_command_rpf>
</__XML__OPT_Cmd_urib_show_ip_route_command_l3vm-info>
</__XML__OPT_Cmd_urib_show_ip_route_command_topology>
</__XML__OPT_Cmd_urib_show_ip_route_command_unicast>
</__XML__OPT_Cmd_urib_show_ip_route_command_ip>
</route>
</ip>
</show>
</nf:data>
</nf:rpc-reply>
]]>]]>
switch-1#
The following example shows how to display the IP route summary in JSON format. switch-1# show ip route summary | json
{"TABLE_vrf": {"ROW_vrf": {"vrf-name-out": "default", "TABLE_addrf": {"ROW_addrf": {"addrf": "ipv4", "TABLE_summary": {"ROW_summary": {"routes": "938", "paths": "
1453", "TABLE_unicast": {"ROW_unicast": [{"clientnameuni": "am", "best-paths": "2"}, {"clientnameuni": "local", "best-paths": "105"}, {"clientnameuni": "direct",
"best-paths": "105"}, {"clientnameuni": "broadcast", "best-paths": "203"}, {"clientnameuni": "ospf-10", "best-paths": "1038"}]}, "TABLE_route_count": {"ROW_route_
count": [{"mask_len": "8", "count": "1"}, {"mask_len": "24", "count": "600"}, {"mask_len": "31", "count": "13"}, {"mask_len": "32", "count": "324"}]}}}}}}}}
switch-1#
The following example shows how to display the IP route summary in JSON Pretty format.switch-1# show ip route summary | json-pretty
{
"TABLE_vrf": {
"ROW_vrf": {
"vrf-name-out": "default",
"TABLE_addrf": {
"ROW_addrf": {
"addrf": "ipv4",
"TABLE_summary": {
"ROW_summary": {
"routes": "938",
"paths": "1453",
"TABLE_unicast": {
"ROW_unicast": [
{
"clientnameuni": "am",
"best-paths": "2"
},
{
"clientnameuni": "local",
"best-paths": "105"
},
{
"clientnameuni": "direct",
"best-paths": "105"
},
{
"clientnameuni": "broadcast",
"best-paths": "203"
},
{
"clientnameuni": "ospf-10",
"best-paths": "1038"
}
]
},
"TABLE_route_count": {
"ROW_route_count": [
{
"mask_len": "8",
"count": "1"
},
{
"mask_len": "24",
"count": "600"
},
{
"mask_len": "31",
"count": "13"
},
{
"mask_len": "32",
"count": "324"
}
]
}
}
}
}
}
}
}
}
switch-1#
The following example shows how to display the IP route table in JSON native format.switch-1(config)# show ip route summary | json native
{"TABLE_vrf":{"ROW_vrf":[{"vrf-name-out":"default","TABLE_addrf":{"ROW_addrf":[{"addrf":"ipv4","TABLE_summary":{"ROW_summary":[{"routes":3,"p
aths":3,"TABLE_unicast":{"ROW_unicast":[{"clientnameuni":"broadcast","best-paths":3}]},"TABLE_route_count":{"ROW_route_count":[{"mask_len":8,
"count":1},{"mask_len":32,"count":2}]}}]}}]}}]}}
switch-1(config)#
Notice that with JSON native (as well as JSON pretty native), integers are represented as true integers. For example,"mask
len:" is displayed as the actual value of 32.
The following example shows to display the IP route table in JSON Pretty Native format.switch-1(config)# show ip route summary | json-pretty native
{
"TABLE_vrf": {
"ROW_vrf": [{
"vrf-name-out": "default",
"TABLE_addrf": {
"ROW_addrf": [{
"addrf": "ipv4",
"TABLE_summary": {
"ROW_summary": [{
"routes": 3,
"paths": 3,
"TABLE_unicast": {
"ROW_unicast": [{
"clientnameuni": "broadcast",
"best-paths": 3
}]
},
"TABLE_route_count": {
"ROW_route_count":[{
"mask_len": 8,
"count": 1
}, {
"mask_len": 32,
"count": 2
}]
}
}]
}
}]
}
}]
}
}
switch-1(config)#