Forum Discussion

EKON_26654's avatar
EKON_26654
Icon for Nimbostratus rankNimbostratus
Aug 19, 2010

Monitor interface seems bogus.

Hello,

 

I am not sure if I am misunderstanding what I am supposed to get as a result, but my basic issue is that I am trying to use icontrol to FORCE a member down in a pool.

 

 

In using the Monitor->get_instance_state method to query the instance state, even if I manually forced the instance down or even if I just disabled it using the browser, the method reports that the instance (the pool member) is up.

 

 

If I use the Monitor->set_instance_state method and set the value of the instance_state to INSTANCE_STATE_FORCED_DOWN, it completely ignores the request, and does nothing, the member of the pool reflects as green and up in the browser.

 

 

I also notice that the PoolMember interface does the same thing when querying the get_monitor_instance method. Members of a pool that are visibly forced down or disabled using the browser are reported as instance_state_up through IControl.

 

 

The PoolMember get_monitor_status method gets closer to reality by reporting that the monitor state is MONITOR_STATUS_FORCED_DOWN if the monitor is truly forced down, however, if the monitor is just manually disabled, and you query it using this method, then it says that it is up.

 

 

So, I've really tried hard to find a way to get an accurate state of the members of my pool but I get wrong information. Am I misunderstanding the value these methods are supposed to return?

 

 

And in any case, how do I using IControl force down a member of a pool?

 

 

Thank you.

 

2 Replies

  • The quick and dirty answer is to use the LocalLB.PoolMember methods when you are working on the pool members. We get this question a lot so I'll whip up a tech tip around the Monitor interface and how to use it. For now, look at the LocalLB.PoolMember.set_session_enabled_state() to disable new connections, monitor the LocalLB.PoolMember.get_statistics() method until connections drop to 0, and then use the LocalLB.set_monitor_state() method to down the pool member.

     

     

    If you aren't concerned with a graceful shutdown (ie, not truncating existing connections), you can just go straight for the set_monitor_state() method.

     

     

    I've written a few tech tips on this topic like this one:

     

     

    http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/254/iControl-Apps--04--Graceful-Server-Shutdown.aspx

     

     

    And here's the full sample code behind it:

     

     

    http://devcentral.f5.com/wiki/default.aspx/iControl/PsPoolMemberControl.html

     

     

    That example is written in PowerShell but hopefully you'll be able to read the logic flow and method calls if you need to translate it to a different language.

     

     

    Let me know if this needs more clarification.

     

     

    -Joe