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

Update tank & pangolin/graphs
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jan 01 13:42:50 2020 +0100 (2020-01-01)
parents 37fadd188b73
children 9e7953989d74
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://hg.slitaz.org/">Mercurial Repos</a></li>
39 <li><a href="http://cook.slitaz.org/">Build Bot</a></li>
40 <li><a href="http://tank.slitaz.org/">Tank Server</a></li>
41 <li><a href="http://mirror1.slitaz.org/info/">Mirror Server</a></li>
42 </ul>
43 </div>
44 <!-- Information/image -->
45 <div id="block_info">
46 <h4>Codename: pangolin</h4>
47 <p>
48 This is the SliTaz GNU/Linux main server and build host.
49 The server runs naturally SliTaz and provides some services
50 to all contributors such as: secure access, disk space, a
51 public directory or cron jobs.
52 </p>
53 <p>
54 Pangolin CPU is a <?php system("sed -e '/^model name/!d;s/.*Intel(R) //;" .
55 "s/@//;s/(.*)//;s/CPU //;s/.*AMD //;s/.*: //;s/Processor //' </proc/cpuinfo |" .
56 " awk '{ s=$0; n++ } END { if (n == 2) printf \"dual \";" .
57 "if (n == 4) printf \"quad \"; print s }' ")?> -
58 <?php system("free | awk '/Mem:/ { x=2*$2-1; while (x >= 1024) { x /= 1024; ".
59 "n++ }; y=1; while (x > 2) { x /= 2; y *= 2}; ".
60 "printf \"%d%cB RAM\",y,substr(\"MG\",n,1) }' ")?>
61 - Located in Paris,
62 France.
63 </p>
64 </div>
65 </div>
67 <!-- Content -->
68 <div id="content">
70 <div align="center"> <?php echo date("r"); ?> </div>
71 <?php
73 $myurl="http://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
75 function one_graphic($img,$name)
76 {
77 echo '<img src="pics/rrd/'.$img.'" title="'.
78 $name.'" alt="'.$name.'" />'."\n";
79 }
81 function graphic($res, $img='')
82 {
83 global $myurl;
84 if (!$img) $img=$res;
85 echo "<a name=\"".$res."\"></a>";
86 echo "<a href=\"".$myurl."?stats=".$res."#".$res."\">\n";
87 one_graphic($img."-day.png",$res." daily");
88 echo "</a>";
89 if (isset($_GET['stats']) && $_GET['stats'] == $res) {
90 one_graphic($img."-week.png",$res." weekly");
91 one_graphic($img."-month.png",$res." monthly");
92 one_graphic($img."-year.png",$res." yearly");
93 }
94 }
96 echo "<h2>CPU</h2>\n";
97 graphic("cpu");
98 echo "<h2>Memory</h2>\n";
99 graphic("memory");
100 echo "<h2>Disk</h2>\n";
101 graphic("disk");
102 echo "<h2>Network</h2>\n";
103 $eth = array();
104 exec("/sbin/route -n | awk '{ if (/^0.0.0.0/) print $8 }'", $eth);
105 graphic("net",$eth[0]);
107 ?>
109 <!-- End of content -->
110 </div>
112 <!-- Footer -->
113 <div id="footer">
114 Copyright &copy; <span class="year"></span>
115 <a href="http://www.slitaz.org/">SliTaz</a> - Network:
116 <a href="http://scn.slitaz.org/">Community</a>
117 <a href="http://doc.slitaz.org/">Doc</a>
118 <a href="http://forum.slitaz.org/">Forum</a>
119 <a href="http://pkgs.slitaz.org/">Packages</a>
120 <a href="http://bugs.slitaz.org">Bugs</a>
121 <a href="http://hg.slitaz.org/">Hg</a>
122 <p>
123 SliTaz @
124 <a href="http://twitter.com/slitaz">Twitter</a>
125 <a href="http://www.facebook.com/slitaz">Facebook</a>
126 <a href="http://distrowatch.com/slitaz">Distrowatch</a>
127 <a href="http://en.wikipedia.org/wiki/SliTaz">Wikipedia</a>
128 <a href="http://flattr.com/profile/slitaz">Flattr</a>
129 </p>
130 </div>
132 </body>
133 </html>