Hi,
I try to run scheduled script every day to collect all servers traffic data into our internal database and I always get this error (not immediately):
Output example:
--------------------------
[SKIP]
Traffic usage for: Server1
Current 17MB
Allowed 2000MB
Percents 1%
Traffic usage for: Server2
Current 393MB
Allowed 2000MB
Percents 20%
Fatal error: SOAP Fault: (faultcode: s:Client, faultstring: An error occurred while processing your request for bandwidth. Please try again later.) in /var/www/stats/theplanet/monthly_traffic.php on line 22
---------------------------
Output end
I'm using simple PHP script:
--- SCRIPT START ----
function get_monthly_traffic($hw_id, $hw_label)
{
$paramsurl = array(
'login' => 'my_user',
'password' => 'my_pass'
);
$params = array(
"HardwareID" => $hw_id,
"MonthDate" => date('Y-m-d')
);
$wsdl_url = 'https://api.theplanet.com/Svc/HardwareBandwidthService.svc?WSDL';
try
{
$bw_svc = new SoapClient($wsdl_url, $paramsurl);
$traffic = $bw_svc->GetBandwidthByMonth(new SoapParam($params, "params"));
} catch (SoapFault $fault) {
trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
}
$current = $traffic->ActualUsage;
$allowed = $traffic->AllowedUsage;
do_something_with_data();
}
--- SCRIPT END ----
I already tried to add 10 sec sleep interval between each request - but that's doesn't help.
Any ideas?
Thanks
Mantas
