Cloud VPS: Configuring Resource Monitors and Alerts in Windows 2008 R2

The below linked zip file and instructions will enable you to configure Memory, Disk, and CPU resource monitors on your Windows 2008 R2 server. Please note that these tools are only intended to provide another means to monitor your server, and that they should not be considered a replacement for server administration best practices. This package will install the following items:

  • Performance Monitor Template titled “Performance Monitors”. The purpose of this item is to monitor the server resources (RAM, Disk, and CPU).
  • Scheduled Task titled “Send Performance Monitors Email”. The purpose of this item is to send alert emails using C:\SendMail.exe when called by the “Performance Monitors” template.
  • Scheduled Task titled “Start Performance Monitors”. The purpose of this item is to start or restart the “Performance Monitors” template after an error or a system reboot. This task requires an administrative username and password (gathered during installation).

To install the package, please follow the steps below:

  1. Download this file: PerfMonAndAlerts.zip
  2. Extract the contents of the file to the root of your system volume (typically C:\). This will place the required files into C:\SendMail. The folder C:\SendMail should have the following structure after extracting the files:

  • C:\SENDMAIL
    • config_alerts.ps1
    • SendMail.exe
    • C:\SENDMAIL\PerfLogs
      • Counters.xml
      • SendMail.original
      • StartPerfMonsTask.xml

  1. Open a Powershell command prompt:
    1. Click Start
    2. Enter “Powershell” into the search box
    3. Select “Windows Powershell”
    4. In the Powershell command prompt, enter the “Set-ExecutionPolicy” command below. This will allow you to execute the Powershell script included in this article. The “Process” parameter ensures that the execution policy affects only the current Windows PowerShell process. For more information, please visit http://technet.microsoft.com/en-us/library/dd347628.aspx.

Set-ExecutionPolicy Unrestricted Process

  1. Change the working directory to the location of the extracted files:

CD C:\SendMail

  1. Execute the script that configures the performance monitors and tasks:

.\config_alerts.ps1

  1. You will be prompted for the following information (examples are provided in parenthesis):
    1. Enter the SMTP Server Name or IP (mail.mydomain.com)
    2. Enter the Recipient Email Address (me@thesba.com)
    3. Enter the From Email Address (alerts@thesba.com)
    4. Enter the Message Subject (Alert From VPS1234)
    5. Enter a Username with Administrative Rights (MyAdmin)
    6. Enter the Password For This User (MyPassword123)
    7. After the script completes the Task Scheduled and the Performance Monitor and Alerts applications will open for you to review and customize the items. By default, the performance monitors are configure with the following thresholds:
      1. Alert when Total Processor - % Idle Time < 10%
      2. Alert when Logical Disk C:\ - Free Megabytes < 2048
      3. Alert when Total Memory - Available Megabytes < 25
      4. Once you have finished customizing the alerts to meet your needs, you should enable and run the Scheduled Task that monitors and restarts the Performance Monitors
        1. In the Task Scheduler window, right click the “Start Performance Monitors” task and choose “Enable”.
        2. In the Task Scheduler window, right click the “Start Performance Monitors” task and choose “Run”.

Add Feedback