slitaz-forge view pangolin/web/graphs.php @ rev 578

Main mirror is mirror1.slitaz.org (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Sep 26 17:50:22 2014 +0200 (2014-09-26)
parents 224ad32edb21
children 5091de3dc58d
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>Pangolin RRD stats</title>
6 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
7 <meta name="description" content="slitaz pangolin rrdtool graphs" />
8 <meta name="robots" content="noindex" />
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 Pangolin</a></h1>
28 </div>
30 <!-- Block -->
31 <div id="block">
32 <!-- Navigation -->
33 <div id="block_nav">
34 <h4><img src="images/development.png" alt="development.png" />Developers Corner</h4>
35 <ul>
36 <li><a href="http://www.slitaz.org/en/devel/">Website devel</a></li>
37 <li><a href="http://scn.slitaz.org/">Community</a></li>
38 <li><a href="http://labs.slitaz.org/">Laboratories</a></li>
39 <li><a href="http://hg.slitaz.org/">Mercurial Repos</a></li>
40 <li><a href="http://cook.slitaz.org/">Build Bot</a></li>
41 <li><a href="http://tank.slitaz.org/">Tank Server</a></li>
42 <li><a href="http://mirror1.slitaz.org/info/">Mirror Server</a></li>
43 </ul>
44 </div>
45 <!-- Information/image -->
46 <div id="block_info">
47 <h4>Codename: pangolin</h4>
48 <p>
49 This is the SliTaz GNU/Linux main server and build host.
50 The server runs naturally SliTaz and provides some services
51 to all contributors such as: secure access, disk space, a
52 public directory or cron jobs.
53 </p>
54 <p>
55 Pangolin CPU is a <?php system("sed -e '/^model name/!d;s/.*Intel(R) //;" .
56 "s/@//;s/(.*)//;s/CPU //;s/.*AMD //;s/.*: //;s/Processor //' </proc/cpuinfo |" .
57 " awk '{ s=$0; n++ } END { if (n == 2) printf \"dual \";" .
58 "if (n == 4) printf \"quad \"; print s }' ")?> -
59 <?php system("free | awk '/Mem:/ { x=2*$2-1; while (x >= 1024) { x /= 1024; ".
60 "n++ }; y=1; while (x > 2) { x /= 2; y *= 2}; ".
61 "printf \"%d%cB RAM\",y,substr(\"MG\",n,1) }' ")?>
62 - Located in Paris,
63 France.
64 </p>
65 </div>
66 </div>
68 <!-- Content -->
69 <div id="content">
71 <div align="center"> <?php echo date("r"); ?> </div>
72 <?php
74 $myurl="http://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
76 function one_graphic($img,$name)
77 {
78 echo '<img src="pics/rrd/'.$img.'" title="'.
79 $name.'" alt="'.$name.'" />'."\n";
80 }
82 function graphic($res, $img='')
83 {
84 global $myurl;
85 if (!$img) $img=$res;
86 echo "<a name=\"".$res."\"></a>";
87 echo "<a href=\"".$myurl."?stats=".$res."#".$res."\">\n";
88 one_graphic($img."-day.png",$res." daily");
89 echo "</a>";
90 if (isset($_GET['stats']) && $_GET['stats'] == $res) {
91 one_graphic($img."-week.png",$res." weekly");
92 one_graphic($img."-month.png",$res." monthly");
93 one_graphic($img."-year.png",$res." yearly");
94 }
95 }
97 echo "<h2>CPU</h2>\n";
98 graphic("cpu");
99 echo "<h2>Memory</h2>\n";
100 graphic("memory");
101 echo "<h2>Disk</h2>\n";
102 graphic("disk");
103 echo "<h2>Network</h2>\n";
104 $eth = array();
105 exec("/sbin/route -n | awk '{ if (/^0.0.0.0/) print $8 }'", $eth);
106 graphic("net",$eth[0]);
108 ?>
110 <!-- End of content -->
111 </div>
113 <!-- Footer -->
114 <div id="footer">
115 Copyright &copy; <span class="year"></span>
116 <a href="http://www.slitaz.org/">SliTaz</a> - Network:
117 <a href="http://scn.slitaz.org/">Community</a>
118 <a href="http://doc.slitaz.org/">Doc</a>
119 <a href="http://forum.slitaz.org/">Forum</a>
120 <a href="http://pkgs.slitaz.org/">Packages</a>
121 <a href="http://bugs.slitaz.org">Bugs</a>
122 <a href="http://hg.slitaz.org/">Hg</a>
123 <p>
124 SliTaz @
125 <a href="http://twitter.com/slitaz">Twitter</a>
126 <a href="http://www.facebook.com/slitaz">Facebook</a>
127 <a href="http://distrowatch.com/slitaz">Distrowatch</a>
128 <a href="http://en.wikipedia.org/wiki/SliTaz">Wikipedia</a>
129 <a href="http://flattr.com/profile/slitaz">Flattr</a>
130 </p>
131 </div>
133 </body>
134 </html>