What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

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

API call for tracking system status changes overnight

Votes:

0

Your Vote:

Up

Down

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 :)

api logs status-changes

Created on Oct 16, 2018 10:01:22 AM by  Samuel Ashdown (62) 1 1



4 Replies

Votes:

0

Your Vote:

Up

Down

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

Created on Oct 16, 2018 10:31:12 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

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

Created on Oct 16, 2018 10:39:45 AM by  Samuel Ashdown (62) 1 1



Votes:

0

Your Vote:

Up

Down

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

Created on Oct 16, 2018 11:03:18 AM by  lordmilko (2,142) 2 1



Votes:

0

Your Vote:

Up

Down

As always, thanks for chiming in! :)


PRTG Scheduler | PRTGapi | Feature Requests | WMI Issues | SNMP Issues

Kind regards,
Stephan Linke, Tech Support Team

Created on Oct 16, 2018 11:23:32 AM by  Stephan Linke [Paessler Support]



Please log in or register to enter your reply.


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.