Forum Discussion

Anthony_Gerace_'s avatar
Anthony_Gerace_
Historic F5 Account
Aug 12, 2004

How to get monitor information ?

I have a customer that is currently using BIG-IP version 4.2, with plans "some day" to go to version 4.5 . Are there any methods available to get detailed information about a specific monitor. I've tried get_use_http method and receive an empty response. Any suggestions?

 

 

Thanks.

 

 

Anthony
  • The support for Monitors in 4.2 is very shaky. The internal Monitor workings changed in 4.5 so we then introduced the Monitor2 interface. Also, in 4.2 there was a feature missing in the ability to query the monitors type. This was added to 4.5 and hasn't been back ported to 4.2. I'll look into the old code base and see if I can find out what is going wrong in your situation and let you know what I find.

     

     

    -Joe
  • Anthony_Gerace_'s avatar
    Anthony_Gerace_
    Historic F5 Account

    Joe, Thanks for the good information regarding v4.2 monitors. I have a project where we have a bunch of monitors that have malformed send strings. I was hoping to be able to script this using the get_use_http method, as the method description (shown below) seems to output the send/get string. In testing I am only receiving the boolean response back. Am I doing something wrong or am I misunderstanding this method? thanks. Anthony

    boolean get_use_http(
        in SessionCredentials creds, <== CORBA Specific
        in String monitor_name,
        out String send_string,
        out String get_string,
        out String recv_string,
        out String user_name,
        out String password );

  • I'm not sure how you are coding things, but for addtitional out parameters in SOAP::Lite you need to use paramsout to get an array of additional parameters.
    $soapResponse = $soap->get_use_http(...);
    $bUseHttp = $soapResponse->result;
    @params = @{$soapResponse->paramsout};
    $send_string = $params[0];
    $get_string = $params[1];
    $recv_string = $params[2];
    $user_name = $params[3];
    $password = $params[4];
    Let me know how this works for you. If not, post some code of what you are doing so I can see if there is anything obvious. -Joe
  • Anthony_Gerace_'s avatar
    Anthony_Gerace_
    Historic F5 Account
    Hi!

    I am attempting to use the get_template_string_property method on version 4.5 to return the send string of a specific monitor and receive nothing back for a send string. What am I doing wrong?

    Thanks for your help.

    Anthony

      
      !/usr/bin/perl   
         
       ----------------------------------------------------------------------------   
         
         
         
      -----------------------------------------------------------------------------   
               Soap   
       use SOAP::Lite + trace => qw(method debug);   
      use SOAP::Lite;   
         
      -----------------------------------------------------------------------------   
        
      ----------------------------------------------------------------------------   
       Validate Arguments   
      ----------------------------------------------------------------------------   
        
      $sHost = $ARGV[0];   
      $sUID  = "a347404";   
        
      $sPWD  = $ARGV[1];   
        
      $sNode = "10.201.95.100:80";   
        
      chomp($sHost);   
      chomp($sPWD);   
      chomp($sNode);   
        
        
      ----------------------------------------------------------------------------   
       Transport Information   
      ----------------------------------------------------------------------------   
      sub SOAP::Transport::HTTP::Client::get_basic_credentials   
      {   
         return "$sUID" => "$sPWD";   
      }   
        
        
      $mont2 = SOAP::Lite   
         -> uri('urn:iControl:ITCMLocalLB/Monitor2')   
         -> proxy("https://$sHost/iControl/iControlPortal.cgi");   
        
      ($address,$port) = split(/\:/,$sNode);   
      $srv->{address} = $address;   
      $srv->{port} = $port;   
      $node_def->{ipport} =$srv;   
      $node_def->{address_type} = 3;   
        
        
      $mont2_response = $mont2->get_monitor_information( 
         SOAP::Data->name(node_definition => $node_def) );   
      $output = $mont2_response->result;   
      $tmp = $output->{monitor_association};   
      $ser = $tmp->{node_definition};   
      $ms = $ser->{ipport};   
      $serv = $ms->{address} . ":" . $ms->{port};   
      @names = @{$tmp->{template_names}};   
      print "Monitor is: @names\n";   
        
        
      $str = "2";   
        
      $mont2_response = $mont2->get_template_string_property(  
          SOAP::Data->name(template_name => $names[0]),  
          SOAP::Data->name(property_type => 1) );   
      if ($mont2_response->fault) {   
          print $mont2_response->faultcode, " ", $mont2_response->faultstring, "\n";   
          exit();   
        }  if display fault   
        
      @sendStr = @{$mont2_response->result};   
      print "Send String is: @sendStr\n";   
        
      $mont2_response = $mont2->get_template_integer_property(  
          SOAP::Data->name(template_name => $names[0]),  
          SOAP::Data->name(property_type => 1) );   
      if ($mont2_response->fault) {   
          print $mont2_response->faultcode, " ", $mont2_response->faultstring, "\n";   
          exit();   
        }  if display fault   
        
      $MonInt = $mont2_response->result;   
      $mont2_response = $mont2->get_template_integer_property(  
          SOAP::Data->name(template_name => $names[0]),  
          SOAP::Data->name(property_type => 2) );   
      $MonTime = $mont2_response->result;   
      print "Monitor @names has interval of: $MonInt and timeout of: $MonTime\n";   
        
      Output:   
      Monitor is: access-http   
      Send String is:   
      Monitor access-http has interval of: 7 and timeout of: 21   
        
      monitor access-http {   
               type http   
              use "http"   
              interval 7   
              timeout 21   
              dest *:*   
              send "GET /index.html HTTP/1.0"   
              recv ""   
              username ""   
              password ""   
      } 

  • The signature for the get_template_string_property is as follows:

     

     

    String get_template_string_property(    
           in String template_name,    
           in StrPropertyType property_type    
       );

     

     

    It states that the returned value is a string. In your code you are casting it to an array.

     

     

    This piece of code looks to be the culprit:

     

     

    $mont2_response = $mont2->get_template_string_property( 
       SOAP::Data->name(template_name => $names[0]), 
       SOAP::Data->name(property_type => 1) );    
       if ($mont2_response->fault) {    
           print $mont2_response->faultcode, " ", $mont2_response->faultstring, "\n";    
           exit();    
         }  if display fault    
          
       @sendStr = @{$mont2_response->result};    
       print "Send String is: @sendStr\n"; 

     

     

    I would change it to the following and see if it works:

     

     

    $mont2_response = $mont2->get_template_string_property(  
        SOAP::Data->name(template_name => $names[0]),  
        SOAP::Data->name(property_type => 1) );    
       if ($mont2_response->fault) {    
           print $mont2_response->faultcode, " ", $mont2_response->faultstring, "\n";    
           exit();    
         }  if display fault    
          
       $sendStr = $mont2_response->result;    
       print "Send String is: $sendStr\n"; 

     

     

    -Joe