VMWare Smart Assurance SAM: How can I extract a field out of Availability Manager and into UserDefined field for a SAM event with a hook script?
search cancel

VMWare Smart Assurance SAM: How can I extract a field out of Availability Manager and into UserDefined field for a SAM event with a hook script?

book

Article ID: 332155

calendar_today

Updated On:

Products

VMware

Issue/Introduction

Symptoms:
How can I extract a field out of VMWare Smart Assurance Availability Manager and into UserDefined field for a SAM event with a hook script?
How can I get OSVersion or any other attributes that are not available in VMWare Smart Assurance Service Assurance Manager (SAM) into the UserDefined1 field or any other UserDefined field within HookScript?

How can I get OSVersion attribute into the VMWare Smart Assurance SAM Topology by editing dxa-conn.conf?

Environment

VMware Smart Assurance - SMARTS

Resolution

To populate the desired information from AM into a SAM event, complete the following steps:

  1. Determine which hookscript SAM is using to manipulate incoming notifications from the underlying AM domain manager as follows:
     
    1. Open up the Global Manager Administration Console.
    2. Attach to the SAM Domain Manager.
    3. Expand the ICS_Configuration tree.
    4. Expand the Domain Types tree.
    5. Select the domain type for the underlying domain manager (INCHARGE-AM-PM-SUITE, INCHARGE-AM-SUITE, and so on).
    6. Once the correct domain type is selected, the hookscript that is used will display on the right pane.

       
  2. The default hookscript is ics/dxa-sample-hook.asl (see Note statement). This article will use the default script to illustrate how the OSVersion attribute can be pulled in from the underlying AM domain, and populated into the UserDefined1 field of a notification in SAM.

  3. Open this script for editing. This script is found in the following directory:

    <BASEDIR>/SAM/smarts/bin/sm_edit rules/ics/dxa-sample-hook.asl

     
  4. Find the section "/* Customizations go here ... */ ". This is the section where modifications must be made. (See Sample Hook script section below).  

  5. Restart your SAM server to apply the changes made to the sample hookscript. Or, as an alternative to a server restart, you can run the ICS_RemoteConfig.asl script, which will will force an event that will update the UserDefined1 field. This script is found here:

    <BASEDIR>/SAM/smarts/bin/sm_adapter -s INCHARGE-SA ics/ICS_RemoteConfig.asl


Additional Information

Sample Hook script
Below is the sample hook script (dxa-sample-hook.asl).

 ============================== cut here ==========================================

/* dxa-sample-hook.asl - Hook adapter for InCharge Consolidation Server

*

* Copyright (c) 1997-2002, System Management ARTS (SMARTS)

* All Rights Reserved

*

* RCS $Id: dxa-sample-hook.asl,v 1.1 2002/05/22 16:15:57 eo1 Exp $

*

*/

default NotificationName = "";

default MessageType = "";

START {

.. eol

} do {

if (NotificationName == "") {

print("InternalError: ".this->Name." did not receive NotificationName!");

return;

}

eventObj = self->object(NotificationName);

/* Customizations go here ... */

if ( !eventObj->isNull() )

{

deviceObj = object(eventObj->OccurredOn);

if (! deviceObj->isNull() ) {

eventObj->UserDefined1 = deviceObj->OSVersion;

eventObj->changed();

}

}

return;

}

/*

* These variables describe the formatting of this file. If you don't like the

* template defaults, feel free to change them here (not in your .emacs file).

*

* Local Variables:

* mode: C++

* comment-column: 32

* c-basic-offset: 4

* fill-column: 79

* End:

*/

============================== cut here ==========================================