Forum Discussion

wilfred_pascasi's avatar
wilfred_pascasi
Icon for Nimbostratus rankNimbostratus
Jul 31, 2006

send an email when failover occurs

I would like to know if there is a way to receive an email from the bigip when it failover from active to standby or vice versa. I am running version 4.5.7.

6 Replies

  • I'm not sure how this ties into iControl. I guess you could build an iControl app that monitors the self-ips on the shared address of the BIG-IP. When the self-ip changes you can have your app send out the email.

     

     

    You'll probably want to forward this question to F5 Product Support.
  • Joe,

     

     

    That's exactly what I would like to do. Is this possible? What do I need to do?

     

     

    Thanks,

     

     

    wwolfman
  • Actually, most likely the simplest way is to monitor the System Id (from the System::SystemInfo::get_system_id() method). This is a UUID that is based in the primary mac on the system. If a failover occurs and you are monitoring the system on the shared address, the value of the system id will change. You could alternately use one of the serial numbers from the System::SystemInfo::get_system_information() method as this identifier. Another option is the Networking::AdminIP::get_list() that will return a list of the admin ip addresses on the device.

    Logic is as follows:

    String id = get_unique_id();
    while (1)
    {
      String id2 = get_unique_id();
      if ( id2 != id )
      {
        send_email_to_someone();
        id = id2;
      }
      // Don't flood the BIG-IP with calls.  Sleep in between requests.
      sleep_some_amount_of_time();
    }

    Hope this helps...

    -Joe
  • Loc_Pham_101863's avatar
    Loc_Pham_101863
    Historic F5 Account
    Or if your BIG-IP is configured for outgoing mails, you can configure alertd to send an email when the system is going Active or Standby, as shown through this AskF5 solution:

     

     

    https://tech.f5.com/home/bigip-next/solutions/lognotify/sol3667.html

     

     

    Regards,

     

    Loc
  • The last suggestion regarding alertd does not work in my environment because I am running version 4.5.7. I call F5 support and I was told that their solution (sol2198) would not work either. So practically all they could tell me is that I need to write some script/code in order to get notification when failover occurs.

     

     

    I did look at the db file but was only able to obtain information regarding the unit id.

     

     

    b db get Local.Bigip.Failover.UnitId

     

     

    This only identify which box is host1 and which box is host2 but it does not tell me which one is the active box.

     

     

    Any suggestion or idea will be greatly appreciated

     

  • Loc_Pham_101863's avatar
    Loc_Pham_101863
    Historic F5 Account
    Not sure if this interface is available in 4.x, but System.Failover interface has the method get_failover_state that should return the Active or Standby state.

     

     

    Loc