Skip to content

Commit c96abc3

Browse files
Enric Perpinyà Pitarchmjbear
andauthored
Improve Huawei SmartAX: display_ont_wlan-status_0_1 (#2070)
* Adding new template for Huawei SmartAX: `display ont wlan-status 0 1` * Adding suggestions from @jmcgill298. Also adding extra test case. * Improving template for Huawei SmartAX: `display ont wlan-status 0 1` * Update whitespace and indents * Swap out \s* for \s+ in some cases to match raw output * Replace tab indents for two spaces --------- Co-authored-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
1 parent 64eb912 commit c96abc3

3 files changed

Lines changed: 104 additions & 38 deletions

File tree

ntc_templates/templates/huawei_smartax_display_ont_wlan-status_0_1.textfsm

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22,46 +22,47 @@ Value RSSI (\d+)
2222
Value SNR (\d+)
2323
Value SIGNAL_QUALITY_LEVEL (\S+|\S.+\S)
2424

25-
2625
Start
27-
^\s*-+\s*$$
28-
^\s*Command\s*is\s*being\s*executed\.\s*Please\s*wait\s*$$
29-
^\s*Channel\s*Information:\s*$$ -> channel_info
30-
^. -> Error
26+
^\s*-+\s*$$
27+
^\s*Command\s+is\s+being\s+executed\.\s+Please\s+wait\s*$$
28+
^\s*Channel\s+Information:\s*$$ -> Channel_Info
29+
^\s*Statistics\s+of\s+SSID:\s*$$ -> Statistics
30+
^\s*STA\s+Information:\s*$$ -> STA_Info
31+
^. -> Error
3132

32-
channel_info
33+
Channel_Info
3334
^\s*-+\s*$$
34-
^\s*Channel\s*Num\s*:\s*${CHANNEL_NUMBER}\s*$$
35-
^\s*AP\s*ID\s*:\s*${AP_ID}\s*$$
36-
^\s*AP\s*Number\s*:\s*${AP_NUMBER}\s*$$
37-
^\s*Interference\s*degree\s*:\s*${INTERFERENCE_DEGREE}\s*$$ -> Record
38-
^\s*Statistics\s*of\s*SSID\s*:\s*$$ -> Clear statistics
39-
^. -> Error
35+
^\s*Channel\s+Num\s+:\s+${CHANNEL_NUMBER}\s*$$
36+
^\s*AP\s+ID\s+:\s+${AP_ID}\s*$$
37+
^\s*AP\s+Number\s+:\s+${AP_NUMBER}\s*$$
38+
^\s*Interference\s+degree\s+:\s+${INTERFERENCE_DEGREE}\s*$$ -> Record
39+
^\s*Statistics\s+of\s+SSID:\s*$$ -> Clear Statistics
40+
^. -> Error
4041

41-
statistics
42-
^\s*-+\s*$$
43-
^\s*AP\s*ID\s*:\s*${AP_ID}\s*$$
44-
^\s*SSID\s*Index\s*:\s*${SSID_INDEX}\s*$$
45-
^\s*SSID\s*:\s*${SSID}\s*$$
46-
^\s*Sent\s*Packets\s*:\s*${SENT_PACKETS}\s*$$
47-
^\s*Sent\s*Error\s*Packets\s*:\s*${SENT_ERROR_PACKETS}\s*$$
48-
^\s*Sent\s*Discard\s*Packets\s*:\s*${SENT_DISCARD_PACKETS}\s*$$
49-
^\s*Received\s*Packets\s*:\s*${RECEIVED_PACKETS}\s*$$
50-
^\s*Received\s*Error\s*Packets\s*:\s*${RECEIVED_ERROR_PACKETS}\s*$$
51-
^\s*Received\s*Discard\s*Packets\s*:\s*${RECEIVED_DISCARD_PACKETS}\s*$$
52-
^\s*Transmission\s*Quality\s*Level\s*:\s*${TRANSMISSION_QUALITY_LEVEL}\s*$$ -> Record
53-
^\s*STA\s*Information:\s*$$ -> Clear sta_info
54-
^. -> Error
42+
Statistics
43+
^\s*-+\s*$$
44+
^\s*AP\s+ID\s+:\s+${AP_ID}\s*$$
45+
^\s*SSID\s+Index\s+:\s+${SSID_INDEX}\s*$$
46+
^\s*SSID\s+:\s+${SSID}\s*$$
47+
^\s*Sent\s+Packets\s+:\s+${SENT_PACKETS}\s*$$
48+
^\s*Sent\s+Error\s+Packets\s+:\s+${SENT_ERROR_PACKETS}\s*$$
49+
^\s*Sent\s+Discard\s+Packets\s+:\s+${SENT_DISCARD_PACKETS}\s*$$
50+
^\s*Received\s+Packets\s+:\s+${RECEIVED_PACKETS}\s*$$
51+
^\s*Received\s+Error\s+Packets\s+:\s+${RECEIVED_ERROR_PACKETS}\s*$$
52+
^\s*Received\s+Discard\s+Packets\s+:\s+${RECEIVED_DISCARD_PACKETS}\s*$$
53+
^\s*Transmission\s+Quality\s+Level\s+:\s+${TRANSMISSION_QUALITY_LEVEL}\s*$$ -> Record
54+
^\s*STA\s+Information:\s*$$ -> Clear STA_Info
55+
^. -> Error
5556

56-
sta_info
57-
^\s*-+\s*$$
58-
^\s*AP\s*ID\s*:\s*${AP_ID}\s*$$
59-
^\s*SSID\s*Index\s*:\s*${SSID_INDEX}\s*$$
60-
^\s*SSID\s*:\s*${SSID}\s*$$
61-
^\s*STA\s*Mac\s*Address\s*:\s*${STA_MAC_ADDRESS}\s*$$
62-
^\s*TxRate(?:\(Mbps\))?\s*:\s*${TX_RATE}\s*$$
63-
^\s*RxRate(?:\(Mbps\))?\s*:\s*${RX_RATE}\s*$$
64-
^\s*RSSI(?:\(dBm\))?\s*:\s*${RSSI}\s*$$
65-
^\s*SNR(?:\(dB\))?\s*:\s*${SNR}\s*$$
66-
^\s*Signal\s*Quality\s*Level\s*:\s*${SIGNAL_QUALITY_LEVEL}\s*$$ -> Record
67-
^. -> Error
57+
STA_Info
58+
^\s*-+\s*$$
59+
^\s*AP\s+ID\s+:\s+${AP_ID}\s*$$
60+
^\s*SSID\s+Index\s+:\s+${SSID_INDEX}\s*$$
61+
^\s*SSID\s+:\s+${SSID}\s*$$
62+
^\s*STA\s+Mac\s+Address\s+:\s+${STA_MAC_ADDRESS}\s*$$
63+
^\s*TxRate(?:\(Mbps\))?\s+:\s+${TX_RATE}\s*$$
64+
^\s*RxRate(?:\(Mbps\))?\s+:\s+${RX_RATE}\s*$$
65+
^\s*RSSI(?:\(dBm\))?\s+:\s+${RSSI}\s*$$
66+
^\s*SNR(?:\(dB\))?\s+:\s+${SNR}\s*$$
67+
^\s*Signal\s+Quality\s+Level\s+:\s+${SIGNAL_QUALITY_LEVEL}\s*$$ -> Record
68+
^. -> Error
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Command is being executed. Please wait
2+
Statistics of SSID:
3+
-----------------------------------------------------------------------------
4+
AP ID : ONU
5+
SSID Index : 1
6+
SSID : HUAWEI-2.4G-11TA(2.4G)
7+
Sent Packets : 0
8+
Sent Error Packets : 0
9+
Sent Discard Packets : 0
10+
Received Packets : 0
11+
Received Error Packets : 0
12+
Received Discard Packets : 0
13+
Transmission Quality Level : Good
14+
-----------------------------------------------------------------------------
15+
AP ID : ONU
16+
SSID Index : 5
17+
SSID : HUAWEI-5G-11TA(5G)
18+
Sent Packets : 763
19+
Sent Error Packets : 0
20+
Sent Discard Packets : 0
21+
Received Packets : 0
22+
Received Error Packets : 0
23+
Received Discard Packets : 0
24+
Transmission Quality Level : Good
25+
-----------------------------------------------------------------------------
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
parsed_sample:
3+
- ap_id: "ONU"
4+
ap_number: ""
5+
channel_number: ""
6+
interference_degree: ""
7+
received_discard_packets: "0"
8+
received_error_packets: "0"
9+
received_packets: "0"
10+
rssi: ""
11+
rx_rate: ""
12+
sent_discard_packets: "0"
13+
sent_error_packets: "0"
14+
sent_packets: "0"
15+
signal_quality_level: ""
16+
snr: ""
17+
ssid: "HUAWEI-2.4G-11TA(2.4G)"
18+
ssid_index: "1"
19+
sta_mac_address: ""
20+
transmission_quality_level: "Good"
21+
tx_rate: ""
22+
- ap_id: "ONU"
23+
ap_number: ""
24+
channel_number: ""
25+
interference_degree: ""
26+
received_discard_packets: "0"
27+
received_error_packets: "0"
28+
received_packets: "0"
29+
rssi: ""
30+
rx_rate: ""
31+
sent_discard_packets: "0"
32+
sent_error_packets: "0"
33+
sent_packets: "763"
34+
signal_quality_level: ""
35+
snr: ""
36+
ssid: "HUAWEI-5G-11TA(5G)"
37+
ssid_index: "5"
38+
sta_mac_address: ""
39+
transmission_quality_level: "Good"
40+
tx_rate: ""

0 commit comments

Comments
 (0)