Request for Historical Maintenance Schedule Information
search cancel

Request for Historical Maintenance Schedule Information

book

Article ID: 437411

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM) CA Unified Infrastructure Management On-Premise (Nimsoft / UIM) CA Unified Infrastructure Management SaaS (Nimsoft / UIM)

Issue/Introduction

We are requesting guidance on how to historically identify maintenance schedules that have impacted a specific device on a particular date.

Specifically, we need to determine the following details for a given device and date:

  • Schedule name
  • Schedule description
  • Scheduler's name/ID
  • Maintenance start and end times
  • Associated device list

We attempted to retrieve this information using an API but were unsuccessful.

Environment

  • .DX UIM 23.4 CU4 or higher

Cause

  • Guidance

Resolution

SELECT DISTINCT 
    ms.SCHEDULE_NAME, 
    ms.DESCRIPTION, 
    msm.SCHEDULE_ID, 
    mw.START_TIME, 
    mw.END_TIME, 
    cs.name AS dev_name, 
    cs.ip, 
    cs.origin,
    acc.nimbus_user AS Creator_Account_Name, -- Human-readable name
    'Active' AS Status
FROM CM_COMPUTER_SYSTEM cs
INNER JOIN MAINTENANCE_SCHEDULE_MEMBERS msm ON cs.cs_id = msm.CS_ID
INNER JOIN MAINTENANCE_WINDOW mw ON msm.SCHEDULE_ID = mw.SCHEDULE_ID
INNER JOIN MAINTENANCE_SCHEDULE ms ON msm.SCHEDULE_ID = ms.SCHEDULE_ID
LEFT JOIN CM_ACCOUNT acc ON ms.ACCOUNT_ID = acc.account_id -- Resolving Account Name
WHERE mw.END_TIME >= GETDATE()

UNION ALL

SELECT DISTINCT 
    ms.SCHEDULE_NAME, 
    ms.DESCRIPTION, 
    msm.SCHEDULE_ID, 
    mwh.START_TIME, 
    mwh.END_TIME, 
    cs.name AS dev_name, 
    cs.ip, 
    cs.origin,
    acc.nimbus_user AS Creator_Account_Name,
    'Historical' AS Status
FROM CM_COMPUTER_SYSTEM cs
INNER JOIN MAINTENANCE_SCHEDULE_MEMBERS msm ON cs.cs_id = msm.CS_ID
INNER JOIN MAINTENANCE_WINDOW_HISTORY mwh ON msm.SCHEDULE_ID = mwh.SCHEDULE_ID
INNER JOIN MAINTENANCE_SCHEDULE ms ON msm.SCHEDULE_ID = ms.SCHEDULE_ID
LEFT JOIN CM_ACCOUNT acc ON ms.ACCOUNT_ID = acc.account_id
WHERE mwh.END_TIME >= GETDATE() - 30 
ORDER BY START_TIME DESC;
  • For longer history, as of CU6 or higher you need to set this parameter higher or set it to -1 so the schedules are not deleted.
  • purge_windows_history_days
    Removes the schedule from the Maintenance Window history after the specified number of days following the maintenance window completion day.
  • If you set the value as minus one (-1), the schedules are never deleted