Make CI status to Absent

Phani deepthi1
Tera Contributor

Hi All,

We are working on discovery issues and we need to know is there a way to mark the status of CI to Absent when the server is not pingable or active for 10 days in CMDB.

Please help if there is a way to achieve this through script or any custom pattern needed.

 

Thanks

7 REPLIES 7

tj26
Tera Contributor

Hi @Phani deepthi ,

If you are running discovery it is better to have a scheduled job to check the 'Most Recent Discovery' field. For example, you could create a scheduled job that checks the Hardware table (cmdb_ci_hardware) for assets that haven't been discovered in x amount of days i.e. where Most Recent Discovery is more than 10 days back in your use case. Then the state is set to Absent.

You could then also create a report that shows you these CIs/Assets that have not been discovered in more than 10 days.

Regards,

Tom

rajat11
Tera Contributor

Can anyone help with 14 days ago filter ,We want to make our CI absent if its not updated from more than 14 days ,I tried couple of filter but its not showing correct data ,

U need to write a small script in the form of scheduled Job.

 

RahulPriyadars_0-1688368617607.png

Most CurrentDate-MostRecentDiscoveryDate>=14

Fetch all the record from CMDB_CI table 

Update the Status as Absent

 

For ur current filter try this 

 

RahulPriyadars_1-1688368754328.png

 

Regards

RP