Extension: Alerts work on a schedule

Posted by: Pete Ness

Extension: Alerts work on a schedule - 07/02/06 05:59 PM

Extension Goal:

This extension allows you to set up a schedule for an alert based on the time of day and day of the week.

For example, you can set up an alert that only notifies you of problems from 9:00 to 17:00 Monday through Thursday, and not at all on Friday, Saturday or Sunday.

Required PingPlotter Pro version

This extension requires PingPlotter Pro 3.00.3p beta 10 or higher. It will *not* work on the released 3.00.2p version.

Installation Instructions
  • Download the attachment from this post (link near the title). The file will be named "Alert Condition - Scheduled.ppx".
  • Save it in your "c:\Program Files\Pingplotter Pro\scripts" directory (or the appropriate path if you've not installed to that location).
  • Close and restart PingPlotter Pro.
  • Go to the alerts setup (Edit -> Alert Setup...)
  • Create a new alert, or select one of your existing alerts you want to
    test this on.
  • In the "Method" dropdown, select "Latency - on a schedule"
  • You'll see a new area for the days of the week and times. Fill that in with appropriate times. The time ranges entered are times the alert will fire. Anything outside of those ranges will not cause the alert to fire.
  • Continue to configure the alert, per your needs.
Wrap up

If you find any issues are problems, please post a message here or send an email to support@pingplotter.com.

**Update (April 15, 2015): PingPlotter v4 requires an updated version of this script to work, which you'll find attached below.
Posted by: Pete Ness

Re: Extension: Alerts work on a schedule - 07/02/06 10:38 PM

Here's a screenshot of the time editor.
Posted by: Shane Vincent

Re: Extension: Alerts work on a schedule - 05/16/07 02:44 AM

Hi Pete,
Just a quick question, will a time range like this work
Mon: 19:00 18:00

I know it seems back to front but i'm only trying to exclude alerts from 6PM to 7PM. Otherwise i will just use 00:00 to 18:00

Thanks - Shane
Posted by: Pete Ness

Re: Extension: Alerts work on a schedule - 05/16/07 02:57 AM

Nope - you can't *exclude* a time, you can only include it.

If you're brave, though, you can edit the script and reverse the behavior. If you make a copy of the script and save it to "Alert Condition - Scheduled (reverse logic).ppx" (or something similar), you just have to edit one line of the script to change the behavior.

Line 115 of the script is this:
Code:
      if ((Time < StartTimes(CurDayOfWeek) / (24 * 60))) or (Time >= ((EndTimes(CurDayOfWeek) + 1) / (24 * 60))) then
        ' We're outside the time window!
        exit sub
      end if


If you change it to this, then the time window will be an exclusion window, rather than inclusive:

Code:
      if ((Time >= StartTimes(CurDayOfWeek) / (24 * 60))) and (Time < ((EndTimes(CurDayOfWeek)) / (24 * 60))) then
        ' We're inside the time window - don't check!
        exit sub
      end if


- Pete
Posted by: Shane Vincent

Re: Extension: Alerts work on a schedule - 05/16/07 11:49 PM

Once again thanx, works great.

I also removed the 'exit sub' in the line above so that if 00:00 to 00:00 is entered it will check all day and of course i changed some wording around for the comments.

Cheers - Shane