Forum Discussion
Dean_M_21414
Sep 13, 2011Nimbostratus
Report for down nodes
Hi all,
I need a script that will list all down nodes per pool, by partition. We need a daily report that will show our downed nodes along with their associated pool/s (via members). We also need thi...
George_Watkins_
Sep 13, 2011Historic F5 Account
Hi Dean,
Probably your best bet is to write an iControl script. iControl is a SOAP API for making requests to a BIG-IP. We offer libraries for a number of common script languages (Perl, Python, Ruby, Powershell, etc.), so there is more than likely one that will meet your needs. Here are a few resources to get you started:
iControl Wiki (http://devcentral.f5.com/wiki/iControl.HomePage.ashx) - lots of code samples from numerous scripting languages
iControl API Reference (http://devcentral.f5.com/wiki/iControl.APIReference.ashx)
iControl LocalLB::Pool interface (http://devcentral.f5.com/wiki/iControl.LocalLB__Pool.ashx) - this is where the majority of the methods you'll need for querying pools will be
iControl Management::Partition interface (http://devcentral.f5.com/wiki/iControl.Management__Partition.ashx) - where the active partition to query is set (note: partitions have been deprecated in favor of folders in version 11)
I am more Ruby-centric, so I whipped up a small script that will report pools without active members. I hope this gives you some fuel to get started. Feel free to reply with any further questions.
!/usr/bin/ruby
require 'rubygems'
require 'f5-icontrol'
def usage
puts $0 + ' '
exit
end
usage if $*.size < 3
set up Management::Partition and LocalLB::Pool interfaces
bigip = F5::IControl.new($*[0], $*[1], $*[2], \
['Management.Partition', 'LocalLB.Pool']).get_interfaces
grab a list of partition and loop through them
partitions = bigip['Management.Partition'].get_partition_list
partitions.each do |partition|
set the active partition to query
partitions = bigip['Management.Partition'].set_active_partition(partition['partition_name'])
puts ('' * 5) + " {partition['partition_name']} " + ('' *5)
puts
grab a list of pools and stuff the array into a variable
pools = bigip['LocalLB.Pool'].get_list.sort
pool_active_members = bigip['LocalLB.Pool'].get_active_member_count(pools)
[ pools, pool_active_members ].transpose.each do |pool|
puts "{pool[0]} - {pool[1]} available members"
end
puts
end
-George
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects