Skip to content

Commit a823547

Browse files
evilmonkey19mjbear
andauthored
Add Huawei VRP display ap all (#2174)
* New template for Huawei VRP: `display ap all` * Normalize MAC, IP, and EXTRAINFO capture groups --------- Co-authored-by: Michael Bear <[email protected]>
1 parent 7de42af commit a823547

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Value ID (\d+)
2+
Value MAC_ADDRESS (\S+)
3+
Value NAME (\S.+\S|\S+)
4+
Value GROUP (\S+)
5+
Value IP_ADDRESS (\S+)
6+
Value TYPE (\S+)
7+
Value STATE (\S+)
8+
Value STA (\d+)
9+
Value UPTIME (\S+)
10+
Value EXTRA_INFO (\S+)
11+
Value SCENE (\S+)
12+
13+
Start
14+
^\s*Total\s+AP\s+information:\s*$$
15+
^\s*fault\s+:\s+fault\s+\[\d+\]\s*$$
16+
^\s*idle\s+:\s+idle\s+\[\d+\]\s*$$
17+
^\s*nor\s+:\s+normal\s+\[\d+\]\s*$$
18+
^\s*stdby\s+:\s+standby\s+\[\d+\]\s*$$
19+
^\s*ExtraInfo\s+:\s+Extra\s+information\s*$$
20+
^\s*P\s+:\s+insufficient\s+power\s+supply\s*$$
21+
^\s*-+\s*$$
22+
^\s*ID\s+MAC\s+Name\s+Group\s+IP\s+Type\s+State\s+STA\s+Uptime\s+ExtraInfo\s+Scene\s*$$
23+
^\s*${ID}\s+${MAC_ADDRESS}\s+${NAME}\s+${GROUP}\s+(-|${IP_ADDRESS})\s+(-|${TYPE})\s+${STATE}\s+${STA}\s+(-|${UPTIME})\s+(-|${EXTRA_INFO})\s+(-|${SCENE})\s*$$ -> Record
24+
^\s*Total:\s+\d+\s*$$
25+
^. -> Error

ntc_templates/templates/index

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ huawei_vrp_display_acl_all.textfsm, .*, huawei_vrp, dis[[play]] acl(\si[[pv6]])?
780780
huawei_vrp_display_arp_all.textfsm, .*, huawei_vrp, disp[[lay]] ar[[p]] all
781781
huawei_vrp_display_startup.textfsm, .*, huawei_vrp, dis[[play]] star[[tup]]
782782
huawei_vrp_display_version.textfsm, .*, huawei_vrp, dis[[play]] ver[[sion]]
783+
huawei_vrp_display_ap_all.textfsm, .*, huawei_vrp, di[[splay]] ap a[[ll]]
783784
huawei_vrp_display_device.textfsm, .*, huawei_vrp, di[[splay]] de[[vice]]( a[[ll]]|c[[ard]])?
784785
huawei_vrp_display_vlan.textfsm, .*, huawei_vrp, di[[splay]] v[[lan]]
785786
huawei_vrp_dir.textfsm, .*, huawei_vrp, d[[ir]]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Total AP information:
2+
fault : fault [1]
3+
idle : idle [1]
4+
nor : normal [1]
5+
stdby : standby [1]
6+
ExtraInfo : Extra information
7+
P : insufficient power supply
8+
--------------------------------------------------------------------------------------------------------------------------------------------------------------
9+
ID MAC Name Group IP Type State STA Uptime ExtraInfo Scene
10+
--------------------------------------------------------------------------------------------------------------------------------------------------------------
11+
0 aaaa-aaaa-aaaa APW_0055(WC VIP) AP_GROUP_OBIWAN 11.11.11.11 AirEngine1111-11 nor 0 4D:1H:10M:0S - -
12+
1 bbbb-bbbb-bbbb APW_0001 AP_GROUP_HELLO - - idle 0 - P -
13+
2 cccc-cccc-cccc APW_0002 AP_GROUP_THERE - AirEngine1111R-11E fault 0 - - -
14+
3 dddd-dddd-dddd APW_0003(Parkin VIP) AP_GROUP_STAR_WARS 22.22.22.22 AirEngine1111R-11E stdby 0 17D:11H:4M:28S P -
15+
--------------------------------------------------------------------------------------------------------------------------------------------------------------
16+
Total: 4
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
parsed_sample:
3+
- extra_info: ""
4+
group: "AP_GROUP_OBIWAN"
5+
id: "0"
6+
ip_address: "11.11.11.11"
7+
mac_address: "aaaa-aaaa-aaaa"
8+
name: "APW_0055(WC VIP)"
9+
scene: ""
10+
sta: "0"
11+
state: "nor"
12+
type: "AirEngine1111-11"
13+
uptime: "4D:1H:10M:0S"
14+
- extra_info: "P"
15+
group: "AP_GROUP_HELLO"
16+
id: "1"
17+
ip_address: ""
18+
mac_address: "bbbb-bbbb-bbbb"
19+
name: "APW_0001"
20+
scene: ""
21+
sta: "0"
22+
state: "idle"
23+
type: ""
24+
uptime: ""
25+
- extra_info: ""
26+
group: "AP_GROUP_THERE"
27+
id: "2"
28+
ip_address: ""
29+
mac_address: "cccc-cccc-cccc"
30+
name: "APW_0002"
31+
scene: ""
32+
sta: "0"
33+
state: "fault"
34+
type: "AirEngine1111R-11E"
35+
uptime: ""
36+
- extra_info: "P"
37+
group: "AP_GROUP_STAR_WARS"
38+
id: "3"
39+
ip_address: "22.22.22.22"
40+
mac_address: "dddd-dddd-dddd"
41+
name: "APW_0003(Parkin VIP)"
42+
scene: ""
43+
sta: "0"
44+
state: "stdby"
45+
type: "AirEngine1111R-11E"
46+
uptime: "17D:11H:4M:28S"

0 commit comments

Comments
 (0)