slitaz-forge diff tank/web/graphs.php @ rev 12
Add tank/web folder.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Wed Feb 23 22:16:38 2011 +0000 (2011-02-23) |
parents | |
children | 08ebcbf62731 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tank/web/graphs.php Wed Feb 23 22:16:38 2011 +0000 1.3 @@ -0,0 +1,125 @@ 1.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 1.5 + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 1.6 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 1.7 +<head> 1.8 + <title>Tank RRD stats</title> 1.9 + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> 1.10 + <meta name="description" content="slitaz tank rrdtool graphs" /> 1.11 + <meta name="robots" content="noindex" /> 1.12 + <meta name="author" content="SliTaz Contributors" /> 1.13 + <link rel="shortcut icon" href="favicon.ico" /> 1.14 + <link rel="stylesheet" type="text/css" href="slitaz.css" /> 1.15 +</head> 1.16 +<body> 1.17 + 1.18 +<!-- Header --> 1.19 +<div id="header"> 1.20 + <a href="http://tank.slitaz.org/"><img id="logo" 1.21 + src="pics/website/logo.png" 1.22 + title="tank.slitaz.org" alt="tank.slitaz.org" /></a> 1.23 + <p id="titre">#!/Tank</p> 1.24 +</div> 1.25 + 1.26 +<!-- Content --> 1.27 +<div id="content-full"> 1.28 + 1.29 +<!-- Block begin --> 1.30 +<div class="block"> 1.31 + <!-- Nav block begin --> 1.32 + <div id="block_nav"> 1.33 + <h3><img src="pics/website/development.png" alt="png" />Devel corner</h3> 1.34 + <ul> 1.35 + <li><a href="http://www.slitaz.org/en/devel/">Website/devel</a></li> 1.36 + <li><a href="http://labs.slitaz.org/">Laboratories</a></li> 1.37 + <li><a href="http://hg.slitaz.org/">Mercurial Repos</a></li> 1.38 + <li><a href="http://bb.slitaz.org/">Build Bot</a></li> 1.39 + <li><a href="http://scn.slitaz.org/">Community Network</a></li> 1.40 + <li><a href="http://people.slitaz.org/">SliTaz People</a></li> 1.41 + </ul> 1.42 + <!-- Nav block end --> 1.43 + </div> 1.44 + <!-- Top block begin --> 1.45 + <div id="block_top"> 1.46 + <h1>Tank RRD stats</h1> 1.47 + <p> 1.48 + This is the SliTaz GNU/Linux main server and build host. The server runs 1.49 + naturally SliTaz (stable) and provides some services to all contributors 1.50 + such as: secure access, disk space, a public directory, cron jobs and the 1.51 + <a href="http://bb.slitaz.org/">Build Bot</a>. 1.52 + </p> 1.53 + <!-- Top block end --> 1.54 + </div> 1.55 +<!-- Block end --> 1.56 +</div> 1.57 + 1.58 +<?php 1.59 + 1.60 +$myurl="http://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']; 1.61 + 1.62 +function one_graphic($img,$name) 1.63 +{ 1.64 + echo '<img src="pics/rrd/'.$img.'" title="'. 1.65 + $name.'" alt="'.$name.'" />'."\n"; 1.66 +} 1.67 + 1.68 +function graphic($res, $img='') 1.69 +{ 1.70 + global $myurl; 1.71 + if (!$img) $img=$res; 1.72 + echo "<a name=\"".$res."\"></a>"; 1.73 + echo "<a href=\"".$myurl."?stats=".$res."#".$res."\">\n"; 1.74 + one_graphic($img."-day.png",$res." daily"); 1.75 + echo "</a>"; 1.76 + if ($_GET['stats'] == $res) { 1.77 + one_graphic($img."-week.png",$res." weekly"); 1.78 + one_graphic($img."-month.png",$res." monthly"); 1.79 + one_graphic($img."-year.png",$res." yearly"); 1.80 + } 1.81 +} 1.82 + 1.83 +echo "<h2>CPU</h2>\n"; 1.84 +graphic("cpu"); 1.85 +echo "<h2>Memory</h2>\n"; 1.86 +graphic("memory"); 1.87 +echo "<h2>Disk</h2>\n"; 1.88 +graphic("disk"); 1.89 +echo "<h2>Network</h2>\n"; 1.90 +$eth = array(); 1.91 +exec("/sbin/route -n | awk '{ if (/^0.0.0.0/) print $8 }'", $eth); 1.92 +graphic("net",$eth[0]); 1.93 + 1.94 +?> 1.95 + 1.96 +<!-- End of content --> 1.97 +</div> 1.98 + 1.99 +<!-- Footer --> 1.100 +<div id="footer"> 1.101 + <div class="right_box"> 1.102 + <h4>SliTaz Network</h4> 1.103 + <ul> 1.104 + <li><a href="http://doc.slitaz.org/">Documentation</a></li> 1.105 + <li><a href="http://forum.slitaz.org/">Support Forum</a></li> 1.106 + <li><a href="http://scn.slitaz.org/">Community Network</a></li> 1.107 + <li><a href="http://labs.slitaz.org/">Laboratories</a></li> 1.108 + <li><a href="http://twitter.com/slitaz">SliTaz on Twitter</a></li> 1.109 + <li><a href="http://distrowatch.com/slitaz">SliTaz on DistroWatch</a></li> 1.110 + </ul> 1.111 + </div> 1.112 + <h4>SliTaz Website</h4> 1.113 + <ul> 1.114 + <li><a href="#header">Top of the page</a></li> 1.115 + <li>Copyright © <?php echo date('Y'); ?> 1.116 + <a href="http://www.slitaz.org/">SliTaz</a></li> 1.117 + <li><a href="http://www.slitaz.org/en/about/">About the project</a></li> 1.118 + <li><a href="http://www.slitaz.org/netmap.php">Network Map</a></li> 1.119 + <li>Page modified the <?php echo (date( "d M Y", getlastmod())); ?></li> 1.120 + <li><a href="http://validator.w3.org/check?uri=referer"><img 1.121 + src="pics/website/xhtml10.png" alt="Valid XHTML 1.0" 1.122 + title="Code validé XHTML 1.0" 1.123 + style="width: 80px; height: 15px; vertical-align: middle;" /></a></li> 1.124 + </ul> 1.125 +</div> 1.126 + 1.127 +</body> 1.128 +</html>