Hello,
I'm trying to cleanup my PRTG cores, and trying to find a way to extract a list of all custom sensors with the script name and parameters (I have some scripts with hard coded passwords in sensor settings and I'll appreciate if there is an API call to get them easily).
I have tried this /api/table.json?content=sensors&columns=name,type,scriptparams_
but it doesn't work
Thank You
Article Comments
Hello,
Thank you for your message.
Regarding your question, I would recommend you to use the PowerShell module called PRTGAPI.
You can find the module right here: https://github.com/lordmilko/PrtgAPI
Here is a command you can use with the module to get a list of EXE sensors with their script and parameters:
Get-Sensor -tag "*exe*" | Get-ObjectProperty | Select-Object Name, exefile, exeparameters
Here is the output for this command (example):
Name ExeFile ExeParameters
---- ------- -------------
Cisco Webex cisco_webex.ps1 -ValueLookup cisco.webex.status
Ring Central Ring_Central.ps1 -Region EMEA -ValueLookup ringcentral.status
Custom EXE/Script Sensor Demo Batchfile - Returns 200.bat
Kind regards.
Oct, 2020 - Permalink
Hello,
Thank you for your message.
Regarding your question, I would recommend you to use the PowerShell module called PRTGAPI. You can find the module right here: https://github.com/lordmilko/PrtgAPI
Here is a command you can use with the module to get a list of EXE sensors with their script and parameters:
Get-Sensor -tag "*exe*" | Get-ObjectProperty | Select-Object Name, exefile, exeparameters
Here is the output for this command (example):
Kind regards.
Oct, 2020 - Permalink