@@ -85,6 +85,7 @@ def _submit_ten_data(self, tenant):
8585 pass
8686
8787 def submit_raw_obj (self , raw_stats , tags , obj_type ):
88+ got_health = False
8889 for s in raw_stats :
8990 name = list (s .keys ())[0 ]
9091 # we only want to collect the 15 minutes metrics.
@@ -110,5 +111,25 @@ def submit_raw_obj(self, raw_stats, tags, obj_type):
110111 json_attrs = s .get (name , {}).get ("attributes" , {})
111112 if mval and helpers .check_metric_can_be_zero (cisco_metric , mval , json_attrs ):
112113 metrics [dd_metric ] = mval
113-
114+ if 'fvOverallHealth' in name :
115+ got_health = True
114116 self .submit_metrics (metrics , tags , instance = self .instance )
117+
118+ if got_health :
119+ return
120+ self .log .debug ("No fvOverallHealth reported, looking for healthInst instead" )
121+ health_insts = [s for s in raw_stats if list (s .keys ())[0 ] == "healthInst" ]
122+ if not health_insts :
123+ self .log .debug ("No healthInst reported" )
124+ return
125+ s = health_insts [0 ]
126+ self .log .debug ("submitting metrics for: %s" , 'healthInst' )
127+ metrics = {}
128+
129+ ms = self .tenant_metrics .get (obj_type , {}).get ('healthInst' , {})
130+ for cisco_metric , dd_metric in ms .items ():
131+ mval = s .get ('healthInst' , {}).get ("attributes" , {}).get (cisco_metric )
132+ json_attrs = s .get ('healthInst' , {}).get ("attributes" , {})
133+ if mval and helpers .check_metric_can_be_zero (cisco_metric , mval , json_attrs ):
134+ metrics [dd_metric ] = mval
135+ self .submit_metrics (metrics , tags , instance = self .instance )
0 commit comments