Smarts SAM Adapters: Devices "InMaintenance" continue to generate alerts in Smarts.
search cancel

Smarts SAM Adapters: Devices "InMaintenance" continue to generate alerts in Smarts.

book

Article ID: 303969

calendar_today

Updated On:

Products

VMware

Issue/Introduction

Symptoms:


Devices "InMaintenance" continue to generate alerts in Smarts
Included InMaintenance = No filter for all alerts in escalation policies, but still get alerts when devices in maintenance are taken down and when they are brought back up

The InMaintenance attribute changes as soon as the device is brought back up regardless of scheduled Maintenance window.

Environment

VMware Smart Assurance - SMARTS

Cause

The InMaintenance attribute clears after a device is brought back.

Resolution

To resolve this issue, do the following:
  1. Use following command to open and edit the ics-maintenance.asl script:

<BASEDIR>/SAM/smarts/bin/sm_edit rules/bim/ics-maintenance.asl
 
  1. Add the following line to the CLEAR rule in the NL_CLEAR notifications section of the script (see the following sections and Note statement): 

    eventObj->UserDefined2=YES

     
  2. Add filters to both Down and Cleared Escalation paths with "UserDefined2 matches ~YES."
  3. Restart the Smarts SAM server for the changes to take effect.

The following sections show the original ics-maintenance.asl CLEAR rule and the modified CLEAR rule (with the eventObj->UserDefined2=YES line added)

Original ics-maintenance.asl CLEAR rule

CLEAR {
                eventTimestamp:integer   fs
                eventType:"NL_CLEAR" fs
                eventClass:word    fs
                eventDispName:rep(word)  fs
                eventName:word    fs
                eventObj:FIND_NOTIFICATION_OBJECT
} do {

// When any other notification clears if the notification is in maintenance TRUE change it to FALSE

            if (eventObj->InMaintenance) {                //Is it in maintenance?
                   eventObj->addAuditEntry("Maint", "InMaint", "End of maintenance");
                   eventObj->InMaintenance = FALSE;       //Set it to not in maintenance
                   changeResult = eventObj->changed();    //Let server know the notification has changed.
                   if (debug) {
                           print("DEBUG - MaintHandl:     Set InMaintenance FALSE on: ".eventObj->Name);
                           print("DEBUG - MaintHandl: notification NL_CLEAR change result: ".changeResult);
                   }
           }
}

Modified CLEAR rule in ics-maintenance.asl

CLEAR {
                eventTimestamp:integer    fs
                eventType:"NL_CLEAR" fs
                eventClass:word           fs
                eventDispName:rep(word)  fs
                eventName:word           fs
                eventObj:FIND_NOTIFICATION_OBJECT
} do {

// When any other notification clears if the notification is in maintenance TRUE change it to FALSE

        if (eventObj->InMaintenance) {                        //Is it in maintenance?
                eventObj->addAuditEntry("Maint", "InMaint", "End of maintenance");
                eventObj->InMaintenance = FALSE;             //Set it to not in maintenance
                eventObj->UserDefined2=YES;                  // Set UserDefined2 attribute
                changeResult = eventObj->changed();          //Let server know the notification has changed.
                if (debug) {
                        print("DEBUG - MaintHandl:          Set InMaintenance FALSE on: ".eventObj->Name);
                        print("DEBUG - MaintHandl: notification NL_CLEAR change result: ".changeResult);
                }
        }
}

 

To apply the changes execute following command from <SAM>/smarts/bin:
 ./sm_adapter -b <BROKER>:<PORT> -s <SAM>  ics/ics-init.asl


Additional Information

Instead of UserDefined2 you may use any other available UserDefined field.