slitaz-forge view tank/web/graphs.php @ rev 716

mirror/floppies: multi-format support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jul 23 16:41:12 2021 +0000 (2021-07-23)
parents cfad9fa3f53c
children
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>Tank RRD stats</title>
6 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
7 <meta name="description" content="slitaz tank 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 <?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://mirror1.slitaz.org/">Mirror server</a></li>
24 <li><a href="http://pangolin.slitaz.org/">Pangolin server</a></li>
25 </ul>
26 </div>
27 <!-- Information/image -->
28 <div id="block_info">
29 <h4>Codename: tank</h4>
30 <p>
31 This is the SliTaz GNU/Linux main server and build host.
32 The server runs naturally SliTaz and provides some services
33 to all contributors such as: secure access, disk space, a
34 public directory or cron jobs. The virtual machine is gracefully hosted by
35 <a href="https://www.linkedin.com/company/balinor-technologies/">balinor-technologies</a>.
36 </p>
37 <p>
38 Tank CPU is a <?php system("sed -e '/^model name/!d;s/.*Intel(R) //;" .
39 "s/@//;s/(.*)//;s/CPU //;s/.*AMD //;s/.*: //;s/Processor //' </etc/cpuinfo |" .
40 " awk '{ s=$0; n++ } END { if (n == 2) printf \"dual \";" .
41 "if (n == 4) printf \"quad \"; if (n == 8) printf \"octo \"; print s }' ")?> -
42 <?php system("free -g | awk '/Mem:/ { print $2 \"GB RAM\" }'")?> -
43 Located in Paris, France.
44 </p>
45 </div>
46 </div>
48 <!-- Content -->
49 <div id="content">
51 <div align="center"> <?php echo date("r"); ?> </div>
52 <?php
54 $myurl="http://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
56 function one_graphic($img,$name)
57 {
58 echo '<img src="images/rrd/'.$img.'" title="'.
59 $name.'" alt="'.$name.'" />'."\n";
60 }
62 function graphic($res, $img='')
63 {
64 global $myurl;
65 if (!$img) $img=$res;
66 echo "<a name=\"".$res."\"></a>";
67 echo "<a href=\"".$myurl."?stats=".$res."#".$res."\">\n";
68 one_graphic($img."-day.png",$res." daily");
69 echo "</a>";
70 if (isset($_GET['stats']) && $_GET['stats'] == $res) {
71 one_graphic($img."-week.png",$res." weekly");
72 one_graphic($img."-month.png",$res." monthly");
73 one_graphic($img."-year.png",$res." yearly");
74 }
75 }
77 echo "<h2>CPU</h2>\n";
78 graphic("cpu");
79 echo "<h2>Memory</h2>\n";
80 graphic("memory");
81 echo "<h2>Disk</h2>\n";
82 graphic("disk");
83 echo "<h2>Network</h2>\n";
84 $eth = array();
85 exec("/sbin/route -n | awk '{ if (/^0.0.0.0/) print $8 }'", $eth);
86 graphic("net",$eth[0]);
88 ?>
90 <!-- End of content -->
91 </div>
93 <?php include("lib/html/footer.html"); ?>
95 </body>
96 </html>