To populate the desired information from AM into a SAM event, complete the following steps:
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.
Find the section "/* Customizations go here ... */ ". This is the section where modifications must be made. (See Sample Hook script section below).
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 ==========================================