rev |
line source |
al@602
|
1 <!DOCTYPE html>
|
al@602
|
2 <html lang="en">
|
pankso@157
|
3 <head>
|
al@602
|
4 <meta charset="UTF-8">
|
pankso@157
|
5 <title>Mirror RRD stats</title>
|
al@602
|
6 <meta name="description" content="slitaz mirror rrdtool graphs">
|
al@602
|
7 <meta name="robots" content="noindex">
|
al@602
|
8 <meta name="author" content="SliTaz Contributors">
|
al@602
|
9 <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
al@602
|
10 <link rel="shortcut icon" href="/static/favicon.ico">
|
al@602
|
11 <link rel="stylesheet" type="text/css" href="/static/slitaz.min.css">
|
pankso@157
|
12 </head>
|
pankso@157
|
13 <body>
|
pankso@157
|
14
|
al@602
|
15 <script>
|
al@602
|
16 document.documentElement.className += (("ontouchstart" in document.documentElement) ? ' touch' : ' no-touch');
|
al@602
|
17 </script>
|
al@602
|
18
|
al@602
|
19 <header>
|
al@602
|
20 <h1><a href="http://<?php echo $_SERVER["HTTP_HOST"]; ?>/">SliTaz <?php
|
al@602
|
21 $host=preg_replace('/(\w+).*/i','$1',$_SERVER["HTTP_HOST"]); echo $host; ?></a></h1>
|
al@602
|
22 <div class="network">
|
al@602
|
23 <a href="http://www.slitaz.org/" class="home"></a>
|
pankso@157
|
24 <a href="http://scn.slitaz.org/">Community</a>
|
pankso@184
|
25 <a href="http://doc.slitaz.org/">Doc</a>
|
pankso@184
|
26 <a href="http://forum.slitaz.org/">Forum</a>
|
al@602
|
27 <a href="http://bugs.slitaz.org/">Bugs</a>
|
pascal@343
|
28 <a href="http://hg.slitaz.org/?sort=lastchange">Hg</a>
|
pankso@184
|
29 <a href="http://cook.slitaz.org/">Cook</a>
|
pankso@157
|
30 </div>
|
al@602
|
31 </header>
|
pankso@157
|
32
|
pankso@157
|
33 <!-- Block -->
|
al@602
|
34 <div class="block"><div>
|
al@602
|
35
|
pankso@157
|
36 <!-- Information/image -->
|
al@602
|
37 <div class="block_info">
|
al@602
|
38 <header>Codename: <?php echo $host; ?></header>
|
pankso@157
|
39 </p>
|
pascal@714
|
40 <p>This is the SliTaz GNU/Linux main mirror. The server runs naturally
|
pascal@714
|
41 SliTaz (stable) in a virtual machine provided by
|
pascal@714
|
42 <a href="https://www.linkedin.com/company/balinor-technologies/">balinor-technologies</a>.</p>
|
pankso@157
|
43 <p>
|
al@602
|
44 Mirror CPU is a <?php
|
al@602
|
45 system("( sed '/cpuinfo=/!d;" .
|
pascal@714
|
46 "s/.*cpuinfo=\\([^ ]*\).*/: \\1/;s/_/ /g' /proc/cmdline ; grep '^model name' /etc/cpuinfo) | sed -e 's/.*Intel(R) //;" .
|
al@602
|
47 "s/@//;s/(.*)//;s/CPU //;s/.*AMD //;s/.*: //;s/Processor //;q' |" .
|
al@602
|
48 " awk '{ s=$0; n++ } END { if (n == 2) printf \"dual \";" .
|
al@602
|
49 "if (n == 4) printf \"quad \"; print s }' ")
|
al@602
|
50 ?> - <?php
|
al@602
|
51 system("free | awk '/Mem:/ { x=2*$2-1; while (x >= 1024) { x /= 1024; ".
|
al@602
|
52 "n++ }; y=1; while (x > 2) { x /= 2; y *= 2}; ".
|
al@602
|
53 "printf \"%d%cB RAM\",y,substr(\"MG\",n,1) }' ")
|
pascal@714
|
54 ?> - Located in France.
|
pascal@714
|
55 This page has real time statistics provided by PHP
|
al@602
|
56 <code>system()</code>.
|
al@602
|
57 Mirror is monitored by RRDtool which provides graphical stats.
|
pankso@157
|
58 </p>
|
pankso@157
|
59 </div>
|
al@602
|
60
|
al@602
|
61 <!-- Navigation -->
|
al@602
|
62 <nav>
|
al@602
|
63 <header>Project servers</header>
|
al@602
|
64 <ul>
|
al@602
|
65 <li><a href="http://tank.slitaz.org/">Tank server</a></li>
|
al@602
|
66 <li><a href="http://pangolin.slitaz.org/">Pangolin server</a></li>
|
al@602
|
67 </ul>
|
al@602
|
68 </nav>
|
al@602
|
69 </div></div>
|
pankso@157
|
70
|
pankso@157
|
71 <!-- Content -->
|
al@602
|
72 <main>
|
pankso@157
|
73
|
al@602
|
74 <p style="text-align:center">Server date: <?php echo date("r"); ?> </p>
|
pankso@157
|
75 <?php
|
pankso@157
|
76
|
pankso@157
|
77 $myurl="http://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
|
pankso@157
|
78
|
pankso@157
|
79 function one_graphic($img,$name)
|
pankso@157
|
80 {
|
al@602
|
81 echo '<img src="pics/rrd/' . $img . '" title="' .
|
al@602
|
82 $name . '" alt="' . $name . '"/>';
|
pankso@157
|
83 }
|
pankso@157
|
84
|
pankso@157
|
85 function graphic($res, $img='')
|
pankso@157
|
86 {
|
pankso@157
|
87 global $myurl;
|
pankso@157
|
88 if (!$img) $img=$res;
|
al@602
|
89 echo "<div class=\"large\"><a name=\"" . $res . "\" href=\"" . $myurl . "?stats=" . $res . "#" . $res . "\">\n";
|
pankso@157
|
90 one_graphic($img."-day.png",$res." daily");
|
al@602
|
91 echo "</a></div>\n";
|
pascal@319
|
92 if (isset($_GET['stats']) && $_GET['stats'] == $res) {
|
al@602
|
93 echo "<div class=\"large\">";
|
pankso@157
|
94 one_graphic($img."-week.png",$res." weekly");
|
al@602
|
95 echo "</div>\n<div class=\"large\">";
|
pankso@157
|
96 one_graphic($img."-month.png",$res." monthly");
|
al@602
|
97 echo "</div>\n<div class=\"large\">";
|
pankso@157
|
98 one_graphic($img."-year.png",$res." yearly");
|
al@602
|
99 echo "</div>\n";
|
pankso@157
|
100 }
|
pankso@157
|
101 }
|
pankso@157
|
102
|
al@602
|
103 echo "\n\n<h2>CPU</h2>\n";
|
pankso@157
|
104 graphic("cpu");
|
al@602
|
105 echo "\n\n<h2>Memory</h2>\n";
|
pankso@157
|
106 graphic("memory");
|
al@602
|
107 echo "\n\n<h2>Disk</h2>\n";
|
pankso@157
|
108 graphic("disk");
|
al@602
|
109 echo "\n\n<h2>Network</h2>\n";
|
pankso@157
|
110 $eth = array();
|
pankso@157
|
111 exec("/sbin/route -n | awk '{ if (/^0.0.0.0/) print $8 }'", $eth);
|
pankso@157
|
112 graphic("net",$eth[0]);
|
pankso@157
|
113
|
pankso@157
|
114 ?>
|
pankso@157
|
115
|
pankso@157
|
116 <!-- End of content -->
|
al@602
|
117 </main>
|
pankso@157
|
118
|
pankso@183
|
119 <!-- Footer -->
|
pascal@358
|
120
|
pascal@568
|
121 <script type="text/javascript">
|
pascal@568
|
122 function QRCodePNG(str, obj) {
|
pascal@568
|
123 try {
|
pascal@570
|
124 obj.height = obj.width += 300;
|
pascal@568
|
125 return QRCode.generatePNG(str, {ecclevel: 'H'});
|
pascal@568
|
126 }
|
pascal@568
|
127 catch (any) {
|
pascal@568
|
128 var element = document.createElement("script");
|
al@602
|
129 element.src = "/static/qrcode.min.js";
|
al@602
|
130 element.type ="text/javascript";
|
pascal@568
|
131 element.onload = function() {
|
pascal@568
|
132 obj.src = QRCode.generatePNG(str, {ecclevel: 'H'});
|
pascal@568
|
133 };
|
pascal@568
|
134 document.body.appendChild(element);
|
pascal@568
|
135 }
|
pascal@568
|
136 }
|
pascal@568
|
137 </script>
|
pascal@358
|
138
|
al@602
|
139 <footer>
|
al@602
|
140 <div>
|
al@602
|
141 Copyright © <span class="year"></span>
|
al@602
|
142 <a href="http://www.slitaz.org/">SliTaz</a>
|
al@602
|
143 </div>
|
al@602
|
144 <div>
|
al@602
|
145 Network:
|
al@602
|
146 <a href="http://scn.slitaz.org/">Community</a> ·
|
al@602
|
147 <a href="http://doc.slitaz.org/">Doc</a> ·
|
al@602
|
148 <a href="http://forum.slitaz.org/">Forum</a> ·
|
al@602
|
149 <a href="http://pkgs.slitaz.org/">Packages</a> ·
|
al@602
|
150 <a href="http://boot.slitaz.org/">Boot</a> ·
|
al@602
|
151 <a href="http://bugs.slitaz.org">Bugs</a> ·
|
al@602
|
152 <a href="http://hg.slitaz.org/?sort=lastchange">Hg</a>
|
al@602
|
153 </div>
|
al@602
|
154 <div>
|
al@602
|
155 SliTaz @
|
al@602
|
156 <a href="http://twitter.com/slitaz">Twitter</a> ·
|
al@602
|
157 <a href="http://www.facebook.com/slitaz">Facebook</a> ·
|
al@602
|
158 <a href="http://distrowatch.com/slitaz">Distrowatch</a> ·
|
al@602
|
159 <a href="http://en.wikipedia.org/wiki/SliTaz">Wikipedia</a> ·
|
pankso@183
|
160 <a href="http://flattr.com/profile/slitaz">Flattr</a>
|
al@602
|
161 </div>
|
al@602
|
162 <img src="/static/qr.png" alt="#" onmouseover="this.title = location.href"
|
al@602
|
163 onclick="this.src = QRCodePNG(location.href, this)"/>
|
al@602
|
164 </footer>
|
pankso@157
|
165
|
pankso@157
|
166 </body>
|
pankso@157
|
167 </html>
|