Is there an easy way to send an email when a particular severity of event from a particular service hits the Windows server event log? This is on Windows Server 2003, if it makes a difference.
n.b. we do have proper monitoring and alerting in place for production servers at my workplace, but we just a need quick solution for this service in development.
You could do this with OSSEC, a multi-platform open-source software:
And for Log Monitoring/Alerting:
Hereis an article about OSSEC on 360° Security.
Specialized, commercial alternative: EventTracker (Prism Microssystems):
Here's another silly VBScript creation from me, cobbled together from a couple of other scripts.
You can run that as a Windows Service if you use something like the Non-Sucking Service Manager or SRVANY to install it. Using NSSM, the comamnd-line would be:
Be sure to substitute in your email recipient, sender, and SMTP server name.
You define the events you want to be alerted on with the "PushEventToMonitor" call. The arguments are: event ID, event log name, source, category, type, user, and a regular expression that can be matched against the log message. I have an example in there that matches the start / stop of the TELNET service, as well as one that will match the startup of the script itself (which logs an event out to the Application Log).
This is a first draft because the one that I wrote for a Customer that's actually "in production" was written on their dime and "belongs" to them. As such, I've re-coded this one (which is actually substantially different from the one used by the Customer) and it may well have stupid bugs lurking in it. I've run it for a little while tonight on some of my systems and I'm not seeing problems.
Maybe I'll eventually make this a little better. It would be nice if it pulled its configuration out of the registry (so it could be controlled with Group Policy) and if it was packaged as an MSI for easy deployment to groups of servers. Oh, well.
You can do this with a Windows Task
See here http://www.vistax64.com/tutorials/67961-event-viewer-email-notification.html
Servers alive can do this for you. The product is free for up to 10 events to monitor for.
The NT event log monitor is a plug in for free located here. Pretty easy to use and setup.
GFI's Centralized Event Log Management tool (GFI EventsManager) does this, though isnt FOSS.
See https://serverfault.com/a/517457/75770 for a way to send emails based on custom event filters
Tested working on Server 2008, and even when SMTP authentication is required.