- Timestamp:
- Sep 2, 2009, 8:51:05 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/index.php
r236 r246 27 27 array('Otvírací doby', '/otevreno.php', 'otv_doby.gif'), 28 28 array('Topologie sítě', '/is/topologie.php', 'topologie.gif'), 29 array('Dostupnost sítě', '/network/dostupnost.php', 'satellite.gif'),30 29 array('Technické informace', '/network.php', 'tech.gif'), 31 30 array('Webkamera', '/webcam/', 'clear.gif'), -
trunk/network.php
r229 r246 119 119 $Output .= '<a href="?section=nastaveni_pripojeni">Nastavení připojení počítačů</a><br />'; 120 120 $Output .= '<a href="?section=obsazeni_wifi_kanalu">Obsazení Wi-Fi kanálů</a><br />'; 121 $Output .= '<a href="network/dostupnost.php">Měření dostupnosti zařízení</a><br />'; 121 122 } 122 123 return($Output); -
trunk/network/dostupnost.php
r217 r246 1 1 <?php 2 2 3 include_once('../global.php'); 3 4 … … 21 22 $Output .= '<br /><table class="WideTable" style="font-size: small;">'; 22 23 $Output .= '<tr><th>Jméno</th><th>Hodina [%]</th><th>Den [%]</th><th>Týden [%]</th><th>Měsíc [%]</th><th>Rok [%]</th></tr>'; 23 $DbResult = $this->Database->query('SELECT NetworkDevice.Type, NetworkDevice.Name, PeriodHour.Percent AS Hour, PeriodDay.Percent AS Day, PeriodWeek.Percent AS Week, PeriodMonth.Percent AS Month, PeriodYear.Percent AS Year FROM NetworkDevice 24 LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 1 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 1 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodHour ON PeriodHour.host_id = NetworkDevice.Id 25 LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodDay ON PeriodDay.host_id = NetworkDevice.Id 26 LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 7 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 7 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodWeek ON PeriodWeek.host_id = NetworkDevice.Id 27 LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 30 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 30 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodMonth ON PeriodMonth.host_id = NetworkDevice.id 28 LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 365 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 365 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodYear ON PeriodYear.host_id = NetworkDevice.Id 29 WHERE NetworkDevice.Used = 1 AND NetworkDevice.Type IN (1, 4, 5) ORDER BY Name'); 30 while($Row = $DbResult->fetch_assoc()) 24 $DbResult = $this->Database->query('SELECT NetworkDevice.Id, NetworkDevice.Type, NetworkDevice.Name FROM NetworkDevice WHERE NetworkDevice.Used = 1 AND NetworkDevice.Type IN (1, 4, 5) ORDER BY Name'); 25 while($Device = $DbResult->fetch_assoc()) 31 26 { 32 $Output .= '<tr><td>'.$Row['Name'].'</td><td style="text-align: right;">'.sprintf('%01.2f', $Row['Hour']).'</td><td style="text-align: right;">'.sprintf('%01.2f', $Row['Day']).'</td><td style="text-align: right;">'.sprintf('%01.2f', $Row['Week']).'</td><td style="text-align: right;">'.sprintf('%01.2f', $Row['Month']).'</td><td style="text-align: right;">'.sprintf('%01.2f', $Row['Year']).'</td></tr>'; 27 $DbResult2 = $this->Database->query('SELECT NetworkInterface.Name, PeriodHour.Percent AS Hour, PeriodDay.Percent AS Day, PeriodWeek.Percent AS Week, PeriodMonth.Percent AS Month, PeriodYear.Percent AS Year FROM NetworkInterface 28 LEFT JOIN (SELECT NetworkInterfaceStat.NetworkInterface, (SUM(NetworkInterfaceStat. PingCount) / 1 / 60 * 100) AS Percent FROM NetworkInterfaceStat WHERE (Time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 1 HOUR)) AND (Time < DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY NetworkInterface) as PeriodHour ON PeriodHour.NetworkInterface = NetworkInterface.Id 29 LEFT JOIN (SELECT NetworkInterfaceStat.NetworkInterface, (SUM(NetworkInterfaceStat.PingCount) / 24 / 60 * 100) AS Percent FROM NetworkInterfaceStat WHERE (Time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 HOUR)) AND (Time < DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY NetworkInterface) AS PeriodDay ON PeriodDay.NetworkInterface = NetworkInterface.Id 30 LEFT JOIN (SELECT NetworkInterfaceStat.NetworkInterface, (SUM(NetworkInterfaceStat.PingCount) / 24 / 7 / 60 * 100) AS Percent FROM NetworkInterfaceStat WHERE (Time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 7 HOUR)) AND (Time < DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY NetworkInterface) AS PeriodWeek ON PeriodWeek.NetworkInterface = NetworkInterface.Id 31 LEFT JOIN (SELECT NetworkInterfaceStat.NetworkInterface, (SUM(NetworkInterfaceStat.PingCount) / 24 / 30 / 60 * 100) AS Percent FROM NetworkInterfaceStat WHERE (Time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 30 HOUR)) AND (Time < DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY NetworkInterface) AS PeriodMonth ON PeriodMonth.NetworkInterface = NetworkInterface.id 32 LEFT JOIN (SELECT NetworkInterfaceStat.NetworkInterface, (SUM(NetworkInterfaceStat.PingCount) / 24 / 365 / 60 * 100) AS Percent FROM NetworkInterfaceStat WHERE (Time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 365 HOUR)) AND (Time < DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY NetworkInterface) AS PeriodYear ON PeriodYear.NetworkInterface = NetworkInterface.Id 33 WHERE NetworkInterface.Device = '.$Device['Id']); 34 while($Interface = $DbResult2->fetch_assoc()) 35 { 36 $Name = $Device['Name']; 37 if($Interface['Name'] != '') $Name .= '-'.$Interface['Name']; 38 $Output .= '<tr><td>'.$Name.'</td><td style="text-align: right;">'.sprintf('%01.2f', $Interface['Hour']).'</td><td style="text-align: right;">'.sprintf('%01.2f', $Interface['Day']).'</td><td style="text-align: right;">'.sprintf('%01.2f', $Interface['Week']).'</td><td style="text-align: right;">'.sprintf('%01.2f', $Interface['Month']).'</td><td style="text-align: right;">'.sprintf('%01.2f', $Interface['Year']).'</td></tr>'; 39 } 33 40 } 34 41 $Output .= '</table></div>';
Note:
See TracChangeset
for help on using the changeset viewer.