Forum Discussion

KimL_175448's avatar
KimL_175448
Icon for Nimbostratus rankNimbostratus
Nov 06, 2014

How to get sync information with .Net API

I apologize if this question doesn't make sense or if I'm not posting in the correct location. I am a .Net developer and never even heard of F5 until I was tasked with developing a web interface for controlling our devices. From what I was told, we have a device group of two devices that are set up as a failover. I need to determine if the devices are in sync. I have the name of the device group and the names of both devices.

 

Determine if devices are in sync:

 

This code works, but I'm not sure it makes sense because I would expect to be connecting to the device group, not one of the devices. However, this is the only way I could find to get the sync state. This code returns iControl.ManagementDeviceGroupMemberState.MEMBER_STATE_IN_SYNC. The reason it doesn't make sense to me is because what if the device I'm connecting to is down and the other device is now the active one? In that case, I would not be able to connect, right?

 

Interfaces m_interfaces = new Interfaces();
m_interfaces.initialize("Device1Name", 443, userName, password);
dg.SyncStatus = m_interfaces.ManagementDeviceGroup.get_sync_status_overview().member_state;
  • shaggy's avatar
    shaggy
    Icon for Nimbostratus rankNimbostratus

    Try using a different interface for each device in the device group, and, once you determine which device(s) is/are active, make iControl calls against those devices only (if you are looking for traffic statistics).

     

    • KimL_175448's avatar
      KimL_175448
      Icon for Nimbostratus rankNimbostratus
      Ok that helps. It's good to know that I'm on the right track. I thought it would make more sense to connect to the group and get the device names from the group, then connect to them individually, but it sounds like that's not how this was designed to work. I figured if they ever added a third device, I wouldn't want to have the individual device names hard-coded because then I'd have to update my code.
    • shaggy's avatar
      shaggy
      Icon for Nimbostratus rankNimbostratus
      you could also use the list of devices in the device-group. Depending on your network structure and the configuration of the F5s, you may be able to connect to a floating address that is owned by the active device and query against that initially - that way you should always hit a live/active device to determine what specific devices to query
  • Try using a different interface for each device in the device group, and, once you determine which device(s) is/are active, make iControl calls against those devices only (if you are looking for traffic statistics).

     

    • KimL_175448's avatar
      KimL_175448
      Icon for Nimbostratus rankNimbostratus
      Ok that helps. It's good to know that I'm on the right track. I thought it would make more sense to connect to the group and get the device names from the group, then connect to them individually, but it sounds like that's not how this was designed to work. I figured if they ever added a third device, I wouldn't want to have the individual device names hard-coded because then I'd have to update my code.
    • shaggy_121467's avatar
      shaggy_121467
      Icon for Cumulonimbus rankCumulonimbus
      you could also use the list of devices in the device-group. Depending on your network structure and the configuration of the F5s, you may be able to connect to a floating address that is owned by the active device and query against that initially - that way you should always hit a live/active device to determine what specific devices to query