CMDB CI sys_updated_on Refresh Behavior Across Discovery MethodsIssue This article explains when and why the CMDB CI record's `sys_updated_on` (Updated) timestamp is refreshed during collection via Agent, Agentless Discovery (MID), and Cloud Discovery. It clarifies common misconceptions about Staleness and how to distinguish between "still collecting but no data change" versus "not collecting at all." Symptoms ## Design Principle: sys_updated_on Reflects Record Writes, Not Collection Attempts **Key point:** `sys_updated_on` is a system field that updates **only when the CI record itself is written** (INSERT or UPDATE). Collection success alone does not refresh this timestamp. - If discovery collects data but the collected values match existing CI attributes → no write occurs → `sys_updated_on` does not change - If discovery collects data and detects a difference → writes the new value → `sys_updated_on` updates - If discovery is not run or fails entirely → no write → `sys_updated_on` does not change This design separates two concepts: - **`sys_updated_on`** = "Was this CI's content actually changed?" - **`last_discovered` / `last_scan`** = "Was this CI recently scanned/checked?" (see below) --- ## Behavior by Discovery Method ### 1. Agentless Discovery (MID + Horizontal Discovery) **Updated:** If identification/exploration detects a difference in CI attributes AND writes the new value to the CI, OR if `last_discovered` or other CI fields are written during the update. **NOT updated:** If collected values match existing CI attributes and no write occurs. **Additional detail:** - `last_discovered` is updated only when a CI write occurs (standard OOTB behavior) - If collection succeeds but finds no diff, `last_discovered` does NOT update on standard builds (because the CI was not modified) --- ### 2. Agent (ACC - Agent Client Collector for Visibility) **Updated:** When ACC policy collection results are reflected in the CI (i.e., data difference detected and written). **NOT updated:** If the CI attributes show no difference from the collected data. The ACC side may advance its own metadata, but the CI record itself remains unmodified. --- ### 3. Cloud Discovery (Metadata API, OS-level, Event-driven) **Updated:** When cloud metadata/API or OS-level discovery writes a difference to the CI. **NOT updated:** If collected values match existing CI attributes and no write occurs. **Exception — Event-driven collectors (e.g., vCenter Event Collector):** - Some event-driven paths create CMDB Health audit records ("stale" status) **without directly updating the CI** - In these cases, `sys_updated_on` and `last_discovered` do not change, even though a health status was recorded - This is by design — the health record reflects state without modifying the CI --- ## Key Timestamp Fields: sys_updated_on vs last_discovered vs sys_object_source.last_scan Understanding the distinction is critical for diagnosing "Stale" CI confusion. | Field | Updated when | Purpose | Notes | |-------|--------------|---------|-------| | **`sys_updated_on`** | CI record is written (content change exists) | Indicates when CI data was last modified | Does NOT update if collection finds no diff | | **`last_discovered`** | Typically when CI is written; IRE may update it during payload processing | Key attribute indicating CI was recently discovered; refreshness marker | May be updated by IRE even if no other CI attributes changed, depending on payload and system properties | | **`sys_object_source.last_scan`** | IRE processes payload with `source_recency_timestamp`; updates if recency is newer than existing `last_scan` | Indicates when a data source last scanned this target | May NOT update if payload's recency timestamp is older than existing value (system property controlled); only shortcuts IRE's CI lookup, not a collection indicator | **Key insight:** Do not rely on `sys_object_source.last_scan` alone to determine if collection is happening. Compare it with `sys_updated_on` and `last_discovered` on the **same CI** (matching `target_table` and `target_sys_id`). --- ## Why Staleness Appears to Mark Recently-Collected CIs as "Stale" ### The CMDB Health Staleness Rule Staleness is determined by the CMDB Class Manager's **Staleness Rule** (class-specific Effective Duration, default ~60 days): ``` If (current_date - CI.sys_updated_on) > Staleness_Rule_Duration → Mark CI as "Stale" ``` ### The "False Positive" Scenario A CI can appear stale even though discovery is running successfully: 1. **Discovery executes** and completes successfully 2. **Data is identical** to what's in the CMDB (no differences detected) 3. **No write occurs** → `sys_updated_on` does not advance 4. **`sys_updated_on` ages** beyond the Staleness Rule duration (e.g., 60 days) 5. **CMDB Health marks it "Stale"** based on the old `sys_updated_on` This is **by design**, not a bug: - The Staleness indicator correctly reflects that the CI record hasn't changed - But it doesn't distinguish between "we checked it, nothing changed" and "we never checked it" ### Why This Design Is Useful Although Staleness conflates these two states, it serves as an **entry signal** for investigation: - **Early detection of collection failures:** If collection stops or fails, more CIs will go stale faster - **Inventory audit starting point:** Stale CIs are candidates for cleanup, deprovisioning, or archival - **Process integration:** Health metrics can trigger automatic task creation, workflow, or Data Manager lifecycle policies --- Release Zurich and later versions. Resolution ## How to Distinguish: Still Collecting (No Diff) vs. Not Collecting ### Symptom: CI is marked "Stale" but discovery appears active **Step 1: Check if discovery is actually running** Look at the CI's `sys_object_source.last_scan` (must match the CI's `target_table` and `target_sys_id`): - ✅ **Recently updated (e.g., within 7 days)** → Discovery is scanning this CI - ❌ **Aged for months** → Discovery is not scanning this CI (or payload's `source_recency_timestamp` is old) **Caveat:** `last_scan` may not always update (see "Key Timestamp Fields" section above). Always cross-check with other fields below. **Step 2: Check the CI's `last_discovered` or discovery_source** - ✅ **Recently updated** → This CI was recently identified by discovery - ❌ **Aged** → This CI has not been re-identified by discovery **Step 3: Verify in Discovery logs (definitive check)** Navigate to **Discovery Status** → **Discovery Log** (or **Check Pattern Log** if needed): - Look for INSERT/UPDATE operations on the target table (e.g., `cmdb_ci_apache_web_server`) - If inserts/updates are absent for this CI → collection is not writing it Alternatively, check **Discovery Status** → **ECC Queue** to inspect payload input/output for the target table. ### Decision Tree ``` Is sys_object_source.last_scan recent (e.g., last 7 days)? ├─ YES → Discovery is scanning; check CI attributes for actual differences │ (if no diff detected, sys_updated_on won't change — this is expected) └─ NO → Discovery may not be running or payload recency is old Check Discovery Log / ECC Queue to confirm ``` --- ## Operational Solutions for Large Numbers of Stale CIs If a health check reports many stale CIs and you want to reduce false positives or align behavior with operations: ### Option A: Adjust Staleness Rule (Recommended if collection is active) **Goal:** Extend the Staleness duration for CIs that are collected regularly but rarely change. **Steps:** 1. Navigate to **CMDB Workspace** → **Class Manager** 2. Select the CI class (e.g., `cmdb_ci_file_system`) 3. Edit the **Staleness Rule** (Effective Duration) 4. Set a duration matching your collection cadence (e.g., if discovery runs nightly, use 7–15 days instead of 60) **Benefit:** Reduces false positives from "scanned but unchanged" CIs. ### Option B: Use Health Inclusion Rules to narrow scope **Goal:** Exclude certain CIs or classes from Staleness evaluation. **Steps:** 1. Navigate to **CMDB Health Preferences** → **Health Metrics** → **Staleness** 2. Define or refine **Inclusion Rules** to scope evaluation (e.g., only active CIs, exclude archived, etc.) **Benefit:** Health metrics focus on CIs that matter for your operation. ### Option C: Automate task creation for stale CIs (Recommended) **Goal:** Convert Stale detection into actionable tasks for the responsible team. **Steps:** 1. **CMDB Health Preferences** → **Health Metrics** → **Staleness** 2. Enable **Create Task** and assign to a task group 3. CMDB Health will automatically generate follow-up tasks for stale CIs **Workflow:** Health detects Stale → Task generated → Assigned team investigates/cleans up → LifeCycle management (Retire/Archive/Delete) if appropriate **Benefit:** Staleness becomes part of operational process; teams can prioritize cleanup systematically. ### Option D: Use Data Manager for Lifecycle (For large cleanup) **Goal:** Define and execute policies for retiring or deleting old/stale CIs. **Steps:** 1. Navigate to **CMDB Workspace** → **Data Manager** 2. Define cleanup policies (e.g., Retire CIs older than X, Archive after Y, Delete after Z) 3. Attach policies to Staleness rules or manually execute batch operations 4. Generate audit/evidence tasks for each action **Benefit:** Systematic, auditable reduction of stale inventory; aligns with compliance/governance. --- ## Technical Details: IRE Processing and sys_updated_on The **Identification & Reconciliation Engine (IRE)** controls when CI writes occur: 1. **Payload validation** — IRE receives collected data with a `source_recency_timestamp` 2. **CI identification** — IRE uses `source_name`, `source_native_key`, `sys_object_source.last_scan` to quickly find the matching CI 3. **Reconciliation** — IRE compares collected attributes with existing CI fields 4. **Decision** — If differences exist, IRE commits a write (INSERT/UPDATE); if identical, no write 5. **Timestamp handling** — If `sys_object_source.last_scan` update logic is triggered, it may or may not advance depending on `source_recency_timestamp` (property-controlled) **Reference:** For detailed IRE flow, see **KB0750386**, sections 4.2 and 6 ("If the CI needs to be updated").