CI_METRIC_ID column in S_QOS_DATA table was not updated to new CI_METRIC_ID values

Document ID : KB000057247
Last Modified Date : 14/02/2018
Show Technical Document Details

Introduction: 

If any changes to discovered servers are made that would change the CI_METRIC_ID (i.e. origin), the CI_METRIC_ID needs to be updated in the S_QOS_DATA table. If it does not update, you will have a mismatch and the servers will not show correctly.

 

Question: 

How to update CI_METRIC_ID column on S_QOS_DATA table after change CMDB?


Environment:  

Data_engine 7.8x

Answer: 

Finding CI_METRIC_ID mismatches between S_QOS_DATA and the CM_* tables (read through entire instructions before trying).

 
Run the following SQL query...

select distinct c.dev_id,r.address nimbus_address,r.ip robotip,r.domain,
r.hub hubname,s.name robotname,cg.name groupname,s.nimbus_type,
d.source source,d.origin,s.os_type os_major,s.os_name os_minor,s.os_version,
s.os_description,d.ci_metric_id,d.qos,d.target,d.r_table,d.probe,d.table_id,
d.samplevalue value from S_QOS_DATA d
left join CM_CONFIGURATION_ITEM_METRIC m
on m.ci_metric_id=d.ci_metric_id
      left join CM_CONFIGURATION_ITEM I on i.ci_id = m.ci_id
      left join CM_DEVICE c on c.dev_id = i.dev_id
      left join CM_COMPUTER_SYSTEM s on c.cs_id = s.cs_id
      left join CM_GROUP_MEMBER cm on c.cs_id = cm.cs_id
      left join CM_GROUP cg on cg.grp_id = cm.grp_id
      left join CM_NIMBUS_ROBOT r on s.ip = r.ip and r.origin = d.origin
      where d.probe  = 'cdm'
      -- and d.robot = <robot>
      -- and d.origin = <origin>

Using the additional WHERE clauses in that query will narrow the results down to a single robot or origin group. This will give you a list of all the QoS data points for a robot/origin. 
 
Scan the results for things like improper group names, mismatched robot names, or bad CI_METRIC_ID’s (you can verify CI_METRIC_ID’s against a robot’s niscache folder by checking names of any files that end in .met against the CI_METRIC_ID listed in a given row). If the CI_METRIC_ID is incorrect in the robot's niscache, the niscache folder in the nimsoft root directory will need to be deleted and the robot will need to be restarted to repopulate the data. 
If any of these items are incorrect, it is likely that the robot has the wrong CI_METRIC_ID’s in S_QOS_DATA. It is possible to force a re-set of these ID’s by doing the following: 
 
Take a backup of your database as a precaution 
Stop the data_engine 
Issue the query: 
 
UPDATE S_QOS_DATA SET CI_METRIC_ID = NULL WHERE ROBOT = ‘<robotname>’ AND PROBE = ‘cdm’ 
 
Restart the data_engine to force a re-population of the CI_METRIC_ID column