Forum Discussion
Hamish
Jan 16, 2010Cirrocumulus
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