4 Replies Latest reply: Aug 9, 2012 10:47 AM by Elias Ross RSS

Dynagroups and Alert Definitions; RHQ 4.4

Elias Ross Master

I have a system with a lot of hosts coming online and going offline periodically. Inside are services I'd like to monitor.

 

Looking at the alerting system, I'd like to set up alert definitions that work with 'dynagroups' but I don't see a button for it in RHQ 4.4.

 

Is there a Bugzilla for such a feature? I wonder how difficult it would be to set this up compared to how static groups work.

 

As an alternative, I've thought about creating a script that can update my 'static' groups using a web service call. This is somewhat of a hack and I'm not sure how robust it might be.

  • 1. Re: Dynagroups and Alert Definitions; RHQ 4.4
    Lukas Krejci Novice

    What do you mean by "alert definitions that work with dynagroups"?

     

    If you have a dynagroup, you can create alert defs on it. Granted, I just checked only on my 4.5.0-SNAPSHOT build, but I don't think there's been anything new in this area in the last couple of versions.

     

    Now if you wanted something like alert def "templates" for groups - i.e. something along the lines of "if there happens to be a group with this type of definition, I want to automatically create these alert defs on it, thank you" - then yeah, that's unfortunately not possible. I actually like the idea a lot, because it nicely complements our existing alert def templates that are only available on a resource type level (i.e. you can say "for any resource of this type, I want these alert defs automatically created").

     

    I've tried searching bugzilla but I couldn't find any similar request. Would you mind creating one (here) and lay out in detail what would you expect from such a feature?

     

    Thanks, Lukas

  • 2. Re: Dynagroups and Alert Definitions; RHQ 4.4
    Elias Ross Master

    Forgive me.

     

    This was my definition:

     

    resource.type.plugin = flume

    resource.type.name = Flume Channel

    resource.name = 'Flume Channel agent-channel'

     

    and this somehow got my dynagroup defined as a 'mixed' group. So it prevented me from creating the alert definition like I thought it should. (Not sure why it became 'mixed' anyway.)

     

    Changing it to:

     

    resource.type.plugin = flume

    resource.type.name = Flume Channel

    resource.name.contains = 'agent-channel'

     

    worked.

     

    I do like your idea but it wasn't really at all what I needed.

     

    Something I'd like to have though is being able to reuse alert definitions more generally. Since they are often fairly similar, it would be nice to have a text box where you can copy/paste a definition from one place to another, then tweak a parameter or two. I am probably going to rely on the CLI tool to actually set up the definitions. Especially since I have two RHQ installations and are copying them around.

  • 3. Re: Dynagroups and Alert Definitions; RHQ 4.4
    Lukas Krejci Novice

    Unfortunately, RHQ's CLI is currently incapable of creating alert defs using the remote API/CLI. There's a long standing BZ for it https://bugzilla.redhat.com/show_bug.cgi?id=617202.

  • 4. Re: Dynagroups and Alert Definitions; RHQ 4.4
    Elias Ross Master

    So was this simply an oversight? It seems pretty straightforward to add to the AlertDefinitionManagerRemote interface:

     

    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public int createAlertDefinition(Subject subject, AlertDefinition alertDefinition, Integer resourceId)
        throws InvalidAlertDefinitionException;
       

     

    I could work a patch for this if it seems straightfoward, although it takes some time for me to get any patch approved through my company...