Hi Paessler,
im working on an email report of changes to status overnight across a core. Nightshift are demanding pause rights and i dont trust em!
Could you perhaps let me know of any api queries you may know of to pull out the data of the last 12hrs from the system events pause/unpause log? I am making headway with scraping of the webpage and trimming but it feels a bit clunky for a software with such a good api :)
Article Comments
Just time stamps i would think, we're not too fussed about the periods things are paused i just need to format an email to arrive each morning with stuff that was paused overnight. To a sensor level it doesnt need to be too detailed, its mostly just so if someone says "hey why is xxxx paused" i can be "oh, ryan did that last night" without having to trawl through logs, which admittedly isnt too bad a task, but my boss demands an email :P
Oct, 2018 - Permalink
You can retrieve event logs of a specified type for a specified time period using the Get-ObjectLog cmdlet of PrtgAPI.
Get-ObjectLog -Status PausedByUser,PausedByDependency,PausedByLicense,PausedBySchedule,PausedByUser -end (get-date).addhours(-12)
I would recommend excluding PausedByDependency, and also filtering | where Message -ne "Paused by parent"
C:\> Get-ObjectLog -Status PausedByUser,PausedByLicense,PausedBySchedule,PausedByUser -end (get-date).addhours(-12) | where message -ne "Paused by parent" DateTime Id Name Device Status Message -------- -- ---- ------ ------ ------- 16/10/2018 9:50:10 PM 1 New York PausedByUser Paused by user
Is this the information you're after?
Regards,
lordmilko
Oct, 2018 - Permalink
As always, thanks for chiming in! :)
PRTG Scheduler |
PRTGapi |
Feature Requests |
WMI Issues |
SNMP Issues
Kind regards,
Stephan Linke, Tech Support Team
Oct, 2018 - Permalink
Hi Sam,
Are you only interested in the actual timestamps or the time between paused and unpaused events on a per sensor basis?
PRTG Scheduler | PRTGapi | Feature Requests | WMI Issues | SNMP Issues
Kind regards,
Stephan Linke, Tech Support Team
Oct, 2018 - Permalink