KBI 311451 User Guide for Argent Total Support Interface ActiveX Library

Version

All versions

Date

Friday, 26 August 2016

Summary

User Guide for Argent Total Support Interface ActiveX Library

Technical Background

Argent Total Support Interface ActiveX Library allows 3rd party program to do following:

  1. Enumerate Alert and Alert Macro definitions
  2. Post Event request to Argent Console Engine
  3. Retrieve processing status and trace logs for Event request
  4. Resolve, answer or put Event into maintenance
  5. Reset Event occurrence count
  6. Auto-resolve an Event

The ActiveX library can be used by 3rd party program in C++, VBscript or .NET

Any modern programming language can use ActiveX library

This user guide uses VBScript for demo code

The ActiveX library (ARGSOFT_AAC_FIREALERT.DLL) is installed as part of Argent AT (3.1A-1601_T19 or later)

At least Argent Console client should be installed on the machine

The ActiveX library contains only ONE creatable object (IFireAlert); all other interfaces must be retrieved through IFireAlert




	set lib = CreateObject("ARGSOFT_AAC_FireAlert.FireAlert")



Also, method ‘Initialize’ must be called first before using any other methods




	bRC = lib.Initialize(csProduct)  



See the Appendix for the demo VBscript

Note: Only 32-bit ActiveX Library is supported (to matching 32-bit Argent Console Engine)

To run the demo script on 64-bit Windows, use command line:

C:\windows\syswow64\cscript demo.vbs

IAlertInfo

This interface helps composing the internal representation of alerts used in Event request

The interface is only available using the main interface ‘IFireAlert’




	set alert_helper = lib.GetAlertInfoComposer



	alert_helper.AlertName = "ALARM_DEMO"



	alerts = alert_helper.Compose



	alert_helper.AlertName = "ALARM_CUSTOM"



	alerts = alerts & chr(13) & chr(10) & alert_helper.Compose



	lib.Alerts = alerts



The interface can also enumerate Alert and Alert macro definitions

Properties

  • AlertName

    Syntax: [propput, id(19), helpstring(“property AlertName”)] HRESULT AlertName([in] BSTR newVal);

    Description: Write-only. Alert name that must be assigned before calling method ‘Compose’

