Skip to content

Commit 64eb912

Browse files
Enric Perpinyà Pitarchjvanderaamjbear
authored
Add Huawei ONT: display portstatistics portnum 0 (#2050)
* New template for Huawei ONT: `display access mode` * Adding template for Huawei ONT: `display portstatistics portnum 1` * Fix index ordering * Replace whitespace regex * with + Since there are plenty of spaces present today, one or more whitespace character is accurate. * Add optional characters for vendor misspellings In case the vendor ever notices and fixes the misspellings this should still function -- or that's the hope! --------- Co-authored-by: Josh VanDeraa <jv@networktocode.com> Co-authored-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
1 parent dfc29d7 commit 64eb912

4 files changed

Lines changed: 138 additions & 0 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
Value RX_FIFO_OVERRUNS (\d+)
2+
Value RX_FCS_ERR (\d+)
3+
Value RX_OVER_MAX (\d+)
4+
Value RX_ALLIGN_ERR (\d+)
5+
Value RX (\d+)
6+
Value RX_UNICAST (\d+)
7+
Value RX_MULTICAST (\d+)
8+
Value RX_BROADCAST (\d+)
9+
Value RX_PAUSE (\d+)
10+
Value RX_UNDERSIZE (\d+)
11+
Value RX_FRAGMENTS (\d+)
12+
Value RX_JABBERS (\d+)
13+
Value RX_64 (\d+)
14+
Value RX_65_127 (\d+)
15+
Value RX_128_255 (\d+)
16+
Value RX_256_511 (\d+)
17+
Value RX_512_1023 (\d+)
18+
Value RX_1024_1518 (\d+)
19+
Value RX_OVERSIZE (\d+)
20+
Value RX_BYTE_OK (\d+)
21+
Value RX_BYTE_ERR (\d+)
22+
Value TX_EXCESS_COL (\d+)
23+
Value TX_LATE_COL (\d+)
24+
Value TX_SINGLE_COL (\d+)
25+
Value TX_MULTI_COL (\d+)
26+
Value TX (\d+)
27+
Value TX_UNICAST (\d+)
28+
Value TX_MULTICAST (\d+)
29+
Value TX_BROADCAST (\d+)
30+
Value TX_PAUSE (\d+)
31+
Value TX_BYTE_OK (\d+)
32+
33+
Start
34+
^\s*Ethernet\s+portid\s+=\s+\d+\s+packet\s+statistic\s+as\s+follows?:\s*$$
35+
^\s*-+\s*$$
36+
^\s*rx_fifo_overrun\s+:\s+${RX_FIFO_OVERRUNS}\s*$$
37+
^\s*rx_fcs_err\s+:\s+${RX_FCS_ERR}\s*$$
38+
^\s*rx_over_max\s+:\s+${RX_OVER_MAX}\s*$$
39+
^\s*rx_align_err\s+:\s+${RX_ALLIGN_ERR}\s*$$
40+
^\s*rx\s+:\s+${RX}\s*$$
41+
^\s*rx_uc\s+:\s+${RX_UNICAST}\s*$$
42+
^\s*rx_mc\s+:\s+${RX_MULTICAST}\s*$$
43+
^\s*rx_bc\s+:\s+${RX_BROADCAST}\s*$$
44+
^\s*rx_pause\s+:\s+${RX_PAUSE}\s*$$
45+
^\s*rx_undersize\s+:\s+${RX_UNDERSIZE}\s*$$
46+
^\s*rx_frage?ment\s+:\s+${RX_FRAGMENTS}\s*$$
47+
^\s*rx_jabber\s+:\s+${RX_JABBERS}\s*$$
48+
^\s*rx_64\s+:\s+${RX_64}\s*$$
49+
^\s*rx_65_127\s+:\s+${RX_65_127}\s*$$
50+
^\s*rx_128_255\s+:\s+${RX_128_255}\s*$$
51+
^\s*rx_256_511\s+:\s+${RX_256_511}\s*$$
52+
^\s*rx_512_1023\s+:\s+${RX_512_1023}\s*$$
53+
^\s*rx_1024_1518\s+:\s+${RX_1024_1518}\s*$$
54+
^\s*rx_oversize\s+:\s+${RX_OVERSIZE}\s*$$
55+
^\s*rx_byte_ok\s+:\s+${RX_BYTE_OK}\s*$$
56+
^\s*rx_byte_err\s+:\s+${RX_BYTE_ERR}\s*$$
57+
^\s*tx_excess_col\s+:\s+${TX_EXCESS_COL}\s*$$
58+
^\s*tx_late_col\s+:\s+${TX_LATE_COL}\s*$$
59+
^\s*tx_single_col\s+:\s+${TX_SINGLE_COL}\s*$$
60+
^\s*tx_multi_col\s+:\s+${TX_MULTI_COL}\s*$$
61+
^\s*tx\s+:\s+${TX}\s*$$
62+
^\s*tx_uc\s+:\s+${TX_UNICAST}\s*$$
63+
^\s*tx_mc\s+:\s+${TX_MULTICAST}\s*$$
64+
^\s*tx_bc\s+:\s+${TX_BROADCAST}\s*$$
65+
^\s*tx_pause\s+:\s+${TX_PAUSE}\s*$$
66+
^\s*tx_byte_ok\s+:\s+${TX_BYTE_OK}\s*$$
67+
^\s+$$
68+
^\s*success!\s*$$
69+
^. -> Error

ntc_templates/templates/index

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ hp_procurve_show_arp.textfsm, .*, (hp|aruba)_procurve, sh[[ow]] ar[[p]]
679679
hp_procurve_show_ip.textfsm, .*, (hp|aruba)_procurve, sh[[ow]] ip
680680

681681
huawei_ont_display_port_statistics_portid_0.textfsm, .*, huawei_ont, di[[splay]] p[[ort]] s[[tatistics]] po[[rtid]] \d+
682+
huawei_ont_display_portstatistics_portnum_0.textfsm, .*, huawei_ont, di[[splay]] po[[rtstatistics]] p[[ortnum]] \d+
682683
huawei_ont_display_flashlock_status.textfsm, .*, huawei_ont, di[[splay]] fl[[ashlock]] s[[tatus]]
683684
huawei_ont_display_wifi_information.textfsm, .*, huawei_ont, di[[splay]] w[[ifi]] i[[nformation]]
684685
huawei_ont_display_pppoe_em_result.textfsm, .*, huawei_ont, di[[splay]] pppoe(\s+|_)e[[m]] r[[esult]]
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Ethernet portid = 1 packet statistic as follow:
2+
--------------------------------------------------------
3+
rx_fifo_overrun : 0
4+
rx_fcs_err : 0
5+
rx_over_max : 0
6+
rx_align_err : 0
7+
rx : 79786
8+
rx_uc : 4569
9+
rx_mc : 4030
10+
rx_bc : 71187
11+
rx_pause : 0
12+
rx_undersize : 0
13+
rx_fragement : 0
14+
rx_jabber : 0
15+
rx_64 : 3140
16+
rx_65_127 : 62057
17+
rx_128_255 : 14279
18+
rx_256_511 : 180
19+
rx_512_1023 : 130
20+
rx_1024_1518 : 0
21+
rx_oversize : 0
22+
rx_byte_ok : 6989222
23+
rx_byte_err : 0
24+
tx_excess_col : 0
25+
tx_late_col : 0
26+
tx_single_col : 0
27+
tx_multi_col : 0
28+
tx : 3446
29+
tx_uc : 3445
30+
tx_mc : 0
31+
tx_bc : 1
32+
tx_pause : 0
33+
tx_byte_ok : 374234
34+
35+
success!
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
parsed_sample:
3+
- rx: "79786"
4+
rx_1024_1518: "0"
5+
rx_128_255: "14279"
6+
rx_256_511: "180"
7+
rx_512_1023: "130"
8+
rx_64: "3140"
9+
rx_65_127: "62057"
10+
rx_allign_err: "0"
11+
rx_broadcast: "71187"
12+
rx_byte_err: "0"
13+
rx_byte_ok: "6989222"
14+
rx_fcs_err: "0"
15+
rx_fifo_overruns: "0"
16+
rx_fragments: "0"
17+
rx_jabbers: "0"
18+
rx_multicast: "4030"
19+
rx_over_max: "0"
20+
rx_oversize: "0"
21+
rx_pause: "0"
22+
rx_undersize: "0"
23+
rx_unicast: "4569"
24+
tx: "3446"
25+
tx_broadcast: "1"
26+
tx_byte_ok: "374234"
27+
tx_excess_col: "0"
28+
tx_late_col: "0"
29+
tx_multi_col: "0"
30+
tx_multicast: "0"
31+
tx_pause: "0"
32+
tx_single_col: "0"
33+
tx_unicast: "3445"

0 commit comments

Comments
 (0)