CMDB–Update CI status to Absent based on staleness with relationship and correctness rule validation

sattar3
Tera Contributor

Hello Everyone,

 

 

We are working on a CMDB use case where we want to automatically update the Lifecycle Status of certain CIs to Absent if they are no longer being discovered.

 

For the below 5 CI classes, if a CI has not been discovered in the last 60 days, we want to update the CI’s Lifecycle Status to “Absent.”

CI Classes in Scope

  • MS SQL Database
  • Oracle Instance
  • Linux Server
  • VMware Virtual Machine Instance
  • Virtual Machine Instance

Exception Conditions (When NOT to mark CI as Absent)

Even if the CI is not discovered for 60 days, we do not want to update the CI to Absent if any of the following conditions are true:


1. Active Parent Relationship Exists

If the CI has any parent relationship where the parent CI is NOT in a “Retired” state, then the CI should remain active and should not be marked as Absent.

Example:

  • A Database CI is contained by an Instance or Server that is still Installed/Active.
  • A VM is hosted on an ESX server that is still active.

2. Correctness Rules Are Satisfied

We have configured Correctness Rules in CI Class Manager for each class.

If a CI has relationships defined in the correctness rules, then it should also NOT be updated to Absent, even if it is stale from discovery.

Below are examples of correctness rules configured:

MS SQL Database

  • Must NOT be marked incorrect/absent if:
    • Contains :: Contained by → MSFT SQL Instance

Oracle Instance

  • Must NOT be marked incorrect/absent if:
    • Used by :: Uses → Mapped Application Service
    • Hosted on :: Hosts → Server
    • Contains :: Contained by → Oracle Database

Linux Server

  • Must NOT be marked incorrect/absent if:
    • Installed on :: Runs → Mapped Application Service
    • Hosted on :: Hosts → Hyper‑V Server

VMware Virtual Machine Instance

  • Must NOT be marked incorrect/absent if:
    • Hosted on :: Hosts → ESX Server

 

Virtual Machine Instance

  • Must NOT be marked incorrect/absent if:
    • Hosted on :: Hosts → ESX Server
    • Hosted on :: Hosts → Hyper V Server

(Reference screenshots attached for correctness rule configurations.)

1. MS SQL DataBase Rule

sattar3_0-1777961483805.png

 

2. Oracle Instance

sattar3_1-1777961535360.png

 

3.  Linux Server 

sattar3_2-1777961578623.png

 

4.  VMWare Virtual Machine Instance

sattar3_3-1777961621296.png

 

5. Virtual Machine Instance

sattar3_5-1777961737817.png
We can't apply the filter in Relationship table based on the Class, so how we can able to figure it out and test it?
If possible provide script which shows the relationship CI's count and without relationship CI's count, so that we can validate and run it background scripts to verify the data?

Please help me here is there any way to implement the solution for it?
 
Thanks in Advance,
Sattar

 

0 REPLIES 0