TinyMonitorService

This is my first binary release of anything.

TinyMonitorService is exactly what is sounds like. It is a service that checks only a few characteristics associated with any computer. It checks the processor utilization, the memory utilization, and the diskspace utilization for the computer on which it is installed. Also, it reports on a subset of event logs on that computer.

The event logs that are searched are:

System
Application
DNS Server
Directory Service
File Replication Service

Errors in the event logs are sent via email to a specified address. The file log-excludeditems.txt allows you to identify specific log entries that should not be sent via email. Obviously, there are a few which are so common, which are completely ignored, that one can wonder why Microsoft made the particular items errors!

TinyMonitorService began as a PowerShell script. However, the overhead associated with PowerShell is fairly high and running it as a service, while possible, is not very practical.

I had a number of clients who needed basic monitoring, but did not own a monitoring solution, and for whatever reason, could not utilize one of the other free solutions available. Initially, it was installed exclusively on Exchange Servers, but after a few enhancements, it became a good-enough solution for most servers.

Why don't I release the source? Quite frankly, I'm not happy with it. I'm somewhat embarrassed by it. The service is written in C#, almost a line-for-line translation of the PowerShell script, plus the things that are necessary to create a Windows service (which came from MSDN). It's pretty damn ugly.

Expand the contents of TinyMonitorService.zip into C:\TinyMonitorService. Then execute the configuration PowerShell script in that folder:

powershell.exe -file TinyMonitorConfig-v2.ps1

After you have done this, create the service as described in ReadMe.txt in that folder.

If you have questions, please email me.

Please follow me at @essentialexch on Twitter.

Published Thursday, April 30, 2015 9:04 PM by michael

Comments

Monday, June 29, 2015 11:37 AM by michael

# re: TinyMonitorService

If you are using PowerShell v2 (Windows Server 2008, for example), then you cannot use the "-file" argument to PowerShell.exe. Instead do this:

powershell.exe -command { .\TinyMonitorConfig.ps1 }

Thanks to Kevin Weilbacher for bringing this to my attention.

Monday, June 29, 2015 2:39 PM by michael

# re: TinyMonitorService

And, in fact, if you are executing the PowerShell command from cmd.exe, you have to use even a different syntax:

powershell.exe -command { "& .\TinyMonitorConfig.ps1" }

And don't forget - your ExecutionPolicy must be set to Unrestricted or RemoteSigned for the PowerShell script to execute.