PowerShell Script to Collect the SANsymphony Metrics
The PowerShell script (DcsPrometheusExporter.ps1) retrieves metrics from the DataCore SANsymphony REST API. It uses the DcsPrometheusExporter.psd1 configuration file to determine which metrics to collect, how often to collect them, and where to save the output file. Once the PowerShell script is executed, it collects metrics for DataCore servers, disk pools, physical disks, virtual disks, and more. The script formats the collected data into Prometheus exposition format and writes it to a .prom file named DcsPrometheusMetrics.prom for monitoring purposes.
You can download or clone the PowerShell script from the DataCore Software GitHub Repository. The repository folder includes the following files:
- DcsPrometheusExporter.ps1: This is the main PowerShell script that connects to the SANsymphony REST API, collects metrics, converts them into Prometheus format, and writes them to a .prom file. You can run this script manually or schedule it to perform metric collection automatically.
- DcsPrometheusExporter.psd1: This is the configuration file used by the PowerShell script. You can edit this file to enable or disable individual metrics and to define the output directory where the .prom file should be written. The PowerShell script reads these settings from the configuration file each time it runs.
You typically don’t need to modify this script unless you intend to change its core behavior.
Learn More