Poshland Monitoring Documentation

Basic Information

What contains the script folder?

PowershellMonitoring.ps1 script

It's the main Powershell script which you have to run in TaskScheduler.

GLOBAL_FUNCTIONS.ps1

This file contains all global functions which are loading to the main script.

GLOBAL_PARAM.ini

In this file, you can define all the script global setting.

MonitorPack directories

MonitorPack is something like a set of custom functions to check the health of a specific group of Servers. All MonitorPack folder has to start the name with "MP-". The main script will load these functions and invoke them in Powershell remote session to the list of the servers from Server.List file or Active Directory group members. To prepare new MonitorPack you have to copy MP-MonitorPackTemplate and rename it.

ExcludeMonitorPack.txt

In this file, you can add a list of MonitorPacks which you don't want to use in the main script. By default this file contains MP-MonitorPackTemplate.

Global Parameters

GLOBAL_PARAM.ini

In this file, you can define global parameters for Poshland Monitoring script. These settings are loaded to script during running and are available in all Monitor Packs.

LogDirectoryName

Example:
LogDirectoryName=Logs

This parameter defines the directory name where the script will save a logfile from PoshlandMonitoring.ps1 script.

PrefixLogFileName

Example
PrefixLogFileName=ScriptLog

Log file name is generated from 3 parts - <PrefixLogFileName>-<yyyyMMdd_hhmmss>
This parameter define the first part - _ _PrefixLogFileName_ _. For example log file will be named ScriptLog-20190920_1204.log

SufixLogFileName

Example
SufixLogFileName=.log

Log file name is generated from 3 parts - <PrefixLogFileName>-<yyyyMMdd_hhmmss><SufixLogFileName>. This param defines extension for logfile name.

SendTo

Example:
SendTo=email@domain.com

In this parameter, you can define recipients of email reports.

From

Example:
From=email@domain.com

In this parameter, you can define sender of email reports.

SmtpServer

Example:
SmtpServer=smtp.domain.com

In this parameter, you can define SMTP address of email server.

Pass

Example:
pass=Green

In this parameter, you can define the table cell background color for results with pass the test.

Warn

Example:
warn=Yellow

In this parameter, you can define the table cell background color for results with warning status.

Fail

Example:
fail=Red

In this parameter, you can define the table cell background color for results with fail the test.

TimeOut

Example:
TimeOut=60

The TimeOut parameter defines how long script will be waiting for feedback from servers.

Simultaneously

Example:
simultaneously=40

In this parameter, you can define the maximum number of parallel Powershell session will be run. When the number of sessions reaches this number, the script will be waiting for feedback from current part of servers. When all servers send feedback or timeout expires, the script will run parallel Powershell sessions for next part of servers.

AlertsOnly

Example:
AlertsOnly=false

In this parameter, you can set if you want to receive email reports always when the script is running or only when the script detects warning or fails.

MonitorPack Parameters

Param.ini

In this file, you can define parameters for a specific MonitorPack. These settings are loaded to script during running MonitorPack.

ADGroupMode[true/false]

Example:
ADGroupMode=false

Set true if you want to check heath servers of Active Directory group members. If false -add servers list to file "Servers.List"

Server_AD_Group_Name

 

Example:
Server_AD_Group_Name=ADGroupName

If ADGroupMode set true, here you have to define Active Directory Group Name

ReportTitle

Example:
ReportTitle=ReportName

HTML report title

Reportemailsubject

 

Example:
reportemailsubject=MessageSubject

Email message subject

SendEmail[true/false]

 

Example:
SendEmail=false

Set true if you want to receive email for this MonitorPack (remember set proper smtp settings in GLOBAL_PARAM.ini file)

How to prepare new MonitorPack

Copy MP-MonitorPackTemplate folder

Copy and paste MP-MonitorPackTemplate to the same directory

Rename new MonitorPack directory

Next, rename new MonitorPack folder. For example, if you want to build Monitor for file servers you can name the folder "MP-FileServers".

 

Important: MonitorPack folder name has to start "MP-"

Add your Powershell functions.

You have to add your Powershell functions to functions.ps1 file in the new Monitor Pack folder. Your functions should return "pass", "warn" or "fail".

Add functions to RunCheck.ps1 file

When you added you Powershell functions to functions.ps1 file, its time to add them to RunCheck.ps1 file.

RunCheck.ps1 file is invoked by the main PowershellMonitoring.ps1 script.

Edit param.ini file

Now it's time to edit parameters in param.ini file. Here you can choose if your servers list are defined in ActiveDirectory group or you specify them in Servers.List file.
Also here you can set the name of the report and this if the report has to send via email (SMTP settings are defined in GLOBAL_PARAM.ini). More details you can find in "MonitorPack Parameters" section on this site.

Add servers to Server.List file

If you set ADGroupMode to false in param.ini file, then you have to add servers names to Server.List file.