Methods

  • SetTimeRange

    Syntax: [id(20), helpstring(“method SetTimeRange”)] HRESULT SetTimeRange(VARIANT_BOOL bBetween, DATE StartTime, DATE EndTime, BSTR szCalendar);

    Parameters:

    bBetween – true if within time range, false if outside

    StartTime – Start time for time range

    EndTime – End time for time range

    szCalendar – Calendar name. Empty if not used

    Return: None

  • UseExecutor

    Syntax: [id(21), helpstring(“method UseExecutor”)] HRESULT UseExecutor(BSTR szSpecific)

    Parameters:

    szSpecific – String. Argent Alert Executor name

    Return: None

  • Compose

    Syntax: [id(22), helpstring(“method Compose”)] HRESULT Compose([out,retval] BSTR* pVal);

    Parameters: None

    Return: String. It is the internal representation of the Alert

  • GetEmailAlerts

    Input: None

    Return: Alert names are returned in array

    Example:




	lines = alert_helper.GetEmailAlerts



	wscript.echo "List of defined Email alerts:"



	for i = 0 to ubound(lines)



		wscript.echo (i+1) & ": " & lines(i)



	next



  • GetPagerAlerts
  • GetSMSAlerts
  • GetMessageAlerts
  • GetAlarmAlerts
  • GetTweetAlerts
  • GetEventLogAlerts
  • GetSystemCommandAlerts
  • GetRebootAlerts
  • GetServiceAlerts
  • GetHelpDeskAlerts
  • GetWMIAlerts
  • GetPowerShellAlerts
  • GetUnixScriptAlerts
  • GetiSeriesCommandAlerts
  • GetSNMPAlerts
  • GetAlertMacros
  • IEscalationInfo

    This interface helps composing the internal representation of escalations used in Event request

    The interface is only available using the main interface ‘IFireAlert’

    
    
    
    
    
    	set escalation_helper = lib.GetEscalationInfoComposer
    
    
    
    	escalation_helper.iWaitMinute = 30
    
    
    
    	escalation_helper.AlertName = "ALARM_DEMO"
    
    
    
    	lib.Escalations = escalation_helper.Compose
    
    
    
    

    Properties

    • AlertName

      Syntax: [propput, id(1), helpstring(“property AlertName”)] HRESULT AlertName([in] BSTR newVal);

      Description: Write-only. Alert name that must be assigned before calling method ‘Compose’

    • iWaitMinute

      Syntax: [propput, id(2), helpstring(“property iWaitMinute”)] HRESULT iWaitMinute([in] LONG newVal);

      Description: Write-only. Minutes to wait before firing escalation

    Methods

    • SetTimeRange

      Syntax: [id(3), helpstring(“method SetTimeRange”)] HRESULT SetTimeRange(VARIANT_BOOL bBetween, DATE StartTime, DATE EndTime, BSTR szCalendar);

      Parameters:

      bBetween – true if within time range, false if outside

      StartTime – Start time for time range

      EndTime – End time for time range

      szCalendar – Calendar name. Empty if not used

      Return: None

    • UseExecutor

      Syntax: [id(4), helpstring(“method UseExecutor”)] HRESULT UseExecutor(BSTR szSpecific)

      Parameters:

      szSpecific – String. Argent Alert Executor name

      Return: None

    • Compose

      Syntax: [id(5), helpstring(“method Compose”)] HRESULT Compose([out,retval] BSTR* pVal);

      Parameters: None

      Return: String. It is the internal representation of the escalation.

    IStopEscalInfo

    Use this interface to send auto-resolution request to Argent Console Engine

    The interface is only available using the main interface ‘IFireAlert’

    
    
    
    
    
    	set stopescal_helper = lib.GetStopEscalInfoComposer
    
    
    
    	stopescal_helper.Rule = demo_rule
    
    
    
    	stopescal_helper.Server = machine_name
    
    
    
    	stopescal_helper.Compare = demo_compare
    
    
    
    	stopescal_helper.OKDetail = description_rule_no_longer_broken
    
    
    
    	stopescal_helper.AutoResolve engine
    
    
    
    	if Err <> 0 then 
    
    
    
    	  	'Failed to auto resolve
    
    
    
    	end if
    
    
    
    

    Properties

    • RuleName

      Syntax: [propput, id(1), helpstring(“property RuleName”)] HRESULT RuleName([in] BSTR newVal);

      Description: Write-only

    • Server

      Syntax: [propput, id(2), helpstring(“property Server”)] HRESULT Server([in] BSTR newVal);

      Description: Write-only

    • Compare

      Syntax: [propput, id(3), helpstring(“property Compare”)] HRESULT Compare([in] BSTR newVal);

      Description: Write-only

    • OKDetail

      Syntax: [propput, id(4), helpstring(“property OKDetail”)] HRESULT OKDetail([in] BSTR newVal);

      Description: Write-only

    Method

    • AutoResolve

      Syntax: [id(5), helpstring(“method AutoResolve”)] HRESULT AutoResolve([in] BSTR AACEngine);

      Parameters:

      AACEngine – Argent Console Engine

      Return: None

    IResetOccurCount

    Use this interface to reset occurrence count of a condition, which is defined as combination of server, Rule, Relator and comparison string

    The interface is only available using the main interface ‘IFireAlert’

    
    
    
    
    
    	set reset_helper = lib.GetResetOccurCountComposer
    
    
    
    	reset_helper.Rule = demo_rule
    
    
    
    	reset_helper.Server = machine_name
    
    
    
    	reset_helper.Compare = demo_compare
    
    
    
    	reset_helper.Relator = demo_relator
    
    
    
    	reset_helper.Reset  engine
    
    
    
    	if Err <> 0 then 
    
    
    
    		' Failed to reset
    
    
    
    	end if
    
    
    
    

    Properties

    • RuleName

      Syntax: [propput, id(1), helpstring(“property RuleName”)] HRESULT RuleName([in] BSTR newVal);

      Description: Write-only

    • Server

      Syntax: [propput, id(2), helpstring(“property Server”)] HRESULT Server([in] BSTR newVal);

      Description: Write-only

    • Compare

      Syntax: [propput, id(3), helpstring(“property Compare”)] HRESULT Compare([in] BSTR newVal);

      Description: Write-only

    • Relator

      Syntax: [propput, id(4), helpstring(“property Relator”)] HRESULT Relator([in] BSTR newVal);

      Description: Write-only

    Methods

    • Reset

      Syntax: [id(5), helpstring(“method Reset”)] HRESULT Reset(BSTR AACEngine)

      Parameters:

      AACEngine – Argent Console Engine

      Return: None

    IAnswerEventInfo

    Use this interface to answer an existing Event

    The interface is only available using the main interface ‘IFireAlert’

    
    
    
    	set answer_helper = lib.GetAnswerEventInfoComposer
    
    
    
    	answer_helper.Answer used_engine, JNumber, event_status_resolved, Now, 0, "Resolved by demo.vbs"
    
    
    
    

    Properties

    • ShouldBePurged

      Syntax: [propput, id(2), helpstring(“property ShouldBePurged”)] HRESULT ShouldBePurged([in] VARIANT_BOOL newVal);

      Description: Write-only. If true, event is purged from database

    Methods

    • Answer

      Syntax: [id(1), helpstring(“method Answer”)] HRESULT Answer([in] BSTR AACEngine, LONG JNumber, LONG Status, DATE RepairTime, LONG KeepRepairMinutes, BSTR Memo);

      Parameters:

      AACEngine – String. Argent Console Engine

      JNumber – Number. Event number

      Status – Number. 0 for not answered, 1 for answered, 2 for resolved.

      RepairTime – Date/Time. Start time for the maintenance

      KeepRepairMinutes – Number. Minutes to stay in maintenance. If it is zero, event is not set in maintenance

      Memo – String.

      Return: None

    IFireAlert

    This is the main interface for the library

    To use the library, an object must be first created for the interface, then call the method ‘Initialization’ before doing anything else

    
    
    
    	set lib = CreateObject("ARGSOFT_AAC_FireAlert.FireAlert")
    
    
    
    	bRC = lib.Initialize(csProduct)
    
    
    
    

    Properties

    • VersionString

      Syntax: [propget, id(2), helpstring(“property VersionString”)] HRESULT VersionString([out, retval] BSTR* pVal);

      Description: String, Read-only

    • ServerName

      Syntax: [propput, id(4), helpstring(“property ServerName”)] HRESULT ServerName([in] BSTR newVal);

      Description: String, Write-only. The machine that condition is about

    • RelatorName

      Syntax: [propput, id(5), helpstring(“property RelatorName”)] HRESULT RelatorName([in] BSTR newVal);

      Description: String, Write-only. The Relator that condition is about

    • ApplicationName

      Syntax:

      [propput, id(6), helpstring(“property ApplicationName”)] HRESULT ApplicationName([in] BSTR newVal);

      Description: String, Write-only. The application that condition is about

    • Alerts

      Syntax: [propput, id(8), helpstring(“property Alerts”)] HRESULT Alerts([in] BSTR newVal);

      Description: String, Write-only. Use IAlertInfo to compose the internal representation of alerts before assigning to this property

    • Escalations

      Syntax: [propput, id(9), helpstring(“property Escalations”)] HRESULT Escalations([in] BSTR newVal);

      Description: String, Write-only. Use IEscalationInfo to compose the internal representation of escalation before assigning to this property

    • UsedAACEngine

      Syntax: [propget, id(10), helpstring(“property UsedAACEngine”)] HRESULT UsedAACEngine([out, retval] BSTR* pVal);

      Description: String, Read-only. It returns the Argent Console engine that actually accepted the event request. In Argent Non-Stop Monitor environment, one of live motors is selected to handle the event request

    • Dropped

      Syntax: [propget, id(11), helpstring(“property Dropped”)] HRESULT Dropped([out, retval] VARIANT_BOOL* pVal);

      Description: Bool, Read-only. It returns true if event request is dropped because maximum allowed has been reached.

    • ConsoleComment

      Syntax: [propput, id(14), helpstring(“property ConsoleComment”)] HRESULT ConsoleComment([in] BSTR newVal);

      Description: String, Write-only

    • RuleDescription

      Syntax: [propput, id(15), helpstring(“property RuleDescription”)] HRESULT RuleDescription([in] BSTR newVal);

      Description: String, Write-only

    • bDoAddConsoleRecord

      Syntax: [propget, id(19), helpstring(“property bDoAddConsoleRecord”)] HRESULT bDoAddConsoleRecord([out, retval] VARIANT_BOOL* pVal);

      Description: Boolean, Read-only. Use this property to determine if the event is added to A1x console. The value is valid only after method ‘GetTraceLog’ returns non-zero value, which means the event request has been processed

    • bDoFireAlert

      Syntax: [propget, id(20), helpstring(“property bDoFireAlert”)] HRESULT bDoFireAlert([out, retval] VARIANT_BOOL* pVal);

      Description: Boolean, Read-only. Use this property to determine if the alerts in the request will be fired. The value is valid only after method ‘GetTraceLog’ returns non-zero value, which means the event request has been processed.

    • TraceLogs

      Syntax: [propget, id(21), helpstring(“property TraceLogs”)] HRESULT TraceLogs([out, retval] VARIANT* pVal);

      Description: Boolean, Read-only. Use this property to get the downloaded trace logs for event request. The value is valid only after calling method ‘GetTraceLog’.

    Methods

    • Initialize

      Syntax: [id(1), helpstring(“method Initialize”)] HRESULT Initialize([in] BSTR szProductName, [out,retval] VARIANT_BOOL* pbResult);

      Parameters:

      szProductName – Caller name. It is for logging purpose.

      Return: Boolean. True if successful, false if failed

    • SetRuleName

      Syntax: [id(3), helpstring(“method SetRuleName”)] HRESULT SetRuleName(BSTR szRuleName, BSTR szRuleCategory);

      Parameters:

      szRuleName – Rule name

      szRuleCategory – Rule category. It is usually a UUID string.

      Return: None

    • SetEventInfo

      Syntax: [id(7), helpstring(“method SetEventInfo”)] HRESULT SetEventInfo(DATE BrokenTime, BSTR Summary, BSTR Detail, BSTR Compare, VARIANT_BOOL bAlwaysNotifyConsole);

      Parameters:

      BrokenTime – Time when condition happens

      Summary – Short description of condition

      Detail – Long description of condition

      Compare – Comparison string to identify the condition

      bAlwaysNotifyConsole – It is the same as the Rule definition field ‘Post Event Even The Same Event Is Still Outstanding’.

      Return: None

    • PostEvent

      Syntax: [id(12), helpstring(“method PostEvent”)] HRESULT PostEvent([in] BSTR AACEngine, [out,retval] LONG* pVal);

      Parameters:

      AACEngine – Argent Console engine

      Return: Positive event number if successful. Zero if failed

    • SetAutoResolve

      Syntax: [id(13), helpstring(“method SetAutoResolve”)] HRESULT SetAutoResolve(VARIANT_BOOL bStopEscalWhenRuleOK, LONG iSetAnswerStatusWhenOK, BSTR CorrectionNotifyAlerts);

      Parameters:

      bStopEscalWhenRuleOK – True if stop escalation when condition is corrected

      iSetAnswerStatusWhenOK – 1 for answer, 2 for resolve

      CorrectionNotifyAlerts – Auto-correction notification. Use IAlertInfo to compose the internal representation of alerts before assigning to this property

      Return: None

      Comment: The settings match the ‘Recheck Settings’ in Relator

    • CheckOccurrence

      Syntax: [id(16), helpstring(“method CheckOccurrence”)] HRESULT CheckOccurrence(LONG iAlertAfterOccurTimes, VARIANT_BOOL bResetAfterAnswer, VARIANT_BOOL bResetAfterAlert);

      Parameters:

      iAlertAfterOccurTimes – Occurrence count before firing event

      bResetAfterAnswer – Reset occurrence count after event is answered or resolved

      bResetAfterAlert – Reset occurrence count after alert is fired

      Return: None

      Comment: The settings match the ‘Reset Counter’ in Rule definition

    • SetPriority

      Syntax: [id(17), helpstring(“method SetPriority”)] HRESULT SetPriority([in] LONG iPriority, [in] BSTR szCustomPriorityText);

      Parameters:

      iPriority – 0 for low, 1 for medium, 2 for high

      szCustomPriorityText – Custom priority text

      Return: None

    • GetTraceLog

      Syntax: [id(18), helpstring(“method GetTraceLog”)] HRESULT GetTraceLog(BSTR AACEngine, LONG JNumber, [out,retval] LONG* pVal);

      Parameters:

      AACEngine – Argent Console Engine

      JNumber – Event number

      Return: Long. Non-zero if event has been processed

    • GetAlertInfoComposer

      Syntax: [id(22), helpstring(“method GetAlertInfoComposer”)] HRESULT GetAlertInfoComposer([out, retval] IAlertInfo** pVal);

      Parameters: None

      Return: IAlertInfo interface

    • GetEscalationInfoComposer

      Syntax: [id(23), helpstring(“method GetEscalationInfoComposer”)] HRESULT GetEscalationInfoComposer([out, retval] IEscalationInfo** pVal);

      Parameters: None

      Return: IEscalationInfo interface

    • GetResetOccurCountComposer

      Syntax: [id(24), helpstring(“method GetResetOccurCountComposer”)] HRESULT GetResetOccurCountComposer([out, retval] IResetOccurCount** pVal);

      Parameters: None

      Return: IResetOccurCount interface

    • GetAnswerEventInfoComposer

      Syntax: [id(25), helpstring(“method GetAnswerEventInfoComposer”)] HRESULT GetAnswerEventInfoComposer([out, retval] IAnswerEventInfo** pVal);

      Parameters: None

      Return: IAnswerEventInfo interface

    • GetStopEscalInfoComposer

      Syntax: [id(26), helpstring(“method GetStopEscalInfoComposer”)] HRESULT GetStopEscalInfoComposer([out, retval] IStopEscalInfo** pVal);

      Parameters: None

      Return: IStopEscalInfo interface

    Appendix A – Demo VBScript

    
    
    
     
    
    ' 
    
    '  Copyright (c) 2016 ArgSoft Pacific Intellectual Property Holdings (HK), Limited
    
    ' 
    
    '  All Rights Reserved.
    
    ' 
    
    '  ArgSoft Pacific Intellectual Property Holdings (HK), Limited
    
    '  2017-2018 Metropolis Tower 
    
    '  The Metropolis, 10 Metropolis Drive 
    
    '  Hong Kong
    
    ' 
    
    ' 
    
    ' 
    
    '  This is PROPRIETARY SOURCE CODE of ArgSoft Pacific Intellectual Property Holdings (HK), Limited.
    
    ' 
    
    '  The contents of this file may not be disclosed to third parties, copied or
    
    '  duplicated in any form, in whole or in part, without the prior written
    
    '  permission of ArgSoft Pacific Intellectual Property Holdings (HK), Limited.
    
    ' 
    
    '  RESTRICTED RIGHTS LEGEND:
    
    '  Use, duplication or disclosure by the Government is subject to restrictions
    
    '  as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
    
    '  and Computer Software clause at DFARS 252.227-7013, and/or in similar or
    
    '  successor clauses in the FAR, DOD or NASA FAR Supplement.
    
    ' 
    
    '  Unpublished - rights reserved under the Copyright Laws of the United States
    
    '  and other countries.
    
    ' 
    
    
    
    
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' This script demonstrates how to use ActiveX Library for Argent Total Support Interface 
    
    '
    
    ' to enumerate alert definitions, fire and answer a demo event
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    
    
    
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Global variables 
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    option explicit
    
    
    
    dim bRC
    
    
    
    dim lib
    
    
    
    dim alert_helper
    
    
    
    dim escalation_helper
    
    
    
    dim alerts
    
    
    
    dim JNumber
    
    
    
    dim used_engine
    
    
    
    dim status
    
    
    
    dim lines
    
    
    
    dim answer_helper
    
    
    
    dim i
    
    
    
     
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' API constants 
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    const event_status_pending = 0
    
    
    
    const event_status_answered = 1
    
    
    
    const event_status_resolved = 2
    
    
    
     
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Customize following constants to test various situation 
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    
    
    const csProduct = "Argent Total Interface ActiveX Library Demo"
    
    
    
    const engine = "W2008r264PANWS"
    
    
    
    const summary = "Demo summary"
    
    
    
    const detail = "Demo detail"
    
    
    
    const compare = "Demo"
    
    
    
    const demo_server = "W2008R264PANWS"
    
    
    
    const demo_rule_name = "DEMO_RULE"
    
    
    
    const demo_rule_category = "c934e37e-213e-4ba4-920e-9f7c3c3a60d1"
    
    
    
    const demo_relator = "DEMO_RELATOR"
    
    
    
    const demo_app = "DEMO App"
    
    
    
    
    
    Sub RunScript
    
    
    
    
    
    On Error Resume Next
    
    
    
     
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' ATLicenseManager is the only ActiveX object to create externally 
    
    '
    
    ' The log file 'ARGENT_AT_LICENSE_MANAGER_LOG.TXT' resides in the same directory as Dll
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    
    
    set lib = CreateObject("ARGSOFT_AAC_FireAlert.FireAlert")
    
    
    
    
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' First call method 'Initialize'
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    
    
    bRC = lib.Initialize(csProduct)
    
    
    
     
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Library runs only on machine with Argent Console installed
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    if Err <> 0 then
    
    
    
    	wscript.echo Err.Description & " (" & Err.Source & ")"
    
    
    
    	Exit Sub
    
    
    
    end if
    
    
    
    if bRC = false then
    
    
    
    	wscript.echo "Failed to initialize Total Support Interface ActiveX Library"
    
    
    
    	exit sub
    
    
    
    end if
    
    
    
    wscript.echo "Initialized Total Support Interface ActiveX Library (" & lib.VersionString & ")"
    
    
    
    
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Demo how to list existing alert definitions
    
    '
    
    ' Methods exists for all alert types and alert macros
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    set alert_helper = lib.GetAlertInfoComposer
    
    
    
    lines = alert_helper.GetEmailAlerts
    
    
    
    wscript.echo "List of defined Email alerts:"
    
    
    
    for i = 0 to ubound(lines)
    
    
    
    	wscript.echo (i+1) & ": " & lines(i)
    
    
    
    next
    
    
    
    
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Prepare event request
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    
    
    lib.SetRuleName demo_rule_name, demo_rule_category
    
    
    
    lib.ServerName = demo_server
    
    
    
    lib.RelatorName = demo_relator
    
    
    
    lib.ApplicationName = demo_app
    
    
    
    lib.SetEventInfo Now, summary, detail, compare, true
    
    
    
    
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Compose alerts using IAlertInfo, multiple alerts are separated by new lines
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    
    
    set alert_helper = lib.GetAlertInfoComposer
    
    
    
    alert_helper.AlertName = "ALARM_DEMO"
    
    
    
    alerts = alert_helper.Compose
    
    
    
    alert_helper.AlertName = "ALARM_CUSTOM"
    
    
    
    alerts = alerts & chr(13) & chr(10) & alert_helper.Compose
    
    
    
    lib.Alerts = alerts
    
    
    
     
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Compose alerts using IEscalationInfo, multiple escalations are separated by new lines
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    
    
    set escalation_helper = lib.GetEscalationInfoComposer
    
    
    
    escalation_helper.iWaitMinute = 30
    
    
    
    escalation_helper.AlertName = "ALARM_DEMO"
    
    
    
    lib.Escalations = escalation_helper.Compose
    
    
    
     
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Post Event
    
    '
    
    ' In Argent Non-Stop environment, an available engine will be selected
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    
    
    JNumber = lib.PostEvent(engine)
    
     
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Exception is thrown in case of communication error
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    if Err <> 0 then
    
    
    
    	wscript.echo Err.Description & " (" & Err.Source & ")"
    
    
    
    	Exit Sub
    
    
    
    end if
    
    
    
     
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Job number ZERO is returned if failed to post event requests
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    if JNumber <= 0 then
    
    
    
    	if lib.Dropped = false then
    
    
    
    		wscript.echo "Failed to post event. Argent Console engine is not available"
    
    
    
    	else
    
    
    
    		wscript.echo "Event is dropped due to limit exceeded"
    
    
    
    	end if
    
    
    
    	Exit Sub
    
    
    
    end if
    
    
    
    
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' The used Argent Console engine is not neccessary the one requested 
    
    '
    
    ' in Argent Non-Stop Monitor environment
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    
    
    used_engine = lib.UsedAACEngine
    
    
    
    wscript.echo "Successfully post event request (J#" & JNumber & ") to engine '" & used_engine & "'"
    
    
    
    
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Get trace log until event request is handled
    
    '
    
    ' Method returns non-zero value if event request has been handled
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    status = lib.GetTraceLog(used_engine, JNumber)
    
    
    
    if Err <> 0 then 
    
    
    
    	wscript.echo Err.Description & " (" & Err.Source & ")"
    
    
    
    	exit sub
    
    
    
    end if
    
    
    
    while status <> 1 
    
    
    
    
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Retrieve downloaded trace logs using property 'TraceLogs'
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    	lines = lib.TraceLogs
    
    
    
    	for i = 0 to ubound(lines)
    
    
    
    		wscript.echo lines(i)
    
    
    
    	next
    
    
    
    	wscript.echo "Waiting for task to complete..."
    
    
    
    	wscript.sleep 1000
    
    
    
    	status = lib.GetTraceLog(used_engine, JNumber)
    
    
    
    wend
    
    
    
    if status = 1 then
    
    
    
    
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Test if event record is addede to A1x using property 'bDoAddConsoleRecord'
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    
    
    	if lib.bDoAddConsoleRecord then 
    
    
    
    		wscript.echo "J#" & JNumber & ": Event record is added"
    
    
    
    	end if
    
    
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Test if alerts should be fired property 'bDoFireAlert'
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    	if lib.bDoFireAlert then
    
    
    
    		wscript.echo "J#" & JNumber & ": Alerts are queued"
    
    
    
    	end if
    
    
    
    
    
    
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Retrieve downloaded trace logs using property 'TraceLogs'
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    	lines = lib.TraceLogs
    
    
    
    	for i = 0 to ubound(lines)
    
    
    
    		wscript.echo lines(i)
    
    
    
    	next
    
    
    
    else
    
    
    
    	wscript.echo "J#" & JNumber & " (error): Failed to read alert trace log"
    
    
    
    	exit sub
    
    
    
    end if
    
    
    
    
    
    if lib.bDoAddConsoleRecord then
    
    
    
    
    
    ' ---------------------------------------------------------------------------------------
    
    '
    
    ' Answer, resolve or set event in maintenance using IAnswerEventInfo
    
    '
    
    ' ---------------------------------------------------------------------------------------
    
    
    
    	set answer_helper = lib.GetAnswerEventInfoComposer
    
    
    
    	answer_helper.Answer used_engine, JNumber, event_status_resolved, Now, 0, "Resolved by demo.vbs"
    
    
    
    	if Err <> 0 then 
    
    
    
    		wscript.echo Err.Description & " (" & Err.Source & ")"
    
    
    
    		exit sub
    
    
    
    	end if
    
    
    
    	wscript.echo "J#" & JNumber & ": Resolved by demo.vbs"
    
    
    
    end if
    
    
    
    End Sub
    
    
    
    
    
    RunScript
    
    
    
    
    
    
    
    
    
    

    Appendix B – Interface Description File (IDL)

    
    
    
    // ARGSOFT_AAC_FireAlert.idl : IDL source for ARGSOFT_AAC_FireAlert
    
    //
    
    
    
    // This file will be processed by the MIDL tool to
    
    // produce the type library (ARGSOFT_AAC_FireAlert.tlb) and marshalling code.
    
    
    
    import "oaidl.idl";
    
    import "ocidl.idl";
    
    
    
    [
    
    	object,
    
    	uuid(85197F82-E065-4C79-AC54-053767995A36),
    
    	dual,
    
    	nonextensible,
    
    	helpstring("IAlertInfo Interface"),
    
    	pointer_default(unique)
    
    ]
    
    interface IAlertInfo : IDispatch{
    
    	[id(1), helpstring("method GetEmailAlerts")] HRESULT GetEmailAlerts([out,retval] VARIANT* pVal);
    
    	[id(2), helpstring("method GetPagerAlerts")] HRESULT GetPagerAlerts([out,retval] VARIANT* pVal);
    
    	[id(3), helpstring("method GetSMSAlerts")] HRESULT GetSMSAlerts([out,retval] VARIANT* pVal);
    
    	[id(4), helpstring("method GetMessageAlerts")] HRESULT GetMessageAlerts([out,retval] VARIANT* pVal);
    
    	[id(5), helpstring("method GetAlarmAlerts")] HRESULT GetAlarmAlerts([out,retval] VARIANT* pVal);
    
    	[id(6), helpstring("method GetTweetAlerts")] HRESULT GetTweetAlerts([out,retval] VARIANT* pVal);
    
    	[id(7), helpstring("method GetEventLogAlerts")] HRESULT GetEventLogAlerts([out,retval] VARIANT* pVal);
    
    	[id(8), helpstring("method GetSystemCommandAlerts")] HRESULT GetSystemCommandAlerts([out,retval] VARIANT* pVal);
    
    	[id(9), helpstring("method GetRebootAlerts")] HRESULT GetRebootAlerts([out,retval] VARIANT* pVal);
    
    	[id(10), helpstring("method GetSQLAlerts")] HRESULT GetSQLAlerts([out,retval] VARIANT* pVal);
    
    	[id(11), helpstring("method GetServiceAlerts")] HRESULT GetServiceAlerts([out,retval] VARIANT* pVal);
    
    	[id(12), helpstring("method GetHelpDeskAlerts")] HRESULT GetHelpDeskAlerts([out,retval] VARIANT* pVal);
    
    	[id(13), helpstring("method GetWMIAlerts")] HRESULT GetWMIAlerts([out,retval] VARIANT* pVal);
    
    	[id(14), helpstring("method GetPowerShellAlerts")] HRESULT GetPowerShellAlerts([out,retval] VARIANT* pVal);
    
    	[id(15), helpstring("method GetUnixScriptAlerts")] HRESULT GetUnixScriptAlerts([out,retval] VARIANT* pVal);
    
    	[id(16), helpstring("method GetiSeriesCommandAlerts")] HRESULT GetiSeriesCommandAlerts([out,retval] VARIANT* pVal);
    
    	[id(17), helpstring("method GetSNMPAlerts")] HRESULT GetSNMPAlerts([out,retval] VARIANT* pVal);
    
    	[id(18), helpstring("method GetAlertMacros")] HRESULT GetAlertMacros([out,retval] VARIANT* pVal);
    
    	[propput, id(19), helpstring("property AlertName")] HRESULT AlertName([in] BSTR newVal);
    
    	[id(20), helpstring("method SetTimeRange")] HRESULT SetTimeRange(VARIANT_BOOL bBetween, DATE StartTime, DATE EndTime, BSTR szCalendar);
    
    	[id(21), helpstring("method UseExecutor")] HRESULT UseExecutor(BSTR szSpecific);
    
    	[id(22), helpstring("method Compose")] HRESULT Compose([out,retval] BSTR* pVal);
    
    }
    
    [
    
    	object,
    
    	uuid(41C7FAB2-70A8-4612-A91F-CC941AFB9E2C),
    
    	dual,
    
    	nonextensible,
    
    	helpstring("IEscalationInfo Interface"),
    
    	pointer_default(unique)
    
    ]
    
    interface IEscalationInfo : IDispatch{
    
    	[propput, id(1), helpstring("property AlertName")] HRESULT AlertName([in] BSTR newVal);
    
    	[propput, id(2), helpstring("property iWaitMinute")] HRESULT iWaitMinute([in] LONG newVal);
    
    	[id(3), helpstring("method SetTimeRange")] HRESULT SetTimeRange(VARIANT_BOOL bBetween, DATE StartTime, DATE EndTime, BSTR szCalendar);
    
    	[id(4), helpstring("method UseExecutor")] HRESULT UseExecutor(BSTR szSpecific);
    
    	[id(5), helpstring("method Compose")] HRESULT Compose([out,retval] BSTR* pVal);
    
    };
    
    [
    
    	object,
    
    	uuid(E821DC79-48D3-47BF-AC03-C3246E795A70),
    
    	dual,
    
    	nonextensible,
    
    	helpstring("IStopEscalInfo Interface"),
    
    	pointer_default(unique)
    
    ]
    
    interface IStopEscalInfo : IDispatch{
    
    	[propput, id(1), helpstring("property RuleName")] HRESULT RuleName([in] BSTR newVal);
    
    	[propput, id(2), helpstring("property Server")] HRESULT Server([in] BSTR newVal);
    
    	[propput, id(3), helpstring("property Compare")] HRESULT Compare([in] BSTR newVal);
    
    	[propput, id(4), helpstring("property OKDetail")] HRESULT OKDetail([in] BSTR newVal);
    
    	[id(5), helpstring("method AutoResolve")] HRESULT AutoResolve([in] BSTR AACEngine);
    
    };
    
    [
    
    	object,
    
    	uuid(29BBCADE-6990-4E8E-B183-13F2CAD50C45),
    
    	dual,
    
    	nonextensible,
    
    	helpstring("IResetOccurCount Interface"),
    
    	pointer_default(unique)
    
    ]
    
    interface IResetOccurCount : IDispatch{
    
    	[propput, id(1), helpstring("property RuleName")] HRESULT RuleName([in] BSTR newVal);
    
    	[propput, id(2), helpstring("property Server")] HRESULT Server([in] BSTR newVal);
    
    	[propput, id(3), helpstring("property Compare")] HRESULT Compare([in] BSTR newVal);
    
    	[propput, id(4), helpstring("property Relator")] HRESULT Relator([in] BSTR newVal);
    
    	[id(5), helpstring("method Reset")] HRESULT Reset(BSTR AACEngine);
    
    };
    
    [
    
    	object,
    
    	uuid(7E2C8D67-6B07-4E4F-B279-DEF5CB543209),
    
    	dual,
    
    	nonextensible,
    
    	helpstring("IAnswerEventInfo Interface"),
    
    	pointer_default(unique)
    
    ]
    
    interface IAnswerEventInfo : IDispatch{
    
    	[id(1), helpstring("method Answer")] HRESULT Answer([in] BSTR AACEngine, LONG JNumber, LONG Status, DATE RepairTime, LONG KeepRepairMinutes, BSTR Memo);
    
    	[propput, id(2), helpstring("property ShouldBePurged")] HRESULT ShouldBePurged([in] VARIANT_BOOL newVal);
    
    };
    
    [
    
    	object,
    
    	uuid(7BDDC3B7-B357-4088-9004-07AA83D255A7),
    
    	dual,
    
    	nonextensible,
    
    	helpstring("IFireAlert Interface"),
    
    	pointer_default(unique)
    
    ]
    
    interface IFireAlert : IDispatch{
    
    	[id(1), helpstring("method Initialize")] HRESULT Initialize([in] BSTR szProductName, [out,retval] VARIANT_BOOL* pbResult);
    
    	[propget, id(2), helpstring("property VersionString")] HRESULT VersionString([out, retval] BSTR* pVal);
    
    	[id(3), helpstring("method SetRuleName")] HRESULT SetRuleName(BSTR szRuleName, BSTR szRuleCategory);
    
    	[propput, id(4), helpstring("property ServerName")] HRESULT ServerName([in] BSTR newVal);
    
    	[propput, id(5), helpstring("property RelatorName")] HRESULT RelatorName([in] BSTR newVal);
    
    	[propput, id(6), helpstring("property ApplicationName")] HRESULT ApplicationName([in] BSTR newVal);
    
    	[id(7), helpstring("method SetEventInfo")] HRESULT SetEventInfo(DATE BrokenTime, BSTR Summary, BSTR Detail, BSTR Compare, VARIANT_BOOL bAlwaysNotifyConsole);
    
    	[propput, id(8), helpstring("property Alerts")] HRESULT Alerts([in] BSTR newVal);
    
    	[propput, id(9), helpstring("property Escalations")] HRESULT Escalations([in] BSTR newVal);
    
    	[propget, id(10), helpstring("property UsedAACEngine")] HRESULT UsedAACEngine([out, retval] BSTR* pVal);
    
    	[propget, id(11), helpstring("property Dropped")] HRESULT Dropped([out, retval] VARIANT_BOOL* pVal);
    
    	[id(12), helpstring("method PostEvent")] HRESULT PostEvent([in] BSTR AACEngine, [out,retval] LONG* pVal);
    
    	[id(13), helpstring("method SetAutoResolve")] HRESULT SetAutoResolve(VARIANT_BOOL bStopEscalWhenRuleOK, LONG iSetAnswerStatusWhenOK, BSTR CorrectionNotifyAlerts);
    
    	[propput, id(14), helpstring("property ConsoleComment")] HRESULT ConsoleComment([in] BSTR newVal);
    
    	[propput, id(15), helpstring("property RuleDescription")] HRESULT RuleDescription([in] BSTR newVal);
    
    	[id(16), helpstring("method CheckOccurrence")] HRESULT CheckOccurrence(LONG iAlertAfterOccurTimes, VARIANT_BOOL bResetAfterAnswer, VARIANT_BOOL bResetAfterAlert);
    
    	[id(17), helpstring("method SetPriority")] HRESULT SetPriority([in] LONG iPriority, [in] BSTR szCustomPriorityText);
    
    	[id(18), helpstring("method GetTraceLog")] HRESULT GetTraceLog(BSTR AACEngine, LONG JNumber, [out,retval] LONG* pVal);
    
    	[propget, id(19), helpstring("property bDoAddConsoleRecord")] HRESULT bDoAddConsoleRecord([out, retval] VARIANT_BOOL* pVal);
    
    	[propget, id(20), helpstring("property bDoFireAlert")] HRESULT bDoFireAlert([out, retval] VARIANT_BOOL* pVal);
    
    	[propget, id(21), helpstring("property TraceLogs")] HRESULT TraceLogs([out, retval] VARIANT* pVal);
    
    	[id(22), helpstring("method GetAlertInfoComposer")] HRESULT GetAlertInfoComposer([out, retval] IAlertInfo** pVal);
    
    	[id(23), helpstring("method GetEscalationInfoComposer")] HRESULT GetEscalationInfoComposer([out, retval] IEscalationInfo** pVal);
    
    	[id(24), helpstring("method GetResetOccurCountComposer")] HRESULT GetResetOccurCountComposer([out, retval] IResetOccurCount** pVal);
    
    	[id(25), helpstring("method GetAnswerEventInfoComposer")] HRESULT GetAnswerEventInfoComposer([out, retval] IAnswerEventInfo** pVal);
    
    	[id(26), helpstring("method GetStopEscalInfoComposer")] HRESULT GetStopEscalInfoComposer([out, retval] IStopEscalInfo** pVal);
    
    }
    
    [
    
    	uuid(83C51CAB-C59D-46C3-9227-A9392A1D9217),
    
    	version(1.0),
    
    	helpstring("ARGSOFT_AAC_FireAlert 1.0 Type Library")
    
    ]
    
    library ARGSOFT_AAC_FireAlertLib
    
    {
    
    	importlib("stdole2.tlb");
    
    	[
    
    		uuid(C1F8526E-D45C-4EDA-A7B2-A7CD8D634CBE),
    
    		helpstring("FireAlert Class")
    
    	]
    
    	coclass FireAlert
    
    	{
    
    		[default] interface IFireAlert;
    
    	};
    
    	[
    
    		uuid(D220BC0F-2863-4B8B-9A60-98A74E722482),
    
    		helpstring("AlertInfo Class")
    
    	]
    
    	coclass AlertInfo
    
    	{
    
    		[default] interface IAlertInfo;
    
    	};
    
    	[
    
    		uuid(126F4653-E3A4-4A02-8AC9-4B6A3C883482),
    
    		helpstring("EscalationInfo Class")
    
    	]
    
    	coclass EscalationInfo
    
    	{
    
    		[default] interface IEscalationInfo;
    
    	};
    
    	[
    
    		uuid(FC93ECA0-3CAB-44BB-ABB7-F37E4043427D),
    
    		helpstring("StopEscalInfo Class")
    
    	]
    
    	coclass StopEscalInfo
    
    	{
    
    		[default] interface IStopEscalInfo;
    
    	};
    
    	[
    
    		uuid(8C9EA2F9-2ECF-448A-B430-245E0BC10223),
    
    		helpstring("ResetOccurCount Class")
    
    	]
    
    	coclass ResetOccurCount
    
    	{
    
    		[default] interface IResetOccurCount;
    
    	};
    
    	[
    
    		uuid(2C7AA2E9-C8B8-479A-8176-CDCA4AC7836D),
    
    		helpstring("AnswerEventInfo Class")
    
    	]
    
    	coclass AnswerEventInfo
    
    	{
    
    		[default] interface IAnswerEventInfo;
    
    	};
    
    }; 
    
    


    Resolution

    N/A