Quick and Dirty Large Scale Eventing for Windows

Quick and Dirty Large Scale Eventing for Windows

  • Comments 6
  • Likes

One of the least known yet most powerful management features to ship with Windows Vista and Windows Server 2008 is built-in Event Forwarding which enables large scale health and state monitoring of a Windows environment (assuming health and state can be determined from Windows Events - which they usually can). Not only is this feature built into the latest versions of Windows, but it's also available for down-level OSs like Windows XP SP2+ and Windows Server 2003 SP1+ (here).

Note: True enterprise class Windows eventing is included with enterprise monitoring solutions like System Center Operations Manager.

This new Windows Event Forwarding (also known as Windows Eventing 6.0) is exceptional for the following reasons:

  1. Standards Based: No really! It leverages the DMTF WS-Eventing standard which allows it to interoperate with other WS-Man implementations (see OpenWSMAN at SourceForge).
  2. Agentless: Event Forwarding and Event Collection are included in the OS by default
  3. Down-Level Support: Event Forwarding is available for Windows XP SP2+ and Windows Server 2003 SP1+
  4. Multi-Tier: Forwarding architecture is very scalable where a "Source Computer" may forward to a large number of collectors and collectors may forward to collectors
  5. Scalable: Event Collection is very scalable (available in Windows Vista as well) where the collector can maintain subscriptions with a large number of "Source Computers" as well as process a large number of events per second
  6. Group Policy Aware: The entire model is configurable by Group Policy
  7. Schematized Events: Windows Events are now schematized and rendered in XML which enables many scripting and export scenarios
  8. Pre-Rendering: Forwarded Windows Events can now be pre-rendered on the Source Computer negating the need for local applications to render Windows Events
  9. Resiliency: Designed to enable mobile scenarios where laptops may be disconnected from the collector for extended periods of time without event loss (except when logs wrap) as well as leveraging TCP for guaranteed delivery
  10. Security: Certificate based encryption via Kerberos or HTTPS

This implementation will walk through the following example design where via Group Policy a domain computer group will be configured to forwared Windows Events to a single collector:

Implementation steps are as follows:

  • Step 1: Create Event Forwarding Subscription
  • Step 2: Configure WinRM Group Policy
  • Step 3: Configure Event Forward Group Policy
  • Step 4: Test

Step 1: Create the Event Forwarding Subscription on the Event Collector

In the Windows Event Forwarding architecture, the subscription definition is held and maintained on the Collector in order to reduce the number of touch-points in case a subscription needs to be created or modified. Creating the subscription is accomplished through the new Event Viewer user interface by selecting the 'Create Subscription' action when the 'Subscriptions' branch is highlighted. The Subscription may also be created via the "WECUTIL" command-line utility.

Note: Both Windows Vista and Windows Server 2008 can be event collectors (this feature is not supported for down-level). Although there are no built-in limitations when Vista is a collector, Server 2008 will scale much better in high volume scenarios.

Although the above subscription is configured to leverage Group Policy, the subscription can be configured in a stand-alone mode (see the "Collector Initiated" option). In addition, this subscription is designed to gather all events from the "Application" and "System" logs that have a level of "Critical", "Error", or "Warning". This event scope can be expanded to gather all events from these logs or even add additional logs (like the "Security" log).

Lastly, the subscription is configured to forward events as quickly as possible with the advanced settings delivery option of "Minimize Latency". The default setting of "Normal" would only forward events every 15 minutes (which may be more desirable depending the the Collector and Source Computer resources).

If Group Policy is not being used, configure the "Subscription type" to be "Collector Initiated". In this case Source Computers will need to be manually added to the Subscription either through the Subscription configuration or the "WECUTIL" command-line utility (which can also be scripted using PowerShell, but that's another topic). 

Note: In cases where there Source Computer is generating a large volume of forwarded events (e.g. Security events from a Domain Controller), use WECUTIL on the collector to disable event rendering for the subscription. The task of pre-rendering an event on the source computer can be CPU intensive for a large number of events.

Step 2: Configure Group Policy to enable Windows Remote Management on the Source Computers (clients)

Group Policy can be used to enable and configure Windows Remote Management (WinRM or WS-Man) on the Source Computers. WinRM is required by Windows Event Forwarding as WS-Man is the protocol used by WS-Eventing. The following shows the Group Policy branch locations for configuring both WinRM and Event Forwarding:

The following GP setting will enable WinRM on the client as well as configure a Listener that will accept packets from ANY source.

Note: This Listener configuration should only be used in a trusted network environment. If the environment is not trusted (like the Internet), then configure only specific IP Addresses or ranges in the IPv4 and IPv6 filters.

To configure WinRM outside of Group Policy, run the following command on the Source Computer (also see the above Note):

winrm quickconfig

Step 3: Configure Group Policy to enable Windows Event Forwarding on the Source Computers

As with WinRM, Group Policy can be used to configure Source Computers (Clients) to forward events to a collector (or set of collectors). The policy is very simple. It merely tells the Source Computer to contact a specific FQDN (Fully Qualified Domain Name) or IP Address and request subscription specifics. All of the other subscription details are held on the Collector.

If Group Policy is not being used, then there is nothing to do here as the "Collector Initiated" Subscription will proactively reach out to the Source Computer.

Step 4: Test Event Forwarding

If all of the Event Forwarding components are functioning (and there's minimal network latency), a test event created on the Source Computer should arrive in the Collector's "Forwarded Events" log within 60 seconds. Create a test event with the following command:

eventcreate /id 999 /t error /l application /d "Test event."

This event should appear on the Collector as follows:

If the event doesn't appear, perform the following troubleshooting steps:

Troubleshooting Step 1: Has Policy Been Applied to the Source Computer?

This can be forced by running the following command on the Source Computer:

gpupdate /force

Troubleshooting Step 2: Can the Collector Reach The Source Computer via WinRM?

Run the following command on the Collector

winrm id /r:<Source Computer> /a:none

Troubleshooting Step 3: Is the Collector Using the Right Credentials?

Run the following command on the Collector

winrm id /r:<Source Computer> /u:<username> /p:<password>

Note: These are the credentials defined in the Subscription on the Collector. The credentials don't need to be in the local Administrators group on the Source Computer, they just need to be in the "Event Log Readers" group on the Source Computer (local Administrators will also work).

Troubleshooting Step 4: Has the Source Computer Registered with the Collector?

Run the following command on the Collector

wecutil gr <subscription name>

This will list all the registered Source Computers (note if the Subscription is "Collector Initiated" then this will list all configured Source Computers), their state (from the Collector's perspective), and their last heartbeat time.

Enjoy!

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • <p>PingBack from <a rel="nofollow" target="_new" href="http://computers.buckethunt.com/1969/12/31/quick-and-dirty-large-scale-eventing-for-windows/">http://computers.buckethunt.com/1969/12/31/quick-and-dirty-large-scale-eventing-for-windows/</a></p>

  • <p>This is a great new feature. &nbsp;Such a nice thing to have as more virtualized systems in small organizations become a reality. &nbsp; This is also something that is very powerful when combined with powershell and task scheduler's new event and task integration with powershell... &nbsp;Far easier to configure and monitor than any linux with python and chron job implementation I've used.</p> <p>Looking forward to the new remote powershell stuff.</p>

  • <p>Confused by the title? No problem. Most of my titles are confusing, even to me, and I write them. I&amp;#39;ve</p>

  • <p>Hi,</p> <p>Thanks for this excellent post, I hope I can ask your help with a problem I&#39;m struglling with in the last few days.</p> <p>I have 3 Win2K3 servers that I want them to forward some of their events to a Win7 machine. All the Win2K3 servers are NOT members of the domain (the Win7 machine is) and they also communicate through two firewalls. </p> <p>I have opened ports 80, 443, icmp and 5985 and configured almost everything (I guess) and I get an event in the Win2K3 servers&#39; Microsoft-Windows-Forwarding/Operational event log saying &#39;Access Denied&#39;, here is the full error message:</p> <p>The forwarder is having a problem communicating with subscription manager at address <a rel="nofollow" target="_new" href="HTTP://MY_WIN7.mvs.co.il:5985/wsman/SubscriptionManager/WEC">my_win7.mvs.co.il/.../WEC</a>. &nbsp;Error code is 5 and Error Message is &lt;f:WSManFault xmlns:f=&quot;<a rel="nofollow" target="_new" href="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault&quot;">schemas.microsoft.com/.../wsmanfault&quot;</a> Code=&quot;5&quot; Machine=&quot;mvs&quot; xml:lang=&quot;he-IL&quot;&gt;&lt;f:Message&gt;Access is denied. &lt;/f:Message&gt;&lt;/f:WSManFault&gt;.</p> <p>Any thoughts?</p>

  • <p>So I have event&#39;s landing in the &#39;Forwarded Events&#39; log. Now what? These don&#39;t seem to want to dump out of this long as easily as the other event logs, using the PowerShell command:</p> <p>Get-EventLog -Newest 3 -LogName &nbsp;ForwardedEvents</p> <p>There&#39;s something different about the Forwarded Events log, and for now, the messages I have in it seem to be locked away. How do I get them out?</p>

  • <p>Great post. &nbsp;Question for you, have you seen any stability issues with event log forwarding? &nbsp;I have a situation where it works for a bit, then just stops complaining about user authentication. &nbsp;But why, if it starts to work why would it fail after a few minutes? &nbsp;Any quick thoughts or items to look at? &nbsp;I&#39;m using GP to set it up.</p> <p>Thanks in advance</p>