eXc Software Customization
If you have a background in Windows programming whether it be in scripting (WSH,
VBScript and/or JScript), .Net or unmanaged programming languages, you have the
knowledge to create your own Virtual Agents or modify existing Virtual Agents.
Nearly all of our Virtual Agents are written in Microsoft JScript. This means when
you install any of our Virtual Agents, you have access to the code!
The eXc Software non-Windows baseframework (bfw) is built upon WMI and COM.
The intent of the bfw is much like the Microsoft .Net framework is to managed programs.
The eXc Software bfw performs all the managing of the Virtual Agents so you don't have to.
The WMI interface is just the same as any WMI programs you would write. The COM
objects (which we here at eXc Software call the "child controls") support the COM
dual-interface model (i.e. early binding and late binding support - in laymens terms,
you can use them in scripts and compiled programs).
There is no right or wrong way to use these objects. Rather you should choose
to use them the way that best suits the task you are trying to accomplish. If you
would like to discuss approaches to using the eXc Software objects, please feel
free to call us. We would be happy to brain-storm an approach with you.
As an example, say you have a distributed web application that involves five different systems:
1. HP-UX running the Apache web server
2. RedHat Linux running MySQL
3. A NetApp filer which houses the database
4. A Cisco switch which connects the the 3 systems above
5. An APC power device which powers the 4 systems above in a power failure
In our example, you want to monitor these systems as one logical entity within MOM.
Using the eXc Software child controls you could write one Windows script to accomplish this!
Please select one of the objects below for details:
WMI
The class below represents a WMI extrinsic event that gets generated by the eXc Software Virtual Agents.
This event is primarily used by MOM but any WMI event consumer program can register to receive these events
This event represents an event that has occurred on a non-Windows system or device
(please see eXc_nonWindows_OperatingSystem below)
class
eXc_nonWindows_Alert_Event
{
string strAction
string strAssigned_To
string strClusterNode
string strDescription
string strETA
string strGeneratedBy
string strIPAddress
string strLast_Update
string strNotes
string strSDMClass
string strSeverity
string strSource
string strStart_Date_Time
string strState
string strTarget_Type
string strUUID
string strVirtualAgent
string strVirtualAgentCategory
string strVirtualAgentDirectory
uint32 uint32CommandResponseId
};
The class below represents a Virtual Agent Script. Every Virtual Agent Script must be associated with a system/device.
A system/device is represented by the eXc_nonWindows_OperatingSystem class.
This is a one (eXc_nonWindows_OperatingSystem ) to many (eXc_Virtual_Agent) relationship.
The WMI Event Provider that backs these two related classes ensures these Virtual Agents are run on behalf of the
non-Windows system/device. The intent here is to free you (the Virtual Agent developer) from the details about
connectivity, availability, etc. and therefore allows you to focus mainly on the "business logic".
class
eXc_Virtual_Agent
{
[key] string strHostName
[key] string strApplication
[key] string strFileName
uint32 uint32RunEveryXSeconds
uint32 uint32ShowWindow=6 //HIDE=0, NORMAL=1, MAX=3, MIN=6
boolean booleanDebug
uint32 uint32ProcessID
uint32 uint32ThreadID
uint32 uint32ProcessHandle
uint32 uint32TimerHandle
DATETIME DATETIMEProcessLaunched;
DATETIME DATETIMELoggedIntoHost;
};
The class below represents a non-Windows system/device. This class is backed by a WMI Event Provider.
class
eXc_nonWindows_OperatingSystem
{
[key] string Name
[key] string strApplication
//CLI
uint32 uint32Port
string strUserId
string strPassword
string strLoginPrompt
string strPasswordPrompt
//SNMP
string strSNMPTrapCommunity
string strSNMPReadCommunity
string strSNMPWriteCommunity
boolean booleanSecureConnection
boolean booleanIsPingable
string strState;
string strTerminalType
string strWatchdogProgramName
boolean booleanRunWatchdog
uint32 uint32ShowWatchdogWindow=0; //HIDE=0, NORMAL=1, MAX=3, MIN=6
string strIPAddress
string strClusterNode
string strSDMClass
string strVirtualAgent;
string strVirtualAgentCategory;
string strVirtualAgentDirectory
uint32 IssuenonWindowsCommand(
[IN] string strHostInstanceName,
[IN] string strCommand,
[IN] uint32 uint32MaxMsgs=10,
[IN] uint32 uint32MaxSeconds=3);
uint32 SendEvent (
[IN] string strAction,
[IN] string strAssigned_To,
[IN] string strClusterNode,
[IN] string strDescription,
[IN] string strETA,
[IN] string strGeneratedBy,
[IN] string strIPAddress,
[IN] string strLast_Update,
[IN] string strNotes,
[IN] string strSDMClass,
[IN] string strSeverity,
[IN] string strSource,
[IN] string strStart_Date_Time,
[IN] string strState,
[IN] string strTarget_Type,
[IN] string strUUID,
[IN] string strVirtualAgent,
[IN] string strVirtualAgentCategory,
[IN] string strVirtualAgentDirectory,
[IN] uint32 uint32CommandResponseId);
string GetGlobalProperty(
[IN] string strFieldName="NotSpecified");
uint32 SetGlobalProperty(
[IN] string strFieldName="NotSpecified",
[IN] string strFieldValue="NotSpecified");
uint32 WriteToNTEventLog(
[IN] uint32 uint32Type=1, //SUCCESS=0, ERROR=1, WARNING=2, INFORMATION=4
[IN] string strHost="NotSpecified",
[IN] string strVirtualAgent="NotSpecified",
[IN] string strMessage="NotSpecified");
string WebService(
[IN] string strWebServiceCommand);
};
SSH/Telnet
The SSH/Telnet child control (COM object) supports the following properties and methods below. This control allows you to
programmatically drive a SSH or Telnet session. You can enter "key" commands and then read the responses
(see the getData methods). The AutoStart is a helper method that works in conjunction with the eXc_nonWindows_OperatingSystem
class. AutoStart abstracts away the connection process (including logging in).
HRESULT AutoStart([in] VARIANT stringHostName_in, [in] VARIANT stringApplication_in,
[in] VARIANT stringVirtualAgent_in, VARIANT_BOOL boolConnect_in, VARIANT_BOOL boolLogin_in,
[out,retval] VARIANT* retval);
HRESULT clear([out,retval] VARIANT* retval);
HRESULT connect([out,retval] VARIANT* retval);
HRESULT key([in] VARIANT stringData_in, [out,retval] VARIANT* retval);
HRESULT keyNoEnter([in] VARIANT stringData_in, [out,retval] VARIANT* retval);
HRESULT connectCheck([in] VARIANT stringHostName_in, [in] VARIANT stringHostPort_in,
VARIANT stringTimeoutInMilliseconds_in, [out,retval] VARIANT* retval);
HRESULT getDataBufferLength([out,retval] VARIANT* retval);
HRESULT getData([in] VARIANT longFrom_in, [out,retval] VARIANT* retval);
HRESULT getDataAsSafeArray([in] VARIANT longFrom_in, [out,retval] VARIANT* retval);
HRESULT getOneLineOfData(VARIANT longFrom_in, [in] VARIANT longWaitTimeInMilliseconds_in,
[out,retval] VARIANT* retval);
HRESULT securekey([in] VARIANT stringEncryptedFileName_in, [out,retval] VARIANT*
retval);
HRESULT login([out,retval] VARIANT* retval);
HRESULT logout([out,retval] VARIANT* retval);
HRESULT PopulateProperties([in] VARIANT stringHostName_in, [in] VARIANT stringApplication_in,
[in] VARIANT stringVirtualAgent_in, [out,retval] VARIANT* retval);
HRESULT respondTo([in] VARIANT stringRequestString_in, [in] VARIANT stringReplyString_in,
[in] VARIANT longFrom_in, [in] VARIANT longWaitTimeInMilliseconds_in, [out,retval]
VARIANT* retval);
HRESULT TransferASCIIFile([in] VARIANT stringFromWindowsFile_in, VARIANT stringTononWindowsFile_in,
[out,retval] VARIANT* retval);
HRESULT boolArePropertiesPopulated([out, retval] VARIANT_BOOL* pVal);
HRESULT boolIsConnectedToHost([out, retval] VARIANT_BOOL* pVal);
HRESULT boolIsGUI([out, retval] VARIANT_BOOL* pVal);
HRESULT boolIsGUI([in] VARIANT_BOOL newVal);
HRESULT boolIsLoggedInToHost([out, retval] VARIANT_BOOL* pVal);
HRESULT boolIsPingable([out, retval] VARIANT_BOOL* pVal);
HRESULT boolIsPingable([in] VARIANT_BOOL newVal);
HRESULT boolSecureConnection([out, retval] VARIANT_BOOL* pVal);
HRESULT boolSecureConnection([in] VARIANT_BOOL newVal);
HRESULT boolWaitForKeyCommandToComplete([out, retval] VARIANT_BOOL* pVal);
HRESULT boolWaitForKeyCommandToComplete([in] VARIANT_BOOL newVal);
HRESULT stringCommandPrompt([out, retval] VARIANT* pVal);
HRESULT stringCommandPrompt([in] VARIANT newVal);
HRESULT stringHostName([out, retval] VARIANT* pVal);
HRESULT stringHostName([in] VARIANT newVal);
HRESULT stringApplication([out, retval] VARIANT* pVal);
HRESULT stringApplication([in] VARIANT newVal);
HRESULT stringHostPort([out, retval] VARIANT* pVal);
HRESULT stringHostPort([in] VARIANT newVal);
HRESULT stringLoginPrompt([out, retval] VARIANT* pVal);
HRESULT stringLoginPrompt([in] VARIANT newVal);
HRESULT stringPassword([out, retval] VARIANT* pVal);
HRESULT stringPassword([in] VARIANT newVal);
HRESULT stringPasswordPrompt([out, retval] VARIANT* pVal);
HRESULT stringPasswordPrompt([in] VARIANT newVal);
HRESULT stringTerminalType([out, retval] VARIANT* pVal);
HRESULT stringTerminalType([in] VARIANT newVal);
HRESULT stringUserName([out, retval] VARIANT* pVal);
HRESULT stringUserName([in] VARIANT newVal);
HRESULT Title([out, retval] VARIANT* pVal);
HRESULT Title([in] VARIANT newVal);
HRESULT WriteOutOfBandMessage([in] VARIANT Message_in, [in] VARIANT_BOOL boolGood_in,
[out,retval] VARIANT* retval);
HRESULT stringLoginPromptTimeout([out, retval] VARIANT* pVal);
HRESULT stringLoginPromptTimeout([in] VARIANT newVal);
HRESULT boolValidateLogin([out, retval] VARIANT_BOOL* pVal);
HRESULT boolValidateLogin([in] VARIANT_BOOL newVal);
HRESULT stringSNMPTrapCommunity([out, retval] VARIANT* pVal);
HRESULT stringSNMPTrapCommunity([in] VARIANT newVal);
HRESULT stringSNMPReadCommunity([out, retval] VARIANT* pVal);
HRESULT stringSNMPReadCommunity([in] VARIANT newVal);
HRESULT stringSNMPWriteCommunity([out, retval] VARIANT* pVal);
HRESULT stringSNMPWriteCommunity([in] VARIANT newVal);
HRESULT stringIPAddress([out, retval] VARIANT* pVal);
HRESULT stringIPAddress([in] VARIANT newVal);
HRESULT stringClusterNode([out, retval] VARIANT* pVal);
HRESULT stringClusterNode([in] VARIANT newVal);
HRESULT stringVirtualAgentDirectory([out, retval] VARIANT* pVal);
HRESULT stringVirtualAgentDirectory([in] VARIANT newVal);
HRESULT stringSDMClass([out, retval] VARIANT* pVal);
HRESULT stringSDMClass([in] VARIANT newVal);
SNMP Getter/Setter
The SNMP Getter/Setter child control (COM object) supports the following properties and methods below. This control allows you
to perform the SNMP Get and Set verbs. There is also a GetNext method so you can walk a devices MIB implementation as well.
HRESULT Initialize([in] VARIANT _variant_tAgentAddress_in,
[in] VARIANT _variant_tSNMPVersion_in,
[in] VARIANT _variant_tAgentReadCommunityName_in,
[in] VARIANT _variant_tAgentWriteCommunityName_in,
[in] VARIANT _variant_tMIBDirectory_in,
[in] VARIANT _variant_tMIB_in);
HRESULT Get([in] VARIANT _variant_tSNMPVariable_in,
[out,retval] VARIANT* pVARIANTValuesCollection_in);
HRESULT Get2([in] VARIANT _variant_tSNMPVariable_in, [out,retval] VARIANT* pVARIANTItem_in);
HRESULT Set([in] VARIANT _variant_tSNMPVariable_in,
[in] VARIANT _variant_tSNMPValue_in,
[in] VARIANT _variant_tDataType_in,
[out,retval] VARIANT* pVARIANTSetOperationResults);
HRESULT NameLookUp(VARIANT _variant_tNameOrOID,
[out,retval] VARIANT* pVARIANTResult);
HRESULT GetNext([in] VARIANT _variant_tSNMPVariable_in, [out,retval] VARIANT* pVARIANTValuesCollection_in);
HRESULT GetNext2([in] VARIANT _variant_tSNMPVariable_in, [out,retval] VARIANT* pVARIANTSNMPFieldItem);
HRESULT GetNextFromFile([in] VARIANT _variant_tFileName_in);
SNMP Trap Catcher
The SNMP Trap Catcher child control (COM object) supports the following methods below. This control allows you to receive
SNMP Traps and then be able to iterate over the Traps varbind list. Each oid in the varbind list is an object itself
and has the following properties: SNMPName (this is the human-readable text - if available), SNMPOID, SNMPType, SNMPValue)
HRESULT Initialize([in] VARIANT _variant_tAgentAddress_in,
[in] VARIANT _variant_tAgentReadCommunityName_in,
[in] VARIANT _variant_tMIBDirectory_in,
[in] VARIANT _variant_tMIB_in);
HRESULT GetTrap([out,retval] VARIANT* pVARIANTTrapCollection);
HRESULT GetTrap2([in] VARIANT _variant_tTimeoutInMillSeconds_in,
[out,retval] VARIANT* pVARIANTTrapCollection_in);
SNMP Trap Thrower
The SNMP Trap Thrower child control (COM object) supports the following methods below. This control allows you to throw
a SNMP trap to another trap receiver.
HRESULT Initialize([in] VARIANT _variant_tThrowToAddress_in, VARIANT _variant_tCommunityName_in,
VARIANT _variant_tMIBDirectory_in, VARIANT _variant_tMIB_in);
HRESULT ThrowSNMPTrap([in] IDispatch* pIDispatchTrapValuesCollection_in);
HRESULT AddSNMPFieldToTrap([in] VARIANT _variant_tSNMPFieldName_in, [in] VARIANT
_variant_tSNMPFieldOID_in, [in] VARIANT _variant_tSNMPFieldType_in, [in] VARIANT
_variant_tSNMPFieldValue_in);
HRESULT ThrowSNMPTrap2(void);