Forum Discussion

ltaylor510_5583's avatar
ltaylor510_5583
Icon for Nimbostratus rankNimbostratus
Sep 18, 2008

Perl 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

  • Hi !

     

     

    I changed a little bit the code given above, but the redefinition of the typecast isn't working with nagios.

     

     

    I have this error :

     

     

    **ePN /usr/local/nagios/libexec//check_F5.pl: "Use of uninitialized value in string eq at (eval 135) line 66,

     

     

    and here is the part :

     

     

     
     sub SOAP::Deserializer::typecast 
     { 
             my ($self, $value, $name, $attrs, $children, $type) = @_; 
             my $retval = undef; 
      
             if ( ($type ne undef) && ("{urn:iControl}Common.EnabledState" eq $type) )here is line 66 
                     { 
                             $retval = $value; 
                     } 
             return $retval; 
     } 
     

     

     

    I think it's because sometimes the $type variable is empty, and it cannot evaluate with anything in nagios.

     

     

    What could I do in order to get the problem solved ?

     

     

    thanks !
  • Give this a try:

     
     sub SOAP::Deserializer::typecast  
     {  
     my ($self, $value, $name, $attrs, $children, $type) = @_;  
     my $retval = undef;  
      
     if ($type ne undef) { 
     $retval = $value if ("{urn:iControl}Common.EnabledState" eq $type); 
     } 
      
     return $retval;  
     }  
     

  • in the continuity of my script, I still have the error :

    SOAP-ENV:Client Unknown method "{urn:iControl:System:Failover}:get_failover_state"

    I think it's comming from :

     
     sub SOAP::Deserializer::typecast 
     { 
     my ($self, $value, $name, $attrs, $children, $type) = @_; 
     my $retval = undef; 
     if ( (defined $type) && ("{urn:iControl}LocalLB.MonitorStatus" eq $type) ) 
     { 
     $retval = $value; 
     } 
     if ( (defined $type) && ("{urn:iControl:System:Failover}FailoverState" eq $type) ) 
     { 
     $retval = $value; 
     } 
     return $retval; 
     }

    I'm not sure how to modify the {urn:iControl:System:Failover}FailoverState in order to kill the error ...

    any idea ?

    tal
  • I think you got this answered in the other thread. The unknown method error comes from the "uri" attribute of the SOAP object you create. You'll need a slash between "System" and "Failover", not a colon.

     

     

    -Joe