cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
492
Views
0
Helpful
1
Replies

Add Transceiver DOM Alarm/Warning syslog functionality

r.heitmann
Level 1
Level 1

Just had an some year old 10G-ER-Transceiver dropping below the rx-level warning threshold.
* this is called "warning"-threshold
* but unfortunately NXOS doesn't generate a "warning"
* NXOS is quiet, you have to look manually using "show interface transceiver detail"

Cisco Catalyst/IOS had an warning-message for transceiver-stuff for years:

%SFF8472-5-THRESHOLD_VIOLATION: Te1/1/15: Voltage low warning; Operating value: 3.09 V, Threshold value: 3.10 V.

Cisco ASR has DOM capability, too

https://www.cisco.com/c/en/us/td/docs/wireless/asr_901s/scg/b_scg_for_asr901s/b_scg_for_asr901s_chapter_0100101.pdf

But NXOS still lacks this functionality?

NXOS-Users have to wait until the link goes down or they have to poll their transceiver attentuation values and compare them manually with warning- or alarm-thresholds?

Unfortunately CSCvf02855 has been terminated without result.

 

1 Reply 1

r.heitmann
Level 1
Level 1

I've been writing a tiny Python-Script

  • parsing all "show int transceiver details"-information
  • returning a List of all Interfaces with Transceiver-DOM-Warnings and Alarms.

nxos_dom.py

#!/bin/env python
#
import re
#
#
def get_shutdown():
  result = []
  cli_result = cli('show int status | inc disabled | cut -d " " -f 1')
  #
  for l in cli_result.split("\n"):
    result.append(l)
  #
  return result
#
#
def get_dom_alarm(shutdown):
  # 
  cli_result = cli('show int transceiver details | xml | inc "(<interface|flag)" | excl "> <" | sed "s/Ethernet/Eth/g"')
  #
  #
  result = {}
  #
  int_name = ""
  int_flags = {}
  #
  for l in cli_result.split("\n"):
    lm=re.match(".*\<interface\>(.*)\<.*", l)
    if lm:
      if int_name and int_flags and int_name not in shutdown:
        for k,v in int_flags.items():
          kv='{}{}'.format(k,v)
          if not kv in result:
            result[kv]=[]
          result[kv].append(int_name)
      #
      int_name = lm.groups()[0]
      int_flags = {}
    #
    lm=re.match(".*\<(.*)_flag\>(.*)\<.*", l)
    if lm:
      int_flags[lm.groups()[0]] = lm.groups()[1]
  #
  kvs = ";".join('{}:{}'.format(k,",".join(v)) for k,v in result.items())
  
  return kvs
#
#
down = get_shutdown()
dom_alarm = get_dom_alarm(down)
#
# rx_pwr--:Eth1/16,Eth1/22,Eth1/23,Eth1/26,Eth1/34,Eth1/35,Eth2/19
#
print dom_alarm,

this EEM-Applet runs it once a day:

event manager applet NXOS_DOM
  event snmp oid 1.3.6.1.4.1.9.9.305.1.1.1.0 get-type exact entry-op ge entry-val 0 poll-interval 86400
  action 10 cli command "source nxos_dom.py"
  action 11 regexp "DOM [ -~]+" "$_cli_result"   "cli_result_printable"
  action 20 syslog priority warnings msg "$cli_result_printable"
  action 30 exit   0

generating Syslog-Messages like this:

2023 Jun 21 11:52:06.364 <HOSTNAME> eem_policy_dir:  %EEM_ACTION-4-WARN: DOM rx_pwr--:Eth1/17