In this video, you can see how to run PoshlandMonitoring in the basic configuration.
What contains the script folder?
It's the main Powershell script which you have to run in TaskScheduler.
This file contains all global functions which are loading to the main script.
In this file, you can define all the script global setting.
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.
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.
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.
This parameter defines the directory name where the script will save a logfile from PoshlandMonitoring.ps1 script.
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
Log file name is generated from 3 parts - <PrefixLogFileName>-<yyyyMMdd_hhmmss><SufixLogFileName>. This param defines extension for logfile name.
In this parameter, you can define recipients of email reports.
In this parameter, you can define sender of email reports.
In this parameter, you can define SMTP address of email server.
In this parameter, you can define the table cell background color for results with pass the test.
In this parameter, you can define the table cell background color for results with warning status.
In this parameter, you can define the table cell background color for results with fail the test.
The TimeOut parameter defines how long script will be waiting for feedback from servers.
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.
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.
In this file, you can define parameters for a specific MonitorPack. These settings are loaded to script during running MonitorPack.
Set true if you want to check heath servers of Active Directory group members. If false -add servers list to file "Servers.List"
If ADGroupMode set true, here you have to define Active Directory Group Name
HTML report title
Email message subject
Set true if you want to receive email for this MonitorPack (remember set proper smtp settings in GLOBAL_PARAM.ini file)
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.