Hey,
is it possible to create a mssql sensor that not only counts the result set or give me the first result value in a defined channel but give me a complete resukt set? And it would be perfect if i cpuld export and send this result set to a defined list of persons if the alert comes up.
Example:
SQL Query Result:
Line 1: 1234
Line 2: 2345
I`m searching for a way, to show me these 2 lines in the sensor (up to 2000 lines) an autmatically export this result.
Article Comments
Hello Lars,
Thank you for your message.
The Microsoft SQL v2 sensor doesn't have meta-scan capability and therefore I'm afraid that it is not possible to automate the creation of this sensor for each line returned by the SQL query.
At the moment, the API doesn't allow the creation of objects in PRTG nevertheless I invite you to have a look at the PowerShell module PRTGAPI. It provides the possibility to duplicate and modify sensor settings by executing raw HTTP requests (doesn't use the API). It might allow you to develop a script which can automate the modification of the sensors. Please, note that we do not provide official support for this module as it is developed by a third party and those raw requests might induce unexpected behavior with PRTG.
There is also quite a few lines that you would need to distribute within multiple SQL v2 sensors (10 lines per sensor), which would result to approximatively 200 Microsoft SQL v2 sensors (maximum supported). This number is quite important (including the channels) and therefore might induce performances issues as well as also trigger the limit of parallel .exe execution (set to 100). Therefore, I would recommend to distribute the sensors on two probes to avoid issues.
Finally, regarding the alerting you simply have to configure limits to the channels monitoring each line and then define a notification trigger, in each sensor or in the parent device notification triggers tab (to use the inheritance).
If you have questions, do not hesitate.
Regards.
Jul, 2022 - Permalink
Hello Lars,
Thank you for your message.
The Microsoft SQL v2 sensor doesn't have meta-scan capability and therefore I'm afraid that it is not possible to automate the creation of this sensor for each line returned by the SQL query.
At the moment, the API doesn't allow the creation of objects in PRTG nevertheless I invite you to have a look at the PowerShell module PRTGAPI. It provides the possibility to duplicate and modify sensor settings by executing raw HTTP requests (doesn't use the API). It might allow you to develop a script which can automate the modification of the sensors. Please, note that we do not provide official support for this module as it is developed by a third party and those raw requests might induce unexpected behavior with PRTG.
There is also quite a few lines that you would need to distribute within multiple SQL v2 sensors (10 lines per sensor), which would result to approximatively 200 Microsoft SQL v2 sensors (maximum supported). This number is quite important (including the channels) and therefore might induce performances issues as well as also trigger the limit of parallel .exe execution (set to 100). Therefore, I would recommend to distribute the sensors on two probes to avoid issues.
Finally, regarding the alerting you simply have to configure limits to the channels monitoring each line and then define a notification trigger, in each sensor or in the parent device notification triggers tab (to use the inheritance).
If you have questions, do not hesitate.
Regards.
Jul, 2022 - Permalink