Hello,
i was wondering if i could get a list out of the API with one channel for all windows update status sensors available.
So in detail i would need a list with colum 1 "Time since last Update" and colum 2 "Devicename"
Thanks, Raphael
Article Comments
Hi Raphael,
In PRTG you could also create a Factory Sensor that pulls the channel from each device (should not be more than 50 then though), if you want go by API for extracting it, then follow lordmiko's approach using PRTGApi, which would be way faster anyway than creating the Factory Sensor.
Kind regards,
Erhard
P.S.: Thanks for chipping in, lordmilko, appreciated as always.
Jul, 2018 - Permalink
@lordmilko: Would it be possible to adjust the call to output all channels for each update status sensor per device? I assume the array definition near the end has to be adjusted for that and of course the channel selection, but I haven't gotten my head around it so far.
Just asking, because it might be helpful for this one.
Kind regards,
Erhard
Jul, 2018 - Permalink
Simply doing Get-Channel without specifying a channel name or ID will retrieve all channels
If you want to analyze all properties of all of your channels in Excel, I would recommend using the following
Get-Sensor -Tags windowsupdatesstatus | foreach { $_ | Get-Channel | Add-Member Device $_.Device -PassThru } | Export-Csv C:\windowsupdates.csv -NoType
Then you can tell Excel to convert it into a table, and exclude all channels in the Name column you don't want to look at
Note the importance of specifying Export-Csv outside of the foreach loop; specifying it inside the loop would overwrite the output file on each iteration
Jul, 2018 - Permalink
You can do this with PrtgAPI using PowerShell
First we retrieve all Windows Updates Status sensors in the system. For each sensor, we then retrieve the "time since last update" channel and append the "Device" property of the input sensor.
Then, we select only the Device and LastValue properties, specifying a custom expression for the LastValue column, allowing us to give it the custom name "TimeSinceLastUpdate"
You can then pipe these commands to Export-Csv to analyze it in a spreadsheet, or modify it to use different properties such as LastValueNumeric (which will give you the time since last update in seconds, giving you greater flexibility in parsing it in Excel)
Regards,
lordmilko
Jul, 2018 - Permalink