slitaz-forge view chub/web/graphs.php @ rev 323

tank: fix vhost config
author Christophe Lincoln <pankso@slitaz.org>
date Tue Jul 31 12:36:34 2012 +0200 (2012-07-31)
parents 83836dfbf1da
children c70b14e7ce7d
line source
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <title>Chub RRD stats</title>
6 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
7 <meta name="description" content="slitaz chub rrdtool graphs" />
8 <meta name="robots" content="index, follow, all" />
9 <meta name="author" content="SliTaz Contributors" />
10 <link rel="shortcut icon" href="favicon.ico" />
11 <link rel="stylesheet" type="text/css" href="slitaz.css" />
12 </head>
13 <body>
15 <?php include("lib/html/header.html"); ?>
17 <!-- Block -->
18 <div id="block">
19 <!-- Navigation -->
20 <div id="block_nav">
21 <h4><img src="images/server.png" alt="[ Server ]" />Project servers</h4>
22 <ul>
23 <li><a href="http://tank.slitaz.org/">Tank server</a></li>
24 <li><a href="http://mirror.slitaz.org/">Mirror server</a></li>
25 <li><a href="http://pangolin.slitaz.org/">Pangolin server</a></li>
26 </ul>
27 </div>
28 <!-- Information/image -->
29 <div id="block_info">
30 <h4>Codename: chub</h4>
31 <p>
32 This is the SliTaz GNU/Linux Community HUB server. This
33 virtual machine is gracefully hosted by COSI at Clarkson
34 University <a href="http://cosi.clarkson.edu/">cosi.clarkson.edu</a>
35 </p>
36 <p>
37 Chub CPU is a quad Xeon E5410 2.33GHz - 4GB RAM
38 </p>
39 </div>
40 </div>
42 <!-- Content -->
43 <div id="content">
45 <?php
47 $myurl="http://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
49 function one_graphic($img,$name)
50 {
51 echo '<img src="images/rrd/'.$img.'" title="'.
52 $name.'" alt="'.$name.'" />'."\n";
53 }
55 function graphic($res, $img='')
56 {
57 global $myurl;
58 if (!$img) $img=$res;
59 echo "<a name=\"".$res."\"></a>";
60 echo "<a href=\"".$myurl."?stats=".$res."#".$res."\">\n";
61 one_graphic($img."-day.png",$res." daily");
62 echo "</a>";
63 if (isset($_GET['stats']) && $_GET['stats'] == $res) {
64 one_graphic($img."-week.png",$res." weekly");
65 one_graphic($img."-month.png",$res." monthly");
66 one_graphic($img."-year.png",$res." yearly");
67 }
68 }
70 echo "<h2>CPU</h2>\n";
71 graphic("cpu");
72 echo "<h2>Memory</h2>\n";
73 graphic("memory");
74 echo "<h2>Disk</h2>\n";
75 graphic("disk");
76 echo "<h2>Network</h2>\n";
77 $eth = array();
78 exec("/sbin/route -n | awk '{ if (/^0.0.0.0/) print $8 }'", $eth);
79 graphic("net",$eth[0]);
81 ?>
83 <!-- End of content -->
84 </div>
86 <?php include("lib/html/footer.html"); ?>
88 </body>
89 </html>