diff --git a/ntc_templates/templates/cisco_ios_show_power_inline.textfsm b/ntc_templates/templates/cisco_ios_show_power_inline.textfsm new file mode 100644 index 0000000000..cf9de56ff4 --- /dev/null +++ b/ntc_templates/templates/cisco_ios_show_power_inline.textfsm @@ -0,0 +1,24 @@ +Value INTERFACE (\S+) +Value ADMIN_STATUS (\S+) +Value OPERATIONAL_STATUS (on|off) +Value POWER (\d+\.\d+) +Value DEVICE (\S+(\s\S+)*) +Value CLASS (\d|n/a) +Value MAX (\d+\.\d+) + +Start + ^Interface\s+Admin\s+Oper\s+Power\s+Device\s+Class\s+Max -> Interfaces + ^Module + ^\d+ + ^-+ + ^\s+\(Watts\) + ^\s*$$ + ^. -> Error + +Interfaces + ^\s*${INTERFACE}\s+${ADMIN_STATUS}\s+${OPERATIONAL_STATUS}\s+${POWER}\s+${DEVICE}\s+${CLASS}\s+${MAX}\s*$$ -> Record + ^Totals.* + ^\s+\(Watts\) + ^-+ + ^\s*$$ + ^. -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 270a6ec688..2275b93311 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -278,7 +278,7 @@ cisco_ios_show_ip_route_summary.textfsm, .*, cisco_ios, sh[[ow]] ip ro[[ute]] su cisco_ios_show_ip_access-lists.textfsm, .*, cisco_ios, sh[[ow]] ip acce[[ss-lists]] cisco_ios_show_ip_dhcp_binding.textfsm, .*, cisco_ios, sh[[ow]] ip dh[[cp]] b[[inding]] cisco_ios_show_mpls_interfaces.textfsm, .*, cisco_ios, sh[[ow]] mpls interfa[[ces]] -cisco_ios_show_power_available.textfsm, .*, cisco_ios, sh[[ow]] pow[[er]] a[[vailable]] +cisco_ios_show_power_available.textfsm, .*, cisco_ios, sh[[ow]] pow[[er]] a[[vailable]] cisco_ios_show_access-session.textfsm, .*, cisco_ios, show access-s[[ession]] cisco_ios_show_alert_counters.textfsm, .*, cisco_ios, sh[[ow]] alert [[counters]] cisco_ios_show_interface_link.textfsm, .*, cisco_ios, sh[[ow]] int[[erfaces]] li[[nk]] @@ -301,6 +301,7 @@ cisco_ios_show_standby_brief.textfsm, .*, cisco_ios, sh[[ow]] standby(?:\s+\S+)? cisco_ios_show_file_systems.textfsm, .*, cisco_ios, sh[[ow]] fi[[le]] s[[ystems]] cisco_ios_show_ip_interface.textfsm, .*, cisco_ios, sh[[ow]] ip int[[erface]] cisco_ios_show_object-group.textfsm, .*, cisco_ios, sh[[ow]] ob[[ject-group]] +cisco_ios_show_power_inline.textfsm, .*, cisco_ios, sh[[ow]] pow[[er]] i[[nline]] cisco_ios_show_power_status.textfsm, .*, cisco_ios, sh[[ow]] pow[[er]] st[[atus]] cisco_ios_show_rep_topology.textfsm, .*, cisco_ios, sh[[ow]] rep topology cisco_ios_show_access-list.textfsm, .*, cisco_ios, sh[[ow]] acc[[ess-list]] diff --git a/tests/cisco_ios/show_power_inline/cisco_ios_show_power_inline.raw b/tests/cisco_ios/show_power_inline/cisco_ios_show_power_inline.raw new file mode 100644 index 0000000000..c30f0d0910 --- /dev/null +++ b/tests/cisco_ios/show_power_inline/cisco_ios_show_power_inline.raw @@ -0,0 +1,18 @@ + +Module Available Used Remaining + (Watts) (Watts) (Watts) +------ --------- -------- --------- +1 740.0 330.0 410.0 +Interface Admin Oper Power Device Class Max + (Watts) +--------- ------ ---------- ------- ------------------- ----- ---- +Gi1/0/1 auto on 30.0 AIR-AP1562I-E-K9 4 30.0 +Gi1/0/2 auto on 30.0 AIR-AP1562I-E-K9 4 30.0 +Gi1/0/3 auto on 30.0 AIR-AP1562I-E-K9 4 30.0 +Gi1/0/10 auto on 23.2 C9120AXE-E 4 30.0 +Gi1/0/11 auto on 30.0 AIR-AP1562I-E-K9 4 30.0 +Gi1/0/12 auto off 0.0 n/a n/a 30.0 +Gi1/0/13 auto off 0.0 n/a n/a 30.0 +--------- ------ ---------- ---------- ---------- ------ ----- +Totals: 11 on 330.0 + diff --git a/tests/cisco_ios/show_power_inline/cisco_ios_show_power_inline.yml b/tests/cisco_ios/show_power_inline/cisco_ios_show_power_inline.yml new file mode 100644 index 0000000000..135493120b --- /dev/null +++ b/tests/cisco_ios/show_power_inline/cisco_ios_show_power_inline.yml @@ -0,0 +1,51 @@ +--- +parsed_sample: +- admin_status: "auto" + class: "4" + device: "AIR-AP1562I-E-K9" + interface: "Gi1/0/1" + max: "30.0" + operational_status: "on" + power: "30.0" +- admin_status: "auto" + class: "4" + device: "AIR-AP1562I-E-K9" + interface: "Gi1/0/2" + max: "30.0" + operational_status: "on" + power: "30.0" +- admin_status: "auto" + class: "4" + device: "AIR-AP1562I-E-K9" + interface: "Gi1/0/3" + max: "30.0" + operational_status: "on" + power: "30.0" +- admin_status: "auto" + class: "4" + device: "C9120AXE-E" + interface: "Gi1/0/10" + max: "30.0" + operational_status: "on" + power: "23.2" +- admin_status: "auto" + class: "4" + device: "AIR-AP1562I-E-K9" + interface: "Gi1/0/11" + max: "30.0" + operational_status: "on" + power: "30.0" +- admin_status: "auto" + class: "n/a" + device: "n/a" + interface: "Gi1/0/12" + max: "30.0" + operational_status: "off" + power: "0.0" +- admin_status: "auto" + class: "n/a" + device: "n/a" + interface: "Gi1/0/13" + max: "30.0" + operational_status: "off" + power: "0.0"