Just modified the get_optics() method to include the optical information from 40G/100G optics using four different lanes. Not sure that is the best way of doing it but as I wanted to keep the main loop structure I had to re-format the input data a bit. Example:
juniper> show interfaces diagnostics optics et-0/0/50
Physical interface: et-0/0/50
Module temperature : 34 degrees C / 94 degrees F
Module voltage : 3.2730 V
Module temperature high alarm : Off
Module temperature low alarm : Off
Module temperature high warning : Off
Module temperature low warning : Off
Module voltage high alarm : Off
Module voltage low alarm : Off
Module voltage high warning : Off
Module voltage low warning : Off
Module temperature high alarm threshold : 75 degrees C / 167 degrees F
Module temperature low alarm threshold : -5 degrees C / 23 degrees F
Module temperature high warning threshold : 70 degrees C / 158 degrees F
Module temperature low warning threshold : 0 degrees C / 32 degrees F
Module voltage high alarm threshold : 3.6300 V
Module voltage low alarm threshold : 2.9700 V
Module voltage high warning threshold : 3.4640 V
Module voltage low warning threshold : 3.1340 V
Laser bias current high alarm threshold : 9.999 mA
Laser bias current low alarm threshold : 0.499 mA
Laser bias current high warning threshold : 9.499 mA
Laser bias current low warning threshold : 0.999 mA
Laser output power high alarm threshold : Not supported
Laser output power low alarm threshold : Not supported
Laser output power high warning threshold : Not supported
Laser output power low warning threshold : Not supported
Laser rx power high alarm threshold : 2.1878 mW / 3.40 dBm
Laser rx power low alarm threshold : 0.0446 mW / -13.51 dBm
Laser rx power high warning threshold : 1.7378 mW / 2.40 dBm
Laser rx power low warning threshold : 0.1122 mW / -9.50 dBm
Lane 0
Laser bias current : 6.677 mA
Laser output power : 0.763 mW / -1.17 dBm
Laser receiver power : 0.759 mW / -1.20 dBm
Laser bias current high alarm : Off
Laser bias current low alarm : Off
Laser bias current high warning : Off
Laser bias current low warning : Off
Laser receiver power high alarm : Off
Laser receiver power low alarm : Off
Laser receiver power high warning : Off
Laser receiver power low warning : Off
Tx loss of signal functionality alarm : Off
Rx loss of signal alarm : Off
Tx laser disabled alarm : Off
Lane 1
Laser bias current : 6.705 mA
Laser output power : 0.834 mW / -0.79 dBm
Laser receiver power : 0.719 mW / -1.43 dBm
Laser bias current high alarm : Off
Laser bias current low alarm : Off
Laser bias current high warning : Off
Laser bias current low warning : Off
Laser receiver power high alarm : Off
Laser receiver power low alarm : Off
Laser receiver power high warning : Off
Laser receiver power low warning : Off
Tx loss of signal functionality alarm : Off
Rx loss of signal alarm : Off
Tx laser disabled alarm : Off
Lane 2
Laser bias current : 6.921 mA
Laser output power : 0.823 mW / -0.84 dBm
Laser receiver power : 0.744 mW / -1.29 dBm
Laser bias current high alarm : Off
Laser bias current low alarm : Off
Laser bias current high warning : Off
Laser bias current low warning : Off
Laser receiver power high alarm : Off
Laser receiver power low alarm : Off
Laser receiver power high warning : Off
Laser receiver power low warning : Off
Tx loss of signal functionality alarm : Off
Rx loss of signal alarm : Off
Tx laser disabled alarm : Off
Lane 3
Laser bias current : 6.972 mA
Laser output power : 0.814 mW / -0.89 dBm
Laser receiver power : 0.752 mW / -1.23 dBm
Laser bias current high alarm : Off
Laser bias current low alarm : Off
Laser bias current high warning : Off
Laser bias current low warning : Off
Laser receiver power high alarm : Off
Laser receiver power low alarm : Off
Laser receiver power high warning : Off
Laser receiver power low warning : Off
Tx loss of signal functionality alarm : Off
Rx loss of signal alarm : Off
Tx laser disabled alarm : Off
Just modified the get_optics() method to include the optical information from 40G/100G optics using four different lanes. Not sure that is the best way of doing it but as I wanted to keep the main loop structure I had to re-format the input data a bit. Example:
The output from the get_optics() method:
The output before was:
Note I had to temporary tweak the code to overcome the error #146 'ValueError: could not convert string to float: - Inf' Let me know. Thanks