Skip to content

Commit bc97d2a

Browse files
painetamjbear
andauthored
Cisco IOS-XE additional transceiver data (CURRENT) (#2129)
* IOS-XE outputs a Current value for each Transceiver. Added CURRENT to the record data, or will be blank value for legacy IOS output. * Fleshed out template to now include an Error directive. * Change line ending whitespace regex * Update ntc_templates/templates/cisco_ios_show_interface_transceiver.textfsm Co-authored-by: Michael Bear <[email protected]> * Adopted more explicit pattern matches and added No Optic/DOM type messages. * Swap regexes for literal white spaces * Conforming to whitespace matching preference. --------- Co-authored-by: Michael Bear <[email protected]>
1 parent 5c4351f commit bc97d2a

File tree

4 files changed

+63
-5
lines changed

4 files changed

+63
-5
lines changed
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
Value INTERFACE (\w+\d+\/\S+)
22
Value TEMPERATURE (\d+.\d+)
33
Value VOLTAGE (\d+.\d+)
4+
Value CURRENT (\d+.\d+)
45
Value TX_PWR (\S+)
56
Value RX_PWR (\S+)
67

78
Start
8-
^${INTERFACE}\s+${TEMPERATURE}\s+${VOLTAGE}\s+${TX_PWR}\s+${RX_PWR}\s+ -> Record
9+
^${INTERFACE}\s+${TEMPERATURE}\s+${VOLTAGE}\s+${CURRENT}?\s+${TX_PWR}\s+${RX_PWR}\s* -> Record
910
# Capture time-stamp if vty line has command time-stamping turned on
1011
^Load\s+for\s+
1112
^Time\s+source\s+is
13+
^(\s+Optical){2}
14+
^\s+Temperature\s+Voltage(\s+Current)?(\s+[TR]x\s+Power){2}
15+
^Port\s+\(Celsius\)\s+\(Volts\)(\s+\(mA\))?\s+(\(dBm\)\s*){2}
16+
^(If\s+device|\+\+|NA|mA|---+)
17+
^No\s+transceiver\s+present
18+
^Diagnostic\s+Monitoring\s+is\s+not\s+implemented\.
19+
^. -> Error

tests/cisco_ios/show_interface_transceiver/cisco_ios_show_interface_transceiver.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
---
22
parsed_sample:
3-
- interface: "Te1/49"
3+
- current: ""
4+
interface: "Te1/49"
45
rx_pwr: "-3.0"
56
temperature: "23.1"
67
tx_pwr: "-2.2"
78
voltage: "3.29"
8-
- interface: "Te1/50"
9+
- current: ""
10+
interface: "Te1/50"
911
rx_pwr: "-2.6"
1012
temperature: "23.4"
1113
tx_pwr: "-2.2"
1214
voltage: "3.31"
13-
- interface: "Te1/51"
15+
- current: ""
16+
interface: "Te1/51"
1417
rx_pwr: "-2.1"
1518
temperature: "21.5"
1619
tx_pwr: "-2.2"
1720
voltage: "3.29"
18-
- interface: "Te1/52"
21+
- current: ""
22+
interface: "Te1/52"
1923
rx_pwr: "-2.8"
2024
temperature: "23.5"
2125
tx_pwr: "-2.4"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
If device is externally calibrated, only calibrated values are printed.
2+
++ : high alarm, + : high warning, - : low warning, -- : low alarm.
3+
NA or N/A: not applicable, Tx: transmit, Rx: receive.
4+
mA: milliamperes, dBm: decibels (milliwatts).
5+
6+
Optical Optical
7+
Temperature Voltage Current Tx Power Rx Power
8+
Port (Celsius) (Volts) (mA) (dBm) (dBm)
9+
--------- ----------- ------- -------- -------- --------
10+
Te1/1/1 33.0 3.32 17.8 0.4 -1.2
11+
Te1/1/2 40.7 3.33 21.7 0.9 -2.0
12+
Te1/1/3 33.9 3.30 18.1 -0.9 -1.2
13+
Te2/1/1 43.8 3.36 20.6 0.1 -2.0
14+
Te2/1/2 27.4 3.22 30.2 -2.5 -1.2
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
parsed_sample:
3+
- current: "17.8"
4+
interface: "Te1/1/1"
5+
rx_pwr: "-1.2"
6+
temperature: "33.0"
7+
tx_pwr: "0.4"
8+
voltage: "3.32"
9+
- current: "21.7"
10+
interface: "Te1/1/2"
11+
rx_pwr: "-2.0"
12+
temperature: "40.7"
13+
tx_pwr: "0.9"
14+
voltage: "3.33"
15+
- current: "18.1"
16+
interface: "Te1/1/3"
17+
rx_pwr: "-1.2"
18+
temperature: "33.9"
19+
tx_pwr: "-0.9"
20+
voltage: "3.30"
21+
- current: "20.6"
22+
interface: "Te2/1/1"
23+
rx_pwr: "-2.0"
24+
temperature: "43.8"
25+
tx_pwr: "0.1"
26+
voltage: "3.36"
27+
- current: "30.2"
28+
interface: "Te2/1/2"
29+
rx_pwr: "-1.2"
30+
temperature: "27.4"
31+
tx_pwr: "-2.5"
32+
voltage: "3.22"

0 commit comments

Comments
 (0)