cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Alerts into Windows Event Log

chris_v
Dynatrace Pro
Dynatrace Pro

Using the new script recipient feature in DCRUM 12.3, you can write scripts to process alerts, in this case a customer asked how to get alerts published into the Windows event log.

Using a Microsoft command line tool eventcreate, you can get the CAS to write entries to the event log.

Eventcreate takes numerous parameters, I've included only a few.

ParameterDescription
/L ApplicationTells eventcreate to write to the Application log.
/T WARNINGSets the event to the warning level (severity).
/ID 1000

Sets the event ID, this is an arbitrary number, I just chose 1000, for a deployment setting meaningful numbers will allow some other tool to parse the logs in a sensible fashion.

/SO CASSet the source, I chose CAS, any text string will do, enclose in double quotes if there'll be spaces in the name
/D "{notificationMessage}"Sets the description text, using the Alert definition replaceable value to populate the description field with the message you configure in the alert definition. Note it is enclosed in double quotes because there will most likely be spaces in the message.

Once created, you can enable the script recipient for your alerts so it will be execute.

 

The end result is entries being populated into the event log.

 

Eventcreate has other parameters, check the command line help, you can send the event to another server (default is the local server, so the CAS itself).

 

 

 

2 REPLIES 2

adam_piotrowicz
Dynatrace Pro
Dynatrace Pro

Chris,

Hope you don't mind if we put it in DC RUM documentation?

Not at all Adam.