Forum Discussion
ltaylor510_5583
Nimbostratus
Sep 18, 2008Perl script to display All BigIP pool members
I have a Perl CGI application in apache that will need a perl script to display all the available elements in one script:
("poolname" "address" "port" "session_state" "priority_group")
preferably in a toggle script under the showPoolMembers() subroutine.
I see the get_priority() method is only listed as a java method. Is there a perl equivalent that could list all of these elements in one script?
thanks in advance for any help.
24 Replies
- ltaylor510_5583
Nimbostratus
Humphrey - - Thomas_LE_GENTI
Nimbostratus
Hi ! - hwidjaja_37598
Altostratus
is check_F5 a Perl script? is there any error message? - Thomas_LE_GENTI
Nimbostratus
Hi ! - hwidjaja_37598
Altostratus
you can post it here so we might be able to see the error in the coding. - Thomas_LE_GENTI
Nimbostratus
Infact, the code is actually good, cuz i'm using it in a shell. But nagios is sending me back in /usr/local/nagios/var/nagios.log : - Thomas_LE_GENTI
Nimbostratus
ok I found why.!/usr/bin/perl use SOAP::Lite; use lib "."; use iControlTypeCast; die ("Usage: $0 host uid pwd \n") if ($ARGV != 2); my ($sHost,$sUID,$sPWD) = @ARGV; my $LocalLBPool = SOAP::Lite -> uri('urn:iControl:LocalLB/Pool') -> proxy("https://$sUID:$sPWD\@$sHost/iControl/iControlPortal.cgi"); my $LocalLBPoolMember = SOAP::Lite -> uri('urn:iControl:LocalLB/PoolMember') -> proxy("https://$sUID:$sPWD\@$sHost/iControl/iControlPortal.cgi"); my $Soap = $LocalLBPool->get_list(); my $member; my %SessionStatus; foreach my $Pool (@{$Soap->result}) { $Soap = $LocalLBPoolMember->get_session_status (SOAP::Data->name(pool_names => [$Pool])); foreach $member (@{${$Soap->result}[0]}) { $SessionStatus{"$member->{'member'}->{'address'}:$member->{'member'}->{'port'}"} = $member->{'session_status'}; } $Soap = $LocalLBPoolMember->get_priority(SOAP::Data->name(pool_names => [$Pool])); foreach $member (@{${$Soap->result}[0]}) { print join (" ", $Pool, $member->{'member'}->{'address'}, $member->{'member'}->{'port'}, $SessionStatus{"$member->{'member'}->{'address'}:$member->{'member'}->{'port'}"}, $member->{'priority'} ,"\n" ); } }
- hwidjaja_37598
Altostratus
I meant the source code for check_F5.pl and p1.pl. - Thomas_LE_GENTI
Nimbostratus
the check_F5.pl was your code I've taken from the .txt file above. - hwidjaja_37598
Altostratus
Hmm... Sorry I'm not an expert in Nagios. It looks like you need to check with Nagios user.
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