@@ -6293,6 +6293,112 @@ def multipod_modular_spine_bootscript_check(tversion, fabric_nodes, username, pa
62936293 return Result (result = result , headers = headers , data = data , recommended_action = recommended_action , doc_url = doc_url )
62946294
62956295
6296+ @check_wrapper (check_title = 'WRED with Affected Leaf/LC/FM Models' )
6297+ def wred_affected_model_check (tversion , fabric_nodes , ** kwargs ):
6298+ result = PASS
6299+ headers = ["Node ID" , "Node Name" , "Source" , "Model" ]
6300+ data = []
6301+ recommended_action = (
6302+ 'Detected affected node(s) with WRED enabled. '
6303+ 'Review software fix options and engage TAC.'
6304+ )
6305+ doc_url = 'https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwt50713'
6306+
6307+ if not tversion :
6308+ return Result (result = MANUAL , msg = TVER_MISSING )
6309+
6310+ version_affected = (
6311+ (tversion .major1 == '6' and tversion .major2 == '1' and tversion .older_than ('6.1(6a)' ))
6312+ or (tversion .major1 == '6' and tversion .major2 == '2' and tversion .older_than ('6.2(2a)' ))
6313+ )
6314+ if not version_affected :
6315+ return Result (result = PASS , msg = VER_NOT_AFFECTED )
6316+
6317+ qosCong = icurl ('class' , 'qosCong.json' )
6318+ wred_enabled = False
6319+ for cong in qosCong :
6320+ algo = cong .get ('qosCong' , {}).get ('attributes' , {}).get ('algo' , '' )
6321+ if algo .lower () == 'wred' :
6322+ wred_enabled = True
6323+ break
6324+
6325+ if not wred_enabled :
6326+ return Result (result = PASS , msg = 'WRED not enabled. Skipping.' )
6327+
6328+ affected_models = {
6329+ 'N9K-C9236C' ,
6330+ 'N9K-C92300YC' ,
6331+ 'N9K-C9272Q' ,
6332+ 'N9K-C92304QC' ,
6333+ 'N9K-C9504-FM-E' ,
6334+ 'N9K-C9508-FM-E' ,
6335+ 'N9K-C9516-FM-E' ,
6336+ }
6337+
6338+ def is_affected_model (model ):
6339+ m = (model or '' ).upper ()
6340+ return m in affected_models or 'LACROSSE' in m
6341+
6342+ node_name_map = {}
6343+ for node in fabric_nodes :
6344+ attr = node .get ('fabricNode' , {}).get ('attributes' , {})
6345+ if attr .get ('id' ):
6346+ node_name_map [attr .get ('id' )] = attr .get ('name' , '' )
6347+
6348+ impacted = set ()
6349+
6350+ # Leaf model gate
6351+ for node in fabric_nodes :
6352+ attr = node .get ('fabricNode' , {}).get ('attributes' , {})
6353+ if attr .get ('role' ) != 'leaf' :
6354+ continue
6355+ model = attr .get ('model' , '' )
6356+ if is_affected_model (model ):
6357+ impacted .add ((attr .get ('id' , '' ), attr .get ('name' , '' ), 'Leaf' , model ))
6358+
6359+ # LC model gate
6360+ eqptLC = icurl ('class' , 'eqptLC.json' )
6361+ for card in eqptLC :
6362+ attr = card .get ('eqptLC' , {}).get ('attributes' , {})
6363+ model = attr .get ('model' , '' )
6364+ if not is_affected_model (model ):
6365+ continue
6366+ dn = attr .get ('dn' , '' )
6367+ m = re .search (node_regex , dn )
6368+ if not m :
6369+ continue
6370+ node_id = m .group ('node' )
6371+ impacted .add ((node_id , node_name_map .get (node_id , '' ), 'LC' , model ))
6372+
6373+ # FM model gate
6374+ eqptFC = icurl ('class' , 'eqptFC.json' )
6375+ for card in eqptFC :
6376+ attr = card .get ('eqptFC' , {}).get ('attributes' , {})
6377+ model = attr .get ('model' , '' )
6378+ if not is_affected_model (model ):
6379+ continue
6380+ dn = attr .get ('dn' , '' )
6381+ m = re .search (node_regex , dn )
6382+ if not m :
6383+ continue
6384+ node_id = m .group ('node' )
6385+ impacted .add ((node_id , node_name_map .get (node_id , '' ), 'FM' , model ))
6386+
6387+ if impacted :
6388+ def sort_key (row ):
6389+ node_id = row [0 ]
6390+ try :
6391+ node_key = int (node_id )
6392+ except (TypeError , ValueError ):
6393+ node_key = node_id
6394+ return (node_key , row [2 ], row [3 ])
6395+
6396+ data = [list (row ) for row in sorted (impacted , key = sort_key )]
6397+ result = FAIL_O
6398+
6399+ return Result (result = result , headers = headers , data = data , recommended_action = recommended_action , doc_url = doc_url )
6400+
6401+
62966402# ---- Script Execution ----
62976403
62986404
@@ -6474,6 +6580,7 @@ class CheckManager:
64746580 # Bugs
64756581 observer_db_size_check ,
64766582 multipod_modular_spine_bootscript_check ,
6583+ wred_affected_model_check ,
64776584 ]
64786585 cli_checks = [
64796586 # General
0 commit comments