What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

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

Export pause/maintenance and resume status from logs via API

Votes:

0

Hello,

I'm successfully using PRTG reports to export the UP and DOWN statistics of certain sensors divided by working days and weekends, but I can't see the pause status.

To overcome this lack I am exporting via API the "pause" and "resume" states from the PRTG logs, and I would like to know if a schedule can be applied directly to the API like I'm already doing with built-in reports (one schedule for working days and one for week ends), or if a "day" column can be added to easily see if the time stamp is related to a monday or a sunday (now I am using "datetime" column)

Alternatively, is there a way to receive a notification when a sensor exits the pause state? This feature would solve all my problems since my goal is to have a sort of report of the duration of the maintenances.

thank you, Enrico

api maintenance pause reports resume sla

Created on Jul 19, 2019 11:01:25 AM



1 Reply

Votes:

1

If you're happy to generate this information on demand using PowerShell or as part of a script configured to run as part of a Scheduled Task you can list the pause/resume events of objects fairly easily using the Get-ObjectLog cmdlet of PrtgAPI

C:\> Get-ObjectLog -Status Pausing,Resuming

DateTime                Id     Name      Device         Status         Message
--------                --     ----      ------         ------         -------
18/07/2019 12:23:45 AM  2056   Ping      ci-prtg-1      Resuming       Requested by PRTG System ...
18/07/2019 12:23:42 AM  2056   Ping      ci-prtg-1      Pausing        Paused at 18/07/2019 12:2...

If you then group by Id using the Group-Object cmdlet you can calculate the difference between each Pause and its successive resume (if applicable) by subtracting their respective DateTime values

Created on Jul 19, 2019 1:30:58 PM




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.