2010-02-07 14:17:02 +00:00
< ? php
2009-05-11 13:58:05 +00:00
2010-02-13 07:40:43 +00:00
$temp = mysql_result ( mysql_query ( " select count(*) from temperature WHERE device_id = ' " . $device [ 'device_id' ] . " ' " ), 0 );
2009-05-11 13:58:05 +00:00
$storage = mysql_result ( mysql_query ( " select count(*) from storage WHERE host_id = ' " . $device [ 'device_id' ] . " ' " ), 0 );
$cemp = mysql_result ( mysql_query ( " select count(*) from cempMemPool WHERE device_id = ' " . $device [ 'device_id' ] . " ' " ), 0 );
2009-11-10 14:15:32 +00:00
$cmp = mysql_result ( mysql_query ( " select count(*) from cmpMemPool WHERE device_id = ' " . $device [ 'device_id' ] . " ' " ), 0 );
2009-11-09 15:52:04 +00:00
$hrprocessor = mysql_result ( mysql_query ( " select count(*) from hrDevice WHERE device_id = ' " . $device [ 'device_id' ] . " ' AND `hrDeviceType` = 'hrDeviceProcessor' " ), 0 );
2010-02-13 21:45:39 +00:00
$processor = mysql_result ( mysql_query ( " select count(*) from processors WHERE device_id = ' " . $device [ 'device_id' ] . " ' " ), 0 );
2010-02-13 07:40:43 +00:00
$fans = mysql_result ( mysql_query ( " select count(*) from fanspeed WHERE device_id = ' " . $device [ 'device_id' ] . " ' " ), 0 );
$volts = mysql_result ( mysql_query ( " select count(*) from voltage WHERE device_id = ' " . $device [ 'device_id' ] . " ' " ), 0 );
2009-11-09 15:52:04 +00:00
2010-01-09 02:05:47 +00:00
if ( $temp ) { $datas [] = 'temp' ; }
if ( $storage ) { $datas [] = 'storage' ; }
if ( $cemp ) { $datas [] = 'cemp' ; }
if ( $cmp ) { $datas [] = 'cmp' ; }
if ( $hrprocessor ) { $datas [] = 'hrprocessors' ; }
2010-02-13 21:45:39 +00:00
if ( $processor ) { $datas [] = 'processors' ; }
2010-02-12 00:01:00 +00:00
if ( $fans ) { $datas [] = 'fanspeeds' ; }
if ( $volts ) { $datas [] = 'voltages' ; }
2009-11-09 15:52:04 +00:00
2009-05-11 13:58:05 +00:00
$type_text [ 'temp' ] = " Temperatures " ;
2009-11-10 14:15:32 +00:00
$type_text [ 'cmp' ] = " Memory Pools " ;
$type_text [ 'cemp' ] = " Memory Enh Pools " ;
2009-05-11 13:58:05 +00:00
$type_text [ 'storage' ] = " Disk Usage " ;
2009-11-09 15:52:04 +00:00
$type_text [ 'hrprocessors' ] = " Processor Usage " ;
2010-02-13 21:45:39 +00:00
$type_text [ 'processors' ] = " Processor Usage " ;
2010-02-12 00:01:00 +00:00
$type_text [ 'voltages' ] = " Voltages " ;
$type_text [ 'fanspeeds' ] = " Fanspeeds " ;
2009-11-09 15:52:04 +00:00
2009-05-11 13:58:05 +00:00
2010-01-09 02:05:47 +00:00
print_optionbar_start ();
unset ( $sep );
foreach ( $datas as $type ) {
if ( ! $_GET [ 'opta' ]) { $_GET [ 'opta' ] = $type ; }
echo ( $sep );
if ( $_GET [ 'opta' ] == $type ) { echo ( " <strong> " ); }
echo ( " <a href=' " . $config [ 'base_url' ] . " /device/ " . $device [ 'device_id' ] . " /health/ " . $type . " /'> " . $type_text [ $type ] . " </a> \n " );
if ( $_GET [ 'opta' ] == $type ) { echo ( " </strong> " ); }
$sep = ' | ' ;
}
unset ( $sep );
2009-08-07 16:10:52 +00:00
2010-01-09 02:05:47 +00:00
print_optionbar_end ();
2009-05-11 13:58:05 +00:00
2010-01-09 02:05:47 +00:00
if ( is_file ( " pages/device/health/ " . mres ( $_GET [ 'opta' ]) . " .inc.php " )) { include ( " pages/device/health/ " . mres ( $_GET [ 'opta' ]) . " .inc.php " ); }
2009-05-11 13:58:05 +00:00
?>