Forum Discussion

Richard__Harlan's avatar
Richard__Harlan
Historic F5 Account
Oct 26, 2004

get_node_server_list

This is my first iControl script and I am havein a little problem. I can not for the life of me get any output from the script. But if I run the script in SOAP Debug mode it look like the system is getting the output. Below is my script any help would be great. Thanks

!/usr/bin/perl  
   
   
  Returns a list of all nodes on the BigIP  
 -------------------------------------------------------------------  
 SOAP  
 use SOAP::Lite + trace => qw(method debug);  
 use SOAP::Lite;  
   
 -------------------------------------------------------------------  
 $hostname = $ARGV[0];  
 $userid = $ARGV[1];  
 $password = $ARGV[2];  
     
 chomp ($hostname);  
 chomp ($userid);  
 chomp ($password);  
     
 ------------------------------------------------------------------  
  Connect to BigIP  
 ------------------------------------------------------------------  
 sub SOAP::Transport::HTTP::Client::get_basic_credentials  
 {  
   return "$userid" => "$password";  
 }  
 $mont2 = SOAP::Lite  
   -> uri('urn:iControl:ITCMLocalLB/Node')  
   -> proxy("https://$hostname/iControl/iControlPortal.cgi");  
     
 $mont2_response = $mont2->get_node_server_list;  
 $output = $mont2_response->result;
  • Loc_Pham_101863's avatar
    Loc_Pham_101863
    Historic F5 Account
    Hi,

    Give this a try:

     ------------------------------------------------------------------------   
       Query Node List    
      ------------------------------------------------------------------------   
      $soap_response = $soap->get_node_server_list();   
          
      if ( $soap_response->fault )   
      {   
        print $soap_response->faultcode, "(faultstring) ", $soap_response->faultstring, "\n";   
        print $soap_response->faultcode, "(faultdetail) ", $soap_response->faultdetail, "\n";   
      }   
      else   
      {   
        print "Available Nodes:\n";   
        my $nodeNumber = 0;   
        my @node_def_list = @{$soap_response->result};   
        foreach my $node_def (@node_def_list)   
        {   
          print "\t[$nodeNumber] = '", $node_def->{"address"}, ":", $node_def->{"port"}, "'\n";   
          $nodeNumber++;   
        }   
      }
  • Loc_Pham_101863's avatar
    Loc_Pham_101863
    Historic F5 Account
    You're welcome. Please let us know your progress or any further question you may have.

     

    Regards.

     

    Loc