Writing to the Windows Application Log During a Beekeeper Execution Job

Written by John Hann on Monday, March 4th 2019 — Categories: Beekeeper Software, Documentation

Using a PowerShell validation during any of the Beekeeper Execution Job phases, you can write information to the Windows Application Log. This helps enable discovery for SCOM. The Event Log Validation Pack is a collection of PowerShell validations that you can customize in your environment.

Learn how to implement this, including downloadable Validation Pack and code snippets, in this blog post. For more information about Beekeeper patching automation software, view the product page.

This snippet of code illustrates how a new event log source is created and writing an event using that source:

Using custom event IDs, event type, and message text, each of the validation task phases can be set. Remember to use the “#!nodename!#” mnemonic in your scripts to get the name of the node during the Beekeeper execution job – discussed in the Beekeeper v5 Manual on page 87.

You can download this Validation Pack here.

To import the Validation Pack, you can use the Import-ValidationTask.ps1 in the Scripts directory of the Beekeeper v5.1.0 zip file.

From a PowerShell prompt (replace bkprdev03 with the name of your Beekeeper server in the URI parameter):

Adding the event log validations to your Application Groups, DAGs, or Windows Failover Cluster is done from the Servers and Clusters tab. Select the appropriate group type and the click the Edit button near the middle of the screen for your server group.  The pencil icon will edit the definition of the specific group.

To select the appropriate validation task from the Available area, you click the green “+” and it will add it to the Configured area.  Select the correct phase and you are done when you click.

Once the events are in the Windows Application Log, you can use SCOM to alert to these events using the custom event source – “Beekeeper”.  You would need to create an event collection rule for these events.  You may want to create an event view as well.