This project is read-only.

Installation guide

Create folder C:\Scripts
Extract all downloaded files to created folder.
Make changes in ServerList.csv file
Run powershell C:\Scripts\Get-Status.ps1 -mailReport $true -emailTo -emailfrom -emailSmtpServer

Configuration guide

Put the list of servers and services to monitor in ServerList.csv file.
Please find example below

Change localhost to real server names.
Change to real website URL.
If you want to check more servers, please add new lines.

Scripts check the following services (keywords):
  • Server
    • Server name to monitor. You may use short name, FQDN or even IP address
  • SQL
    • Connection string to monitor. Put here the MS SQL server name. In case you use named instance, put here ODBC-like server name. E.g., servername, port_number.
  • Website
    • Put here URL
  • StarWind
    • Put here server name where StarWind service running. Script check all HA drives. Before use it you should install StarWindX dll and PowerShell module on the server where you run monitoring script.
  • Cluster
    • Put here node server name. You should repeat it for all nodes in cluster.
  • AOS
    • Put here server name. Script check all AOS services installed on that server.
  • EventLog
    • Put here server name. Script check all Critical and Errors from System and Application event log. Please note, this might be very annoying.
  • EventLogMSSQL.
    • Put here server name where you have MSSQL installed . Script check all Critical, Errors and Warning from MSSQL provider event log. It's almost the same as EventLog, but dedicated only to MSSQL.

It’s text file in CSV format with ; delimiter. First line contains column names.
Please do not rename Server and Service columns. Please do not add columns with names: Status and Description.

Running guide

Script has default parameters, so you may run the script without any parameters.

Parameter Description Default value
CSVFile Configuration file in CSV format C:\Scripts\ServerList.csv
CSVFileHistory History file. If not exist, script create new one C:\Scripts\ServerOutageHistory.csv
logFile Log file C:\Scripts\Get-Status-LogFile.txt
mailReport If true, send email anyway. Send email as report. If false send email only if any error or error has gone $false
emailTo Email address To
emailfrom Email address From
emailSmtpServer SMTP server
generateJson Write info to JSON file $true
generateJsonFile JSON file C:\Scripts\Get-Status_Report.json
generateHTML Write info to HTML file $true
generateHTMLFile HTML file C:\inetpub\wwwroot\HealthReport.html
generateTweet Send twitter $true
tweetDMUsers If $tweetDMUsers not empty, then Send Direct Message (DM) to the listed tweeter users ("YourTweeter")
dashboardURL URL to include to every report

Setup scheduled task

Please find the example of PowerShell script to setup new scheduled task below. This task execute PowerShell Monitoring Script each 5 minutes.
$action = New-ScheduledTaskAction -Execute 'Powershell.exe' -Argument 'C:\Scripts\Get-Status.ps1'  `
    -WorkingDirectory 'C:\Scripts'
$trigger = New-ScheduledTaskTrigger -Once -At (Get-Date)  `
    -RepetitionInterval (New-TimeSpan -Minutes 5) -RepetitionDuration ([System.TimeSpan]::MaxValue)
Register-ScheduledTask -Action $action -Trigger $trigger `
    -TaskName "MonitoringScript" -Description "Each 5 minutes it executes PowerShell Monitoring Script" `
    -TaskPath '\' -User "$env:USERDOMAIN\$env:USERNAME" -Password 'P@ssw0rd!' -RunLevel Highest

Last edited Feb 12, 2016 at 1:30 PM by vmoskalenko, version 6