| 
									
										
										
										
											2010-02-07 14:17:02 +00:00
										 |  |  | <?php | 
					
						
							| 
									
										
										
										
											2009-05-11 13:58:05 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-24 02:16:56 +00:00
										 |  |  | $storage = mysql_result(mysql_query("select count(*) from storage WHERE device_id = '" . $device['device_id'] . "'"), 0); | 
					
						
							| 
									
										
										
										
											2010-06-19 16:06:57 +00:00
										 |  |  | $diskio = mysql_result(mysql_query("select count(*) from ucd_diskio WHERE device_id = '" . $device['device_id'] . "'"), 0); | 
					
						
							| 
									
										
										
										
											2010-07-28 19:43:02 +00:00
										 |  |  | $mempools = mysql_result(mysql_query("select count(*) from mempools WHERE device_id = '" . $device['device_id'] . "'"), 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-07-07 14:34:44 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | $temperatures = mysql_result(mysql_query("select count(*) from sensors WHERE sensor_class='temperature' AND device_id = '" . $device['device_id'] . "'"), 0); | 
					
						
							|  |  |  | $humidity = mysql_result(mysql_query("select count(*) from sensors WHERE sensor_class='humidity' AND device_id = '" . $device['device_id'] . "'"), 0); | 
					
						
							| 
									
										
										
										
											2010-06-25 23:16:04 +00:00
										 |  |  | $fans = mysql_result(mysql_query("select count(*) from sensors WHERE sensor_class='fanspeed' AND device_id = '" . $device['device_id'] . "'"), 0); | 
					
						
							| 
									
										
										
										
											2010-07-07 13:58:11 +00:00
										 |  |  | $volts = mysql_result(mysql_query("select count(*) from sensors WHERE sensor_class='voltage' AND device_id = '" . $device['device_id'] . "'"), 0); | 
					
						
							| 
									
										
										
										
											2010-07-07 14:34:44 +00:00
										 |  |  | $current = mysql_result(mysql_query("select count(*) from sensors WHERE sensor_class='current' AND device_id = '" . $device['device_id'] . "'"), 0); | 
					
						
							| 
									
										
										
										
											2010-07-30 16:44:59 +00:00
										 |  |  | $freqs = mysql_result(mysql_query("select count(*) from sensors WHERE sensor_class='freq' AND device_id = '" . $device['device_id'] . "'"), 0); | 
					
						
							| 
									
										
										
										
											2009-11-09 15:52:04 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-06-12 16:48:53 +00:00
										 |  |  | $datas[] = 'overview'; | 
					
						
							| 
									
										
										
										
											2011-04-09 13:20:48 +00:00
										 |  |  | if ($processor) { $datas[] = 'processor'; } | 
					
						
							|  |  |  | if ($mempools) { $datas[] = 'mempool'; } | 
					
						
							| 
									
										
										
										
											2010-02-25 00:56:13 +00:00
										 |  |  | if ($storage) { $datas[] = 'storage'; } | 
					
						
							| 
									
										
										
										
											2010-06-19 16:06:57 +00:00
										 |  |  | if ($diskio) { $datas[] = 'diskio'; } | 
					
						
							| 
									
										
										
										
											2011-04-09 13:20:48 +00:00
										 |  |  | if ($temperatures) { $datas[] = 'temperature'; } | 
					
						
							| 
									
										
										
										
											2010-06-23 15:54:56 +00:00
										 |  |  | if ($humidity) { $datas[] = 'humidity'; } | 
					
						
							| 
									
										
										
										
											2011-04-09 13:20:48 +00:00
										 |  |  | if ($fans) { $datas[] = 'fanspeed'; } | 
					
						
							|  |  |  | if ($volts) { $datas[] = 'voltage'; } | 
					
						
							|  |  |  | if ($freqs) { $datas[] = 'frequency'; } | 
					
						
							| 
									
										
										
										
											2010-06-09 20:20:38 +00:00
										 |  |  | if ($current) { $datas[] = 'current'; } | 
					
						
							| 
									
										
										
										
											2009-11-09 15:52:04 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-06-12 16:48:53 +00:00
										 |  |  | $type_text['overview'] = "Overview"; | 
					
						
							| 
									
										
										
										
											2011-04-09 13:20:48 +00:00
										 |  |  | $type_text['temperature'] = "Temperature"; | 
					
						
							| 
									
										
										
										
											2010-06-23 15:54:56 +00:00
										 |  |  | $type_text['humidity'] = "Humidity"; | 
					
						
							| 
									
										
										
										
											2011-04-09 13:20:48 +00:00
										 |  |  | $type_text['mempool'] = "Memory"; | 
					
						
							| 
									
										
										
										
											2009-05-11 13:58:05 +00:00
										 |  |  | $type_text['storage'] = "Disk Usage"; | 
					
						
							| 
									
										
										
										
											2010-07-05 12:29:37 +00:00
										 |  |  | $type_text['diskio'] = "Disk I/O"; | 
					
						
							| 
									
										
										
										
											2011-04-09 13:20:48 +00:00
										 |  |  | $type_text['processor'] = "Processor"; | 
					
						
							|  |  |  | $type_text['voltage'] = "Voltages"; | 
					
						
							|  |  |  | $type_text['fanspeed'] = "Fanspeed"; | 
					
						
							|  |  |  | $type_text['frequency'] = "Frequency"; | 
					
						
							| 
									
										
										
										
											2010-06-09 20:20:38 +00:00
										 |  |  | $type_text['current'] = "Current"; | 
					
						
							| 
									
										
										
										
											2009-11-09 15:52:04 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-09 02:05:47 +00:00
										 |  |  | print_optionbar_start(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-16 23:10:10 +00:00
										 |  |  | if (!$_GET['opta']) { $_GET['opta'] = "overview"; } | 
					
						
							| 
									
										
										
										
											2010-02-24 21:44:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-06-12 16:48:53 +00:00
										 |  |  | unset($sep); | 
					
						
							| 
									
										
										
										
											2011-03-16 23:10:10 +00:00
										 |  |  | foreach ($datas as $type) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-06-12 16:48:53 +00:00
										 |  |  |   echo($sep); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-16 23:10:10 +00:00
										 |  |  |   if ($_GET['opta'] == $type) | 
					
						
							| 
									
										
										
										
											2010-06-18 14:17:58 +00:00
										 |  |  |   { | 
					
						
							| 
									
										
										
										
											2011-04-09 13:20:48 +00:00
										 |  |  |     echo('<span class="pagemenu-selected">'); | 
					
						
							|  |  |  | #    echo('<img src="images/icons/'.$type.'.png" class="optionicon" />');
 | 
					
						
							| 
									
										
										
										
											2010-06-12 16:48:53 +00:00
										 |  |  |   } else { | 
					
						
							| 
									
										
										
										
											2011-04-09 13:20:48 +00:00
										 |  |  | #    echo('<img src="images/icons/greyscale/'.$type.'.png" class="optionicon" />');
 | 
					
						
							| 
									
										
										
										
											2010-06-12 16:48:53 +00:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2011-04-09 13:20:48 +00:00
										 |  |  |   echo("<a href='".$config['base_url']."/device/".$device['device_id']."/health/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $type_text[$type] ."</a>"); | 
					
						
							|  |  |  |   if ($_GET['opta'] == $type) { echo("</span>"); } | 
					
						
							| 
									
										
										
										
											2010-06-12 16:48:53 +00:00
										 |  |  |   $sep = " | "; | 
					
						
							| 
									
										
										
										
											2010-01-09 02:05:47 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-16 23:10:10 +00:00
										 |  |  | if (is_file("pages/device/health/".mres($_GET['opta']).".inc.php")) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |    include("pages/device/health/".mres($_GET['opta']).".inc.php"); | 
					
						
							|  |  |  | } else { | 
					
						
							| 
									
										
										
										
											2011-03-17 00:09:20 +00:00
										 |  |  |   foreach ($datas as $type) | 
					
						
							| 
									
										
										
										
											2011-03-16 23:10:10 +00:00
										 |  |  |   { | 
					
						
							|  |  |  |     if ($type != "overview") | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2010-06-12 16:48:53 +00:00
										 |  |  |       $graph_title = $type_text[$type]; | 
					
						
							|  |  |  |       $graph_type = "device_".$type; | 
					
						
							| 
									
										
										
										
											2011-03-17 16:35:18 +00:00
										 |  |  |       include("includes/print-device-graph.php"); | 
					
						
							| 
									
										
										
										
											2010-06-12 16:48:53 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2010-02-24 21:44:32 +00:00
										 |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2009-05-11 13:58:05 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-09 13:20:48 +00:00
										 |  |  | ?>
 |