Hello,
To monitor the status of your Microsoft SQL server, you could use the SNMP Windows Service sensor. You will find the manual of the sensor here: https://www.paessler.com/manuals/prtg/snmp_windows_service_sensor
SNMP would be a better solution to monitor all your SQL server easily with a small performance impact on the PRTG server.
However, if you would like to use PowerShell scripts, you have to execute remote commands as the scripts are executed on the probe system.
Therefore, I invite you to take a look at this article from Microsoft which provides some examples on how to execute remote commands: https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/running-remote-commands?view=powershell-7
Then, you have to copy the script in the folder corresponding to the sensor you use, under C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors.
- EXE : EXE/Script sensor
- EXEXML : EXE/Script Advanced sensor
To use the Windows credentials configured (or inherited) in each device settings, you can configure the sensor to them to your script via the "Parameters" field, by using the PRTG placeholders %windowsuser and %windowspassword.
Finally, to add this sensor to multiple devices, you can clone the sensor manually or use the API of PRTG to automate the cloning. For the last option, you could use the PowerShell module called PRTGAPI whose manual is right here:
https://github.com/lordmilko/PrtgAPI
Please, let us know if you need further assistance.
Kind regards.
Add comment