| 
									
										
										
										
											2009-09-07 11:07:59 +00:00
										 |  |  | <?php | 
					
						
							| 
									
										
										
										
											2007-04-04 10:15:07 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-05-25 12:24:34 +00:00
										 |  |  | // Graphs are printed in the order they exist in $config['graph_types']
 | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | $link_array = array( | 
					
						
							|  |  |  |     'page'   => 'device', | 
					
						
							|  |  |  |     'device' => $device['device_id'], | 
					
						
							|  |  |  |     'tab'    => 'graphs', | 
					
						
							|  |  |  | ); | 
					
						
							| 
									
										
										
										
											2010-07-31 00:54:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | $bg = '#ffffff'; | 
					
						
							| 
									
										
										
										
											2011-09-18 13:11:04 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | echo '<div style="clear: both;">'; | 
					
						
							| 
									
										
										
										
											2010-01-08 00:01:26 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-18 18:22:07 +00:00
										 |  |  | print_optionbar_start(); | 
					
						
							| 
									
										
										
										
											2010-01-08 00:01:26 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | echo "<span style='font-weight: bold;'>Graphs</span> » "; | 
					
						
							| 
									
										
										
										
											2011-04-30 22:20:11 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | foreach (dbFetchRows('SELECT * FROM device_graphs WHERE device_id = ? ORDER BY graph', array($device['device_id'])) as $graph) { | 
					
						
							|  |  |  |     $section = $config['graph_types']['device'][$graph['graph']]['section']; | 
					
						
							|  |  |  |     if ($section != '') { | 
					
						
							|  |  |  |         $graph_enable[$section][$graph['graph']] = $graph['graph']; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2010-07-31 00:54:51 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-09-21 20:47:32 +01:00
										 |  |  | // These are standard graphs we should have for all systems
 | 
					
						
							|  |  |  | $graph_enable['poller']['poller_perf'] = 'device_poller_perf'; | 
					
						
							| 
									
										
										
										
											2015-10-17 18:49:01 +00:00
										 |  |  | if (can_ping_device($attribs) === true) { | 
					
						
							|  |  |  |     $graph_enable['poller']['ping_perf']   = 'device_ping_perf'; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | $sep = ''; | 
					
						
							|  |  |  | foreach ($graph_enable as $section => $nothing) { | 
					
						
							|  |  |  |     if (isset($graph_enable) && is_array($graph_enable[$section])) { | 
					
						
							|  |  |  |         $type = strtolower($section); | 
					
						
							|  |  |  |         if (!$vars['group']) { | 
					
						
							|  |  |  |             $vars['group'] = $type; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         echo $sep; | 
					
						
							|  |  |  |         if ($vars['group'] == $type) { | 
					
						
							|  |  |  |             echo '<span class="pagemenu-selected">'; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         echo generate_link(ucwords($type), $link_array, array('group' => $type)); | 
					
						
							|  |  |  |         if ($vars['group'] == $type) { | 
					
						
							|  |  |  |             echo '</span>'; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $sep = ' | '; | 
					
						
							| 
									
										
										
										
											2011-04-09 14:45:29 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2007-04-04 10:15:07 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | unset($sep); | 
					
						
							| 
									
										
										
										
											2015-06-13 15:21:58 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-18 03:56:19 +00:00
										 |  |  | print_optionbar_end(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-18 18:22:07 +00:00
										 |  |  | $graph_enable = $graph_enable[$vars['group']]; | 
					
						
							| 
									
										
										
										
											2010-07-18 03:56:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | // foreach ($config['graph_types']['device'] as $graph => $entry)
 | 
					
						
							|  |  |  | foreach ($graph_enable as $graph => $entry) { | 
					
						
							|  |  |  |     $graph_array = array(); | 
					
						
							|  |  |  |     if ($graph_enable[$graph]) { | 
					
						
							|  |  |  |         $graph_title         = $config['graph_types']['device'][$graph]['descr']; | 
					
						
							|  |  |  |         $graph_array['type'] = 'device_'.$graph; | 
					
						
							| 
									
										
										
										
											2007-04-04 10:15:07 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  |         include 'includes/print-device-graph.php'; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2011-10-18 14:27:21 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | $pagetitle[] = 'Graphs'; |