Forum Discussion

bielik_9758's avatar
bielik_9758
Icon for Nimbostratus rankNimbostratus
Nov 15, 2012

How to get a nodes list filtered by their name?

Hi,

 

I'm trying to write a script, which provides a control to the nodes from specific server. Every way I tried, it shows me only addresses of every nodes or addresses with statuses. And I'm not talking about pool memebers, just nodes. How to choose from that list only a group which have a mask: *[server_name]* in the name field?

 

get-f5.ltmnodeaddress gives me a list of all nodes with statuses. When I try to add another command Where-Object, it gives me an error. This solution works perfectly when I look for specyfic pools.

 

(get-f5.icontrol).LocalLBNodeAddress.get_monitor_status( (,$a)) gives me a status of nodes addresses which are in $a variable, but there have to be a list of IP addresses. If I try to execute that command with a name of a node in that variable, I get an error:

 

Exception calling "get_monitor_status" with "1" argument(s): "Exception caught in LocalLB::urn:iControl:LocalLB/NodeAdd

 

ress::get_monitor_status()

 

Exception: Common::OperationFailed

 

primary_error_code : 16908342 (0x01020036)

 

secondary_error_code : 0

 

error_string : 01020036:3: The requested node address (c8a6:ccff:a05a:92f7:7cae:ccff:70ae:ccff) was not fou

 

nd."

 

At line:1 char:59

 

+ $b=(get-f5.icontrol).LocalLBNodeAddress.get_monitor_status <<<< ( (,$a));

 

+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException

 

+ FullyQualifiedErrorId : DotNetMethodException

 

I look to SDK and I can't see anything about choosing nodes based on their names. Am I missing something, or there is no way to specify a nodes list by their name?

 

Thanks.

 

2 Replies

  • Hi Bielik,

     

     

    The F5's track nodes based on specific IP Addresses (and in some cases on the IP Address and Port), becuase multiple IP Addresses can be assigned to a specific DNS name and can result in conflicts.

     

     

    You will have to manage and query your results for nodes based on the IP Address and do your associations with the results.

     

     

    LocalLB::NodeAddressV2

     

    LocalLB::NodeAddressV2::get_list

     

    LocalLB::NodeAddressV2::get_monitor_status

     

  • I've always wished for server-side (ie. on the iControl server) filters. For search and to implement exists() type functions, this would be helpful. Instead, I've had to resort to yucky hackery like performing a no-side effect API call on a single entity in question and see if it throws a "not found" exception. This is just one of those head scratching limitations of the iControl API.