Forum Discussion

Lalit_Kumar_533's avatar
Lalit_Kumar_533
Icon for Nimbostratus rankNimbostratus
Jul 22, 2005

Event Notification Samples in Java

I want to create a listener in Java which should listen to node enable/disable events in F5.

 

 

I looked at the article http://devcentral.f5.com/Default.aspx?tabid=29&newsType=ArticleView&articleId=15

 

which seems to be relevant , but I could not find any sample java code implementation for the above event model.

 

 

Can anybody provide me the sample code which implements the Management.EventNotification and Management.EventSubscription to create listener/subscriptions for the node events in Java.

 

 

 

Thanks.

 

 

 

 

18 Replies

  • We are currently looking at authorization but that won't help you in the short term.

     

     

    What I would suggest would be to separate the EventSubscription code (creating the subscriptions) into a separate app outside your monitoring code and letting that application receive the EventNotification events.

     

     

    Ideally, you would create a subscription once and let the notifications take care of themselves. The only reason you would want the EventSubscription code in your monitoring app is if it's a requirement to create the subscriptions and manage the health of the notifications from in there.

     

     

    -Joe
  • I appreciate the feedback.

     

     

    Once the event notification has been created, is this permanent? Meaning if the bigip reboots, does this need to be done again?

     

     

    I'm hoping it is permanent. Then this would be an easy fix.

     

     

    Also, the type of notifications that are received... Are they any more details than the standard Node xxx Monitor down? Do they indicate which monitor failed on a node if they have more than one monitor assigned?

     

     

    Thanks,

     

     

    Shawn
  • The configuration is persisted to disk after each modification (create, modify, delete) so it will persist across reboots.

     

     

    The notifications don't contain detailed info as to why events happended, just the information about what and when they did.

     

     

    -Joe
  • Thanks Joe! So basically we will just get the "Node Monitor UP/Down" alerts the same as we would with syslog? The reason I am asking is that currently syslog will only tell us that a monitor failed... We have 2 monitors in most of our pools so we never know what one failed except by going to to the node in the pool via the GUI.

     

     

    Thanks,

     

     

    Shawn
  • So our experience is that we have sucessfully created our subscriptions and receive them as expected. We have a separate script that creates the subscription so we don't need to give our iControl user any elevated privs. However, it seems that when our listener is down the subscription is disabled.

     

     

    We thought that a user with Operator privs would be able to enable this subscription. We get an error:

     

     

    SOAP-ENV:Server User "foo" is not authorized to access "urn:iControl:Management/EventSubscription::set_state".

     

     

    The "foo" user has "Operator" privs.

     

     

    Is there anyway to get around this? We do not want to give administrative rights to an automaton. We are hoping that the "Operator" privs will allow us to set the enable/disable state of the event subscription.

     

     

    Any thoughts or clues would be most appreciated!

     

     

    Dan Peterson.
  • Unfortunately that one requires admin privileges at this point...

     

     

    Ideally this should be allowed under the Operator role but the code currently doesn't support it. If you would like that changed, I'd suggest you contact Support to try to get that changed.

     

     

    Sorry about that...

     

     

    -Joe
  • Hi Joe,

     

     

    The Perl version of event notification works great. Can syslog achieve the same functionality of event notification? For example, when a user is added, a syslog will be sent indicating EVENTTYPE_CREATE occured. But from syslog I only see http GET and POST which calls certain jsp. Is it possible to configure syslog to capture event?

     

     

     

    Thanks,

     

     

    Minquan
  • At this point I don't think that this is possible. The Event Notification daemon listens on the internal schema database for change notifications and then proxies those out to event subscribers. The System Log is not currently tied to internal schema changes. If it was, the disk would fill up pretty fast with log messages.

     

     

    -Joe