I built a Powershell script to monitor PI Data Archive health and would like to share it with you. This is particularly useful in a pre-upgrade scenario. Both to verify if everything is ok before upgrading and for documentation.
The intention is to provide a guide on how to build scripts for Powershell using the tools for the PI System. This is just an example. It is not an official script. OSIsoft does not provide specific support on this script other than the comment section on this page.
You should have the PowerShell Tools for the PI System installed to use it. These PowerShell cmdlets are installed with the PI System Management Tools 2015 (126.96.36.199) or later. Always prefer the most recent version.
This script generates CSV and TXT files with the following info:
- Archives List
- Critical Messages on Log
- Error Messages on Log
- Network Manager Statistics
- Tuning Parameters
- Windows System Info
- PI Services (with status and dependencies)
- OSIsoft Programs Installed on the Server
- Stale PI Points
- Bad PI Points
The script also generates an HTML file containing:
- AFLink Health Status
- Collective Members (if it is a collective)
- License Info
- Archive Info (including Archive Gaps list)
- Backup Info
This script is considerably faster if run directly on the PI Data Archive node. You must run this script as a local administrator on the PI Data Archive. Powershell must be run as Administrator as well.
Remember that your Script Execution Policy must be set to Unrestricted.
The script attached to this post.
Hope it helps!!