記錄檔事件寫入動作

Microsoft.SystemCenter.AgentManagement.LogEvent (WriteActionModuleType)

記錄檔事件寫入動作模組類型。

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityInternal
RunAsSystem.PrivilegedMonitoringAccount
InputTypeSystem.TriggerData

Member Modules:

ID Module Type TypeId RunAs 
LogEvent WriteAction System.CommandExecuter Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
TimeoutSecondsint$Config/TimeoutSeconds$逾時秒數

Source Code:

<WriteActionModuleType ID="Microsoft.SystemCenter.AgentManagement.LogEvent" Accessibility="Internal" RunAs="System!System.PrivilegedMonitoringAccount" Batching="false">
<Configuration>
<xsd:element name="TimeoutSeconds" type="xsd:integer"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<WriteAction ID="LogEvent" TypeID="System!System.CommandExecuter">
<ApplicationName>%windir%\system32\cscript.exe</ApplicationName>
<WorkingDirectory/>
<CommandLine>//NoLogo $File/LogEndToEndEvent.js$</CommandLine>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files>
<File>
<Name>LogEndToEndEvent.js</Name>
<Contents><Script>

var oAPI = new ActiveXObject("MOM.ScriptAPI");

var SCRIPT_NAME = "LogEndToEndEvent.js";
var ENU_MESSAGE = "This event is logged to the Windows Event Log periodically to test a event collection.";

var EVENTLOG_SUCCESS = 0x0000; /* Information event */
var EVENTLOG_AUDIT_FAILURE = 0x0010; /* Failure Audit event */
var EVENTLOG_AUDIT_SUCCESS = 0x0008; /* Success Audit event */
var EVENTLOG_ERROR_TYPE = 0x0001; /* Error event */
var EVENTLOG_INFORMATION_TYPE = 0x0004; /* Information event */
var EVENTLOG_WARNING_TYPE = 0x0002; /* Warning event */

oAPI.LogScriptEvent(SCRIPT_NAME, 6022, EVENTLOG_INFORMATION_TYPE, ENU_MESSAGE);

</Script></Contents>
<Unicode>true</Unicode>
</File>
</Files>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="LogEvent"/>
</Composition>
</Composite>
</ModuleImplementation>
<InputType>System!System.TriggerData</InputType>
</WriteActionModuleType>