| DOMAIN | IP | USER | QUOTA__ | USED__ | PCT_ | PACKAGE | '; $output.= 'THEME | RESELLER | WARNING | '; $output.= '",$valuer);
$Accounts = array();
array_push($Accounts,$rec);
$domain = trim(strip_tags($Accounts[0][1]));
if ($domain!=''){
$ip= trim(strip_tags($Accounts[0][2]));
$client = trim(strip_tags($Accounts[0][3]));
$email = trim(strip_tags($Accounts[0][4]));
$cdate = trim(strip_tags($Accounts[0][5]));
$chome = trim(strip_tags($Accounts[0][6]));
$quota = trim(strip_tags($Accounts[0][7]));
$spaceUsed = trim(strip_tags($Accounts[0][8]));
$package = trim(strip_tags($Accounts[0][9]));
$theme = trim(strip_tags($Accounts[0][10]));
$reseller = trim(strip_tags($Accounts[0][11]));
// calculated variables
$firstSpace = strpos($spaceUsed," ");
($firstSpace == 0 ? $mbused = 0 : $mbused = trim(substr($spaceUsed,0,$firstSpace)));//*1024);
$firstSpace = strpos($quota," ");
($firstSpace == 0 ? $mbQuota = 0 : $mbQuota = trim(substr($quota,0,$firstSpace)));//*1024);
($mbused == 0 ? $mbpercent = 0 : $mbpercent = ($mbused/$mbQuota)*100);
($mbpercent < $mbHigh ? $warning = "OK": $warning ="ALERT");
if ($mbpercent<10){
$bwpercent='0'.(int) $mbpercent.'%';
} else {
$bwpercent=(int) $mbpercent.'%';
}
$totalMB += $mbused;
if ($warning == "ALERT")
echo "ALERT: $domain Actual/Allocated=$mbused/$mbQuota (".(int) $mbpercent."%) Email:$email "; $output.=sprintf(" |
| %s | %s | %s | %s | %05d | %05d | %02d%% | %s | %s | %s | %s |
| Domain___________________ | '; $output.= 'Actual BW | Quota BW | '; $output.= 'PCT% | WARNING | '; $output.= '",$line);
$loc = strpos($rec[0],'value="');
$endloc = strpos($rec[0],'"',$loc+7);
$bwlimit = substr($rec[0],$loc+7,$endloc-$loc-7);
$bwpct = 0;
if ($bwlimit>0 and $bwactual>0){
$bwpct = ($bwactual*100)/$bwlimit;
}
($bwpct < $bwHigh ? $warning = "OK": $warning ="ALERT");
if ((int) $bwpct<10){
$bwpercent='0'.(int) $bwpct.'%';
} else {
$bwpercent=(int) $bwpct.'%';
}
if ($warning=="ALERT")
echo ("$domain Bandwidth ALERT $bwactual/$bwlimit (".(int) $bwpct."%) email:$emailList[$i] "); $output.=sprintf(" | %05d | %02d%% | %s | ",$bwlimit,$bwpercent,$warning); $totalBW+=$bwactual; $bwCount++; } elseif ((strpos($line,'meg'))) { $rec = split("",$line); $tempit = strip_tags($rec[0]); $loc = strpos($tempit,' meg'); $bwactual = trim(substr($tempit,1,$loc-1)); $output.=sprintf(" |
| %s | %05d | ",$domain,$bwactual); } elseif ((strpos($line,'name="user"'))) { $rec = split("",$line); $tempit = strip_tags($rec[0]); $loc = strpos($tempit," [$domainlist[$i]"); $domain = ltrim(substr($tempit,1,$loc-1)); } } } } $output.=' |