Create event log entry

com.apcc.ISXO.PRO.CreateEvent (WriteActionModuleType)

Creates an event log entry for integration with VMM PRO

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityInternal
RunAsDefault
InputTypeSystem.BaseData

Member Modules:

ID Module Type TypeId RunAs 
CreateEvent WriteAction Microsoft.Windows.PowerShellWriteAction Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
VMHoststring$Config/VMHost$VM Host NameName of the impacted virtual machine host
VMMServerstring$Config/VMMServer$System Center Virtual Machine Manager Name of System Center Virtual Machine Manager server handling the virtual host
Portstring$Config/Port$VMM Server PortVirtual Machine Manager is running on selected VMM Server Port
PROTipIdstring$Config/PROTipId$PRO Tip IDID of the PRO tip to create
EventIdstring$Config/EventId$Internal Event IDSpecified the internal ID used for communication with the recovery script

Source Code:

<WriteActionModuleType ID="com.apcc.ISXO.PRO.CreateEvent" Accessibility="Internal" Batching="false">
<Configuration>
<xsd:element name="VMHost" type="xsd:string"/>
<xsd:element name="VMMServer" type="xsd:string"/>
<xsd:element name="Port" type="xsd:string"/>
<xsd:element name="PROTipId" type="xsd:string"/>
<xsd:element name="EventId" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="VMHost" Selector="$Config/VMHost$" ParameterType="string"/>
<OverrideableParameter ID="VMMServer" Selector="$Config/VMMServer$" ParameterType="string"/>
<OverrideableParameter ID="Port" Selector="$Config/Port$" ParameterType="string"/>
<OverrideableParameter ID="PROTipId" Selector="$Config/PROTipId$" ParameterType="string"/>
<OverrideableParameter ID="EventId" Selector="$Config/EventId$" ParameterType="string"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<WriteAction ID="CreateEvent" TypeID="Windows!Microsoft.Windows.PowerShellWriteAction">
<ScriptName>com.apcc.ISXO.PRO.CreateEvent.ps1</ScriptName>
<ScriptBody><Script>#############################################################################
# Filename: com.apcc.ISXO.PRO.CreateEvent.ps1
#############################################################################
Param($hostName, $vmmServerName, $vmmServerPort, $protipId, $eventId );

$isDebug = $false;

function LogInfo($logMessage, $doLog = $isDebug) {
if ($doLog) {
[Diagnostics.EventLog]::WriteEntry("ITImpact Recovery", "Info: " + $logMessage);
}
}

function LogError($logMessage) {
[Diagnostics.EventLog]::WriteEntry("ITImpact Recovery", "Error: " + $logMessage);
}

Import-Module VirtualMachineManagerCore;
$Error.Clear();

$vmHost = Get-SCVMHost -ComputerName $hostName -VMMServer $vmmServerName;
if ($Error.Count -ne 0) {
LogError("Unable to retrieve information about virtual host: " + $Error[0]);
return;
}

$description = $hostName + ":" + $vmmServerName + ":" + $vmmServerPort + ":" + $protipId + ":" + $eventId;
eventcreate /T Information /ID $eventId /L APPLICATION /SO VMMPro /D $description
if ($Error.Count -ne 0) {
LogError("Unable to log recovery event: " + $Error[0]);
return;
}
</Script></ScriptBody>
<SnapIns/>
<Parameters>
<Parameter>
<Name>host</Name>
<Value>$Config/VMHost$</Value>
</Parameter>
<Parameter>
<Name>vmmServerName</Name>
<Value>$Config/VMMServer$</Value>
</Parameter>
<Parameter>
<Name>vmmServerPort</Name>
<Value>$Config/Port$</Value>
</Parameter>
<Parameter>
<Name>proTipId</Name>
<Value>$Config/PROTipId$</Value>
</Parameter>
<Parameter>
<Name>eventId</Name>
<Value>$Config/EventId$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>300</TimeoutSeconds>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="CreateEvent"/>
</Composition>
</Composite>
</ModuleImplementation>
<InputType>System!System.BaseData</InputType>
</WriteActionModuleType>