slitaz-forge view chub/web/index.php @ rev 100

chub use PHP for stats
author Christophe Lincoln <pankso@slitaz.org>
date Thu Mar 08 23:25:54 2012 +0100 (2012-03-08)
parents
children f7f74b531def
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>SliTaz Chub</title>
6 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
7 <meta name="description" content="slitaz chub server at COSI" />
8 <meta name="robots" content="index, nofollow" />
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 <!-- Header -->
16 <div id="header">
17 <div id="logo"></div>
18 <div id="network">
19 <a href="http://www.slitaz.org/">
20 <img src="images/network.png" alt="network.png" /></a>
21 <a href="http://scn.slitaz.org/">Community</a>
22 <a href="http://doc.slitaz.org/">Doc</a>
23 <a href="http://forum.slitaz.org/">Forum</a>
24 <a href="http://bugs.slitaz.org">Bugs</a>
25 <a href="http://hg.slitaz.org/">Hg</a>
26 </div>
27 <h1><a href="http://www.slitaz.org/">SliTaz Tank</a></h1>
28 </div>
30 <!-- Block -->
31 <div id="block">
32 <!-- Navigation -->
33 <div id="block_nav">
34 <h4>Project servers</h4>
35 <ul>
36 <li><a href="http://tank.slitaz.org/">Tank</a></li>
37 <li><a href="http://mirror.slitaz.org/">Mirror</a></li>
38 </ul>
39 </div>
40 <!-- Information/image -->
41 <div id="block_info">
42 <h4>Codename: chub</h4>
43 <p>
44 This is the SliTaz GNU/Linux Community HUB server. This
45 virtual machine is gracefuly host by COSI at Clarkson
46 University <a href="http://cosi.clarkson.edu/">cosi.clarkson.edu</a>
47 </p>
48 <p>
49 Tank CPU is a <?php system("sed -e '/^model name/!d;s/.*Intel(R) //;" .
50 "s/@//;s/(.*)//;s/CPU //;s/.*AMD //;s/.*: //;s/Processor //' </proc/cpuinfo |" .
51 " awk '{ s=$0; n++ } END { if (n == 2) printf \"dual \";" .
52 "if (n == 4) printf \"quad \"; print s }' ")?> -
53 <?php system("free | awk '/Mem:/ { x=2*$2-1; while (x >= 1024) { x /= 1024; ".
54 "n++ }; y=1; while (x > 2) { x /= 2; y *= 2}; ".
55 "printf \"%d%cB RAM\",y,substr(\"MG\",n,1) }' ")?>
56 </p>
57 </div>
58 </div>
60 <!-- Content -->
61 <div id="content">
63 <h2>System stats</h2>
65 <h4>Uptime</h4>
67 <pre class="package">
68 <?php
69 system("uptime | sed 's/^\s*//'");
70 ?>
71 </pre>
73 <h4>Disk usage</h4>
74 <pre class="package">
75 <?php
76 system("df -h | sed '/^rootfs/d' | grep '\(^/dev\|Filesystem\)'");
77 ?>
78 </pre>
80 <h4>Network</h4>
81 <pre class="package">
82 <?php
83 system("ifconfig eth0 | awk '{ if (/X packet/ || /X byte/) print }' | sed 's/^\s*//'");
84 ?>
85 </pre>
88 <!-- End of content -->
89 </div>
91 <!-- Footer -->
92 <div id="footer">
93 Copyright &copy; <span class="year"></span>
94 <a href="http://www.slitaz.org/">SliTaz</a> - Network:
95 <a href="http://scn.slitaz.org/">Community</a>
96 <a href="http://doc.slitaz.org/">Doc</a>
97 <a href="http://forum.slitaz.org/">Forum</a>
98 <a href="http://pkgs.slitaz.org/">Packages</a>
99 <a href="http://bugs.slitaz.org">Bugs</a>
100 <a href="http://hg.slitaz.org/">Hg</a>
101 <p>
102 SliTaz @
103 <a href="http://twitter.com/slitaz">Twitter</a>
104 <a href="http://www.facebook.com/slitaz">Facebook</a>
105 <a href="http://distrowatch.com/slitaz">Distrowatch</a>
106 <a href="http://en.wikipedia.org/wiki/SliTaz">Wikipedia</a>
107 <a href="http://flattr.com/profile/slitaz">Flattr</a>
108 </p>
109 </div>
111 </body>
112 </html>