What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

MSSQL Instance Check

Votes:

0

I want to set up a customer sensor that runs the below powershell:

Get-Service | select -property name,status | Where-Object {$_.Name -EQ "MSSQLSERVER"}

This is check that the MSSQLServer service is running on a device.

This needs t be ran on multiple devices.

I am aware i need to create a customer sensor on the server and then create a sensor linked to the exe/script.

But how do I set this up on the server? Just a powershell file? How do I setup the parameters so that this can be setup on multiple devices?

get-service mssqlserver prtg

Created on Sep 14, 2020 5:05:57 PM



1 Reply

Votes:

0

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.

Created on Sep 15, 2020 9:42:16 AM by  Florian Lesage [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.