2007-04-04 10:15:07 +00:00
< ? php
$overview = 1 ;
2011-05-15 15:29:47 +00:00
$ports [ 'total' ] = dbFetchCell ( " SELECT COUNT(*) FROM `ports` WHERE device_id = ? " , array ( $device [ 'device_id' ]));
$ports [ 'up' ] = dbFetchCell ( " SELECT COUNT(*) FROM `ports` WHERE device_id = ? AND `ifOperStatus` = 'up' " , array ( $device [ 'device_id' ]));
$ports [ 'down' ] = dbFetchCell ( " SELECT COUNT(*) FROM `ports` WHERE device_id = ? AND `ifOperStatus` = 'down' AND `ifAdminStatus` = 'up' " , array ( $device [ 'device_id' ]));
$ports [ 'disabled' ] = dbFetchCell ( " SELECT COUNT(*) FROM `ports` WHERE device_id = ? AND `ifAdminStatus` = 'down' " , array ( $device [ 'device_id' ]));
2007-04-04 10:15:07 +00:00
2011-05-15 15:29:47 +00:00
$services [ 'total' ] = dbFetchCell ( " SELECT COUNT(service_id) FROM `services` WHERE `device_id` = ? " , array ( $device [ 'device_id' ]));
$services [ 'up' ] = dbFetchCell ( " SELECT COUNT(service_id) FROM `services` WHERE `device_id` = ? AND `service_status` = '1' AND `service_ignore` ='0' " , array ( $device [ 'device_id' ]));
$services [ 'down' ] = dbFetchCell ( " SELECT COUNT(service_id) FROM `services` WHERE `device_id` = ? AND `service_status` = '0' AND `service_ignore` = '0' " , array ( $device [ 'device_id' ]));
$services [ 'disabled' ] = dbFetchCell ( " SELECT COUNT(service_id) FROM `services` WHERE `device_id` = ? AND `service_ignore` = '1' " , array ( $device [ 'device_id' ]));
2007-04-04 10:15:07 +00:00
2011-03-16 23:10:10 +00:00
if ( $services [ 'down' ]) { $services_colour = $warn_colour_a ; } else { $services_colour = $list_colour_a ; }
if ( $ports [ 'down' ]) { $ports_colour = $warn_colour_a ; } else { $ports_colour = $list_colour_a ; }
2007-04-04 10:15:07 +00:00
2011-09-23 16:52:44 +00:00
echo ( " <table width=100% cellspacing=0 cellpadding=0><tr><td style='width: 50%; vertical-align: top;> " );
2007-04-04 10:15:07 +00:00
2011-03-16 23:10:10 +00:00
#if (file_exists("includes/dev-data-" . strtolower($device[os]) . ".inc.php")) {
2007-04-04 10:15:07 +00:00
echo ( " <div style='background-color: #eeeeee; margin: 5px; padding: 5px;'> " );
2007-06-24 14:56:47 +00:00
# echo("<p class=sectionhead>Device Data</p><div style='height: 5px;'></div>");
# include("includes/dev-data-" . strtolower($device[os]) . ".inc.php");
include ( " includes/dev-overview-data.inc.php " );
2007-04-04 10:15:07 +00:00
echo ( " </div> " );
2007-06-24 14:56:47 +00:00
#}
2007-04-04 10:15:07 +00:00
2009-11-11 18:20:32 +00:00
include ( " overview/ports.inc.php " );
2011-05-06 17:43:43 +00:00
#include("overview/current.inc.php");
2007-04-04 10:15:07 +00:00
2011-03-16 23:10:10 +00:00
if ( $services [ 'total' ])
{
2007-04-04 10:15:07 +00:00
echo ( " <div style='background-color: #eeeeee; margin: 5px; padding: 5px;'> " );
2011-09-13 10:22:46 +00:00
echo ( " <p style='padding: 0px 5px 5px;' class=sectionhead><img align='absmiddle' src='images/16/cog.png'> Services</p><div style='height: 5px;'></div> " );
2007-04-04 10:15:07 +00:00
2011-03-16 23:10:10 +00:00
echo ( "
2007-04-04 10:15:07 +00:00
< table class = tablehead cellpadding = 2 cellspacing = 0 width = 100 %>
< tr bgcolor = $services_colour align = center >< td ></ td >
< td width = 25 %>< img src = 'images/16/cog.png' align = absmiddle > $services [ total ] </ td >
< td width = 25 % class = green >< img src = 'images/16/cog_go.png' align = absmiddle > $services [ up ] </ td >
< td width = 25 % class = red >< img src = 'images/16/cog_error.png' align = absmiddle > $services [ down ] </ td >
< td width = 25 % class = grey >< img src = 'images/16/cog_disable.png' align = absmiddle > $services [ disabled ] </ td ></ tr >
</ table > " );
echo ( " <div style='padding: 8px; font-size: 11px; font-weight: bold;'> " );
2011-05-15 15:29:47 +00:00
foreach ( dbFetchRows ( " SELECT * FROM services WHERE device_id = ? ORDER BY service_type " , array ( $device [ 'device_id' ])) as $data )
2011-03-16 23:10:10 +00:00
{
2007-04-04 10:15:07 +00:00
if ( $data [ service_status ] == " 0 " && $data [ service_ignore ] == " 1 " ) { $status = " grey " ; }
if ( $data [ service_status ] == " 1 " && $data [ service_ignore ] == " 1 " ) { $status = " green " ; }
if ( $data [ service_status ] == " 0 " && $data [ service_ignore ] == " 0 " ) { $status = " red " ; }
if ( $data [ service_status ] == " 1 " && $data [ service_ignore ] == " 0 " ) { $status = " blue " ; }
echo ( " $break <a class= $status > " . strtolower ( $data [ service_type ]) . " </a> " );
$break = " , " ;
}
echo ( " </div> " );
2010-02-13 23:55:56 +00:00
echo ( " </div> " );
2007-04-04 10:15:07 +00:00
}
2011-05-15 15:29:47 +00:00
### FIXME - split this into overview/syslog.inc.php?
2011-05-17 22:10:23 +00:00
$syslog = dbFetchRows ( " SELECT *, DATE_FORMAT(timestamp, '%Y-%m-%d %T') AS date from syslog WHERE device_id = ? ORDER BY timestamp DESC LIMIT 20 " , array ( $device [ 'device_id' ]));
2011-09-23 14:36:37 +00:00
if ( count ( $syslog ))
2011-03-16 23:10:10 +00:00
{
2010-06-20 21:37:05 +00:00
echo ( " <div style='background-color: #eeeeee; margin: 5px; padding: 5px;'> " );
2011-09-27 08:46:17 +00:00
echo ( '<p style="padding: 0px 5px 5px;" class="sectionhead"><a class="sectionhead" href="device/device=' . $device [ 'device_id' ] . '/tab=syslog/"><img align="absmiddle" src="images/16/printer.png" /> Recent Syslog</a></p>' );
2010-06-20 21:37:05 +00:00
echo ( " <table cellspacing=0 cellpadding=2 width=100%> " );
2011-05-15 15:29:47 +00:00
foreach ( $syslog as $entry ) { include ( " includes/print-syslog.inc.php " ); }
2010-06-20 21:37:05 +00:00
echo ( " </table> " );
echo ( " </div> " );
}
2011-09-23 16:52:44 +00:00
echo ( " </td> " );
2010-02-13 21:45:39 +00:00
2011-09-23 16:52:44 +00:00
echo ( " <td style='width: 50%; vertical-align: top;'> " );
2010-02-13 21:45:39 +00:00
### Right Pane
include ( " overview/processors.inc.php " );
2010-02-22 00:57:13 +00:00
include ( " overview/mempools.inc.php " );
2010-02-24 02:16:56 +00:00
include ( " overview/storage.inc.php " );
2011-11-14 18:28:00 +00:00
if ( is_array ( $entity_state [ 'group' ][ 'c6kxbar' ])) { include ( " overview/c6kxbar.inc.php " ); }
2010-12-02 16:45:32 +00:00
include ( " overview/sensors/temperatures.inc.php " );
include ( " overview/sensors/humidity.inc.php " );
include ( " overview/sensors/fanspeeds.inc.php " );
include ( " overview/sensors/voltages.inc.php " );
include ( " overview/sensors/current.inc.php " );
2011-04-21 13:25:13 +00:00
include ( " overview/sensors/power.inc.php " );
include ( " overview/sensors/frequencies.inc.php " );
2010-02-13 21:45:39 +00:00
echo ( " <div style='background-color: #eeeeee; margin: 5px; padding: 5px;'> " );
2011-03-23 09:54:56 +00:00
echo ( " <p style='padding: 0px 5px 5px;' class=sectionhead> " );
2011-09-20 16:22:56 +00:00
echo ( '<a class="sectionhead" href="device/device=' . $device [ 'device_id' ] . '/tab=events/">' );
2011-09-13 10:22:46 +00:00
echo ( " <img align='absmiddle' src='images/16/report.png'> Recent Events</a></p> " );
2010-02-13 21:45:39 +00:00
echo ( " <table cellspacing=0 cellpadding=2 width=100%> " );
2011-05-15 15:29:47 +00:00
$eventlog = dbFetchRows ( " SELECT *,DATE_FORMAT(datetime, '%d/%b/%y %T') as humandate FROM `eventlog` WHERE `host` = ? ORDER BY `datetime` DESC LIMIT 0,10 " , array ( $device [ 'device_id' ]));
foreach ( $eventlog as $entry )
2011-03-16 23:10:10 +00:00
{
2011-03-17 16:35:18 +00:00
include ( " includes/print-event-short.inc.php " );
2010-02-13 21:45:39 +00:00
}
echo ( " </table> " );
echo ( " </div> " );
2011-03-16 23:10:10 +00:00
2011-09-23 16:52:44 +00:00
echo ( " </td></tr></table> " );
2011-05-15 15:29:47 +00:00
?>