Skip navigation
3859 Views 13 Replies Latest reply: Apr 11, 2013 5:32 AM by joanypony RSS
Moob Rank: White Belt 7 posts since
Oct 27, 2011
Currently Being Moderated

Jul 17, 2012 3:06 AM

Alerts rules with active periods

Hi,

 

I am trying to make use of alert rules with an active period but so far everything I have tried failed.

 

Accoording to the manual you need to disable the alert and create an schedule. In here you create the active period in which the alert should be sending messages. So the alert is set to disable and the schedule is set to enable just as the manual says it should be setup.

 

No matter what I do, changing active period times etc.., the message will no be send out. The only way to send messages is to enable the alert again which effectivly disables the active period and sets the alert to send messages 24/7

 

Another thing I have noticed is that when I set an alert schedule to disable the next day it is set to enable again.

 

The user setup is, one user with multiple alert rules. One rule for 24/7 (from 03:00-01:00), one rule for 8to9 (08:00-17:00), one rule for 7to7 (07:00-19:00). The alert rules are triggered by filtering on Device Groups.

 

Are there any people out there who can give me some pointers on how get the active period ability working ? Any other suggestions are also welcome

 

Using Zenoss 3.2.0 on CentOs 6.x

 

Regards Moob

  • Touko Vainio-Kaila Rank: White Belt 7 posts since
    Sep 18, 2012
    Currently Being Moderated
    1. Sep 18, 2012 7:58 AM (in response to Moob)
    Re: Alerts rules with active periods

    I have just the same problem, using Zenoss 2.5.1 ATM.

     

    The alerting rule is set disabled and active periods are set enabled but I don't get any alerts. Alert rule hsould otherwise be OK because in the case of "ongoing issue", if I set the alerting rule enabled, I get an alert email in a couple of minutes.

     

    Is there something trivial we are missing with Active period settings? I suppose this should work, right?

     

    regards,

    Touko

  • Touko Vainio-Kaila Rank: White Belt 7 posts since
    Sep 18, 2012
    Currently Being Moderated
    2. Sep 18, 2012 9:01 AM (in response to Touko Vainio-Kaila)
    Re: Alerts rules with active periods

    Hi again,

     

    one place to get related info is the zenactions log (from the GUI : Settings -> Daemons).

     

    Based on that, it would seem that combination of Disabled Alerting Rule + Enabled Active Periods would end up as not processing the rule?

     

    I tried with enabling the alerting rule. That increased the number of processed rules and email was sent (my alerting rule condition was fulfilled)

     

    2012-09-18 15:40:28,472 INFO zen.ZenActions: processed 30 rules in 0.12 secs
    2012-09-18 15:41:28,486 INFO zen.ZenActions: Processed 0 commands in 0.000028
    2012-09-18 15:41:28,902 INFO zen.ZenActions: rule 'Rule_name' sent email:Email subject to:['foo@bar.com']
    2012-09-18 15:41:28,986 INFO zen.ZenActions: processed 31 rules in 0.51 secs
    2012-09-18 15:42:29,030 INFO zen.ZenActions: Processed 0 commands in 0.000035
    

    Does anyone have more insight?

     

    regards, Touko

  • Touko Vainio-Kaila Rank: White Belt 7 posts since
    Sep 18, 2012
    Currently Being Moderated
    3. Sep 19, 2012 5:45 AM (in response to Touko Vainio-Kaila)
    Re: Alerts rules with active periods

    After some googling etc, I found that this alerting rules + schedules + enabled-states seems to have been somewhat unclear.

     

    Related Zenoss Trac tickets:

     

    Some related messages (mostly for 2.X series)

     

    It remains a bit unclear how the functionality has worked during the different old versions.

     

    regards, Touko

  • Touko Vainio-Kaila Rank: White Belt 7 posts since
    Sep 18, 2012
    Currently Being Moderated
    5. Sep 20, 2012 3:30 AM (in response to Moob)
    Re: Alerts rules with active periods

    Hi Arend,

     

    thanks for the info.

     

    Maintenance windows seem to be device/device group specific? (What I'd need in a perfect world would be different time windows for different monitored things but these could also work).

     

    If somebody still knows a way to get these alerting rule schedules to work, please share =)

     

    Regards,

    Touko

  • jcurry ZenossMaster 1,021 posts since
    Apr 15, 2008
    Currently Being Moderated
    7. Sep 21, 2012 8:20 AM (in response to Moob)
    Re: Alerts rules with active periods

    Maintenance windows and schedules for alerting rules are, in fact, implemented using the same underlying Python code.

     

    Maintenance windows can be deployed on devices, device classes, groups, systems and locations so it is a good way to implement (as the name says) maintenance windows for a collection of devices.

     

    The schedule for an alerting rule is the same concept but user-focused.

     

    Schedules for alerting rules do work (in my experience) but can be a little confusing to setup and get especially confusing if you have several alerting rules / schedules that apply to a particular user (like an alerting rule specific to a user and an alerting rule for the group that a user is a member of).

     

    I would always setup an alerting rule as Enabled.  Then create your schedule and make sure that is enabled.  The schedule will then enable / disable the alerting rule as appropriate.

     

    As Touko says, zenactions.log is your debug tool here.

     

    One thing I have been working on recently is an audit script to dump to flat files, many of the elements of the Zope database.  I have one that dumps users, their alerting rules and associated schedules; another dumps user groups with rules and schedules; a third dumps maintenance windows.  I have done basic testing of these on both Zenoss 3 and 4 (the alerting rules and schedules do not get reported on Zenoss 4 as the notifications / triggers mechanism has changed) - other than that, they seem to work fine.  I am looking for other testers.  please let me know if these would be helpful and you have a test environment to run them in and I will send you the tar bundle.

     

    Cheers,

    Jane

  • Touko Vainio-Kaila Rank: White Belt 7 posts since
    Sep 18, 2012
    Currently Being Moderated
    8. Sep 25, 2012 3:33 AM (in response to jcurry)
    Re: Alerts rules with active periods

    Thanks Jane for your reply

     

    despite trying, I haven't seen Active Periods of Schedule to have any effect at all (using Zenoss 2.5.1; pretty old, I know).

     

    What I have tried:

     

    • Alerting rule disabled, Active periods enabled
      • This seems to be what the manual advices to do.
      • Alerting rule is disabled
      • Active Period for desired time (Enabled, repeat daily)
      • -> Don't get any notifications
      • So active period alone doesn't seem to activate disabled alerting rule?
    • Alerting rule enabled, Active periods enabled/disabled
      • As you mentioned
      • Alerting rule enabled
      • Active period that is enabled for certain time (enabled, repeat daily)
      • Active period that is disabled for rest of the time (disabled, repeat daily)
      • -> I get notifications every hour (Repeat Time set to one hour for testing)
      • So Active period that is disabled doesn't seem to disable an active alerting rule

     

    Is there something I should understand to consider?

     

    Best regards,

    Touko

  • jcurry ZenossMaster 1,021 posts since
    Apr 15, 2008
    Currently Being Moderated
    9. Sep 26, 2012 3:55 PM (in response to Touko Vainio-Kaila)
    Re: Alerts rules with active periods

    Not quite sure I understand you here.  From your second scenario with Alerting Rule enabled, you just set up one schedule  for when you want the rule to be active.  You enable the rule and the schedule.  You do NOT set up a schedule for the inactive period - just a window for the active period.

     

    You should then see that the overall rule is active during the period you have defined, and the rule is automatically disabled the rest of the time.

     

    Cheers,

    Jane

  • Touko Vainio-Kaila Rank: White Belt 7 posts since
    Sep 18, 2012
    Currently Being Moderated
    10. Sep 27, 2012 3:40 AM (in response to jcurry)
    Re: Alerts rules with active periods

    Hi,

     

    I have a feeling that I've tried this already but I'll give it another try. So, your suggestion is

    • Alerting rule itself : enabled
    • Active period for the alerting rule :  enabled
    • -> So the alerting rule will first be enabled (and send emails) should be disabled when the active period ends, right?

     

    You're talking about enabling the schedule, this might be a version mismatch (I'm using 2.5.1)? At least, I haven't yet discovered how to "enable/disable a schedule"?

     

    For the Alerting rule, I got the following tabs:

    • Edit (with Enabled state for the whole alerting rule)
    • Message
    • Schedule with list of Active Periods (in some parts of GUI referred to as "Rule Window")
      • Active periods have Enabled state

     

    Is there something I have missed? (I'll try this new active period setup anyway)

     

    Best regards,

    Touko

  • chitambira Rank: Brown Belt 711 posts since
    Oct 15, 2008
    Currently Being Moderated
    11. Sep 27, 2012 5:07 AM (in response to Touko Vainio-Kaila)
    Re: Alerts rules with active periods

    You're talking about enabling the schedule, this might be a version mismatch (I'm using 2.5.1)? At least, I haven't yet discovered how to "enable/disable a schedule"?

    In the Schedule Tab, if you click on the schedule name listed there, it should take you to the properties of that schedule where you can change 'Enabled' from False to True.

  • Touko Vainio-Kaila Rank: White Belt 7 posts since
    Sep 18, 2012
    Currently Being Moderated
    12. Sep 27, 2012 8:00 AM (in response to chitambira)
    Re: Alerts rules with active periods

    Hi,

     

    this might be a version mismatch or then I'm still missing something?

    Schedule screenshot.png

    Best regards,

    Touko

  • joanypony Rank: Green Belt 114 posts since
    Mar 7, 2012
    Currently Being Moderated
    13. Apr 11, 2013 5:32 AM (in response to Moob)
    Re: Alerts rules with active periods

    Hi,

     

    I know this is an old post, but I was having issues with schedules yesterday and was going crazy. I've finally figured it out, so I thought I'd let you know.

     

    Your alerting rule must be enabled.

    Your schedule must be enabled.

     

    Say it is 9am now. You have just created your schedule,  and your schedule says the alerting rule is only to alert between 10am and 11am every day.

    At this exact moment, it will not work as you expect. You will receive alerts.

     

    If you wait, at 10am, the schedule will start to work as it should. At 11am, zenoss will set the status of the alerting rule to disabled. Then tomorrow, at 10am, it will set the status of the alerting rule to enabled.

     

    I hope that helps. The difficulty in troubleshooting during the setup, is that Zenoss doesn't seem to behave as expected until the start time of the schedule has passed.

     

    Regards,

    Joan

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points