Forum Discussion

Sung_85708's avatar
Sung_85708
Icon for Nimbostratus rankNimbostratus
Jan 15, 2010

Returning the bandwidth usage for an interface

Is there any command that able to return current bandwidth usage for a given interface or total? I need the LTM able to send out a message if over a specific bandwidth.

 

 

Thanks.

3 Replies

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    Assuming you mean iControl, ye there is.. If you pull the interface counters you can calculate the bandwidth over time. The code to pull the interface counters is something like the one below

     

     

     
       my $Interface = SOAP::Lite 
            -> uri('urn:iControl:Networking/Interfaces') 
            -> proxy("$sProtocol://$icUser:$icPass\@$icServer:$icPort/iControl/iControlPortal.cgi", cookie_jar => $cookieJar); 
      
       HNM (This bit just reads a list of interfaces from a DB) 
       $sql_query{sel_nt_4stat}->execute($devID); 
       while ( my $row = $sql_query{sel_nt_4stat}->fetchrow_hashref()) { 
         dbprint "getNetworkStats: adding interface $row->{name}\n"; 
         push(@nList, $row->{name}); 
       } 
      
       my $soapResponse = $Interface->get_statistics(SOAP::Data->name(interfaces => [@nList])); 
       my ($status, $text)=&checkResponse($soapResponse); 
       $StatList = $soapResponse->result; 
     

     

     

    H
  • Thanks for the reply.

     

    Actually I'm not familiar with iControl, but looks like it's an open API which I can work with the different kinds of language.

     

    If possbile can you give me more info in details regarding your code?

     

     

    Thanks again.
  • Sun, iControl is a web service API to manage BIG-IP devices. We supply the WSDL description files for those services for you to integrate into your client language specific toolkit. For several languages, we've provided libraries that make that step easier. We have library support for .Net, Java, and Python at this time. Using SOAP::Lite in perl if the route we support for perl at this point.

     

     

    Let me know if you have any more specific questions or need pointers for specific language support.

     

     

    -Joe