Skip to content
Snippets Groups Projects
disk.php 904 B
Newer Older
  • Learn to ignore specific revisions
  • <?	exec("/usr/local/bin/shame.py -a", $Shame);
    	$smarty->assign('title',"The SUCS Hall of Shame");
    
    Thomas Lake's avatar
     
    Thomas Lake committed
    	$o="<div style='text-align: center;'><img src=\"/images/disk.graph.php\" alt=\"pie chart of top 12 disk users\"/></div>";
    
    
    	$o.="<table align=\"center\">\n";
    	$o.="\t<tr><th align=\"center\">User</th><th align=\"center\">Home Directory Size</th></tr>\n";
    
    	for ( $i=1 ; $i < 13 /*(count($Shame) - 1)*/; $i++)
    
    	{
    		list($space, $place, $user, $size) = preg_split("/ +/", $Shame[$i]);
    		if ($size > 0)
    			$o.="\t<tr><td align=\"center\">$user</td><td align=\"center\">${size}B</td></tr>\n";
    	}
    
    	exec("df -h /home",$dfraw);
    	$dfout=explode("  ",$dfraw[1]);
    	$o.="\t<tr><td align=\"center\" colspan=\"2\">".$dfout[8]." used of ".$dfout[7]. " (".$dfout[9]." available)</td></tr>\n";
    
    	$o.="</table>\n";
    	$o.=$Shame[count($Shame) - 1];
    	$o.="<br />\n";
    	//readfile("tail.html");
    	$smarty->assign('body', $o);
    ?>