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

Virtual machines have moved
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Feb 01 10:43:39 2021 +0000 (2021-02-01)
parents 8176f5915c1e
children cfad9fa3f53c
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 provided 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 \"; print s }' ")?> -
42 <?php system("free | awk '/Mem:/ { x=2*$2-1; while (x >= 1024) { x /= 1024; ".
43 "n++ }; y=1; while (x > 2) { x /= 2; y *= 2}; ".
44 "printf \"%d%cB RAM\",y,substr(\"MG\",n,1) }' ")?> - Located in Paris,
45 France.
46 </p>
47 </div>
48 </div>
50 <!-- Content -->
51 <div id="content">
53 <div align="center"> <?php echo date("r"); ?> </div>
54 <?php
56 $myurl="http://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
58 function one_graphic($img,$name)
59 {
60 echo '<img src="images/rrd/'.$img.'" title="'.
61 $name.'" alt="'.$name.'" />'."\n";
62 }
64 function graphic($res, $img='')
65 {
66 global $myurl;
67 if (!$img) $img=$res;
68 echo "<a name=\"".$res."\"></a>";
69 echo "<a href=\"".$myurl."?stats=".$res."#".$res."\">\n";
70 one_graphic($img."-day.png",$res." daily");
71 echo "</a>";
72 if (isset($_GET['stats']) && $_GET['stats'] == $res) {
73 one_graphic($img."-week.png",$res." weekly");
74 one_graphic($img."-month.png",$res." monthly");
75 one_graphic($img."-year.png",$res." yearly");
76 }
77 }
79 echo "<h2>CPU</h2>\n";
80 graphic("cpu");
81 echo "<h2>Memory</h2>\n";
82 graphic("memory");
83 echo "<h2>Disk</h2>\n";
84 graphic("disk");
85 echo "<h2>Network</h2>\n";
86 $eth = array();
87 exec("/sbin/route -n | awk '{ if (/^0.0.0.0/) print $8 }'", $eth);
88 graphic("net",$eth[0]);
90 ?>
92 <!-- End of content -->
93 </div>
95 <?php include("lib/html/footer.html"); ?>
97 </body>
98 </html>