2010-12-03 15:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2012-05-25 12:24:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								// FIXME - this could do with some performance improvements, i think. possible rearranging some tables and setting flags at poller time (nothing changes outside of then anyways)
  
						 
					
						
							
								
									
										
										
										
											2012-04-20 10:36:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-21 08:07:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								use  LibreNMS\ObjectCache ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 12:56:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$service_status    =  get_service_status ();  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								$typeahead_limit   =  $config [ 'webui' ][ 'global_search_result_limit' ];  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								$if_alerts         =  dbFetchCell ( " SELECT COUNT(port_id) FROM `ports` WHERE `ifOperStatus` = 'down' AND `ifAdminStatus` = 'up' AND `ignore` = '0' " );  
						 
					
						
							
								
									
										
										
										
											2011-05-12 20:09:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-03-28 13:08:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $_SESSION [ 'userlevel' ]  >=  5 )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    $links [ 'count' ]         =  dbFetchCell ( " SELECT COUNT(*) FROM `links` " ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  else  {  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    $links [ 'count' ]        =  dbFetchCell ( " SELECT COUNT(*) FROM `links` AS `L`, `devices` AS `D`, `devices_perms` AS `P` WHERE `P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id` AND `L`.`local_device_id` = `D`.`device_id` " ,  array ( $_SESSION [ 'user_id' ])); 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-28 13:08:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( isset ( $config [ 'enable_bgp' ])  &&  $config [ 'enable_bgp' ])  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    $bgp_alerts  =  dbFetchCell ( " SELECT COUNT(bgpPeer_id) FROM bgpPeers AS B where (bgpPeerAdminStatus = 'start' OR bgpPeerAdminStatus = 'running') AND bgpPeerState != 'established' " ); 
							 
						 
					
						
							
								
									
										
										
										
											2010-07-27 20:49:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-03-31 18:08:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( isset ( $config [ 'site_style' ])  &&  ( $config [ 'site_style' ]  ==  'dark'  ||  $config [ 'site_style' ]  ==  'mono' ))  {  
						 
					
						
							
								
									
										
										
										
											2015-03-26 23:51:13 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    $navbar  =  'navbar-inverse' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-15 02:46:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  else  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    $navbar  =  '' ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-26 23:51:13 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-03-26 23:51:13 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< nav  class = " navbar navbar-default <?php echo  $navbar ; ?> navbar-fixed-top "  role = " navigation " >  
						 
					
						
							
								
									
										
										
										
											2014-06-15 01:36:49 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  < div  class = " container-fluid " > 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    < div  class = " navbar-header " > 
							 
						 
					
						
							
								
									
										
										
										
											2014-06-15 01:36:49 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < button  type = " button "  class = " navbar-toggle "  data - toggle = " collapse "  data - target = " #navHeaderCollapse " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        < span  class = " sr-only " > Toggle  navigation </ span > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        < span  class = " icon-bar " ></ span > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        < span  class = " icon-bar " ></ span > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        < span  class = " icon-bar " ></ span > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								      </ button > 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-14 19:40:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $config [ 'title_image' ])  {  
						 
					
						
							
								
									
										
										
										
											2015-08-05 21:00:21 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '<a class="hidden-md hidden-sm navbar-brand" href=""><img src="'  .  $config [ 'title_image' ]  .  '" /></a>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  else  {  
						 
					
						
							
								
									
										
										
										
											2015-08-05 21:00:21 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '<a class="hidden-md hidden-sm navbar-brand" href="">' . $config [ 'project_name' ] . '</a>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2014-01-14 19:40:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-06-15 01:36:49 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    < div  class = " collapse navbar-collapse "  id = " navHeaderCollapse " > 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < ul  class = " nav navbar-nav " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        < li  class = " dropdown " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < a  href = " <?php echo(generate_url(array('page'=>'overview'))); ?> "  class = " dropdown-toggle "  data - hover = " dropdown "  data - toggle = " dropdown " >< i  class = " fa fa-lightbulb-o fa-fw fa-lg fa-nav-icons hidden-md "  aria - hidden = " true " ></ i >  < span  class = " hidden-sm " > Overview </ span ></ a > 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-03 16:43:13 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < ul  class = " dropdown-menu multi-level "  role = " menu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								              < li >< a  href = " <?php echo(generate_url(array('page'=>'overview'))); ?> " >< i  class = " fa fa-lightbulb-o fa-fw fa-lg "  aria - hidden = " true " ></ i >  Overview </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-11 23:41:41 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < li  class = " dropdown-submenu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < a  href = " <?php echo(generate_url(array('page'=>'overview'))); ?> " >< i  class = " fa fa-sitemap fa-fw fa-lg "  aria - hidden = " true " ></ i >  Maps </ a > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-11 23:41:41 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < ul  class = " dropdown-menu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								              < li >< a  href = " <?php echo(generate_url(array('page'=>'availability-map'))); ?> " >< i  class = " fa fa-arrow-circle-up fa-fw fa-lg "  aria - hidden = " true " ></ i >  Availability </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								              < li >< a  href = " <?php echo(generate_url(array('page'=>'map'))); ?> " >< i  class = " fa fa-desktop fa-fw fa-lg "  aria - hidden = " true " ></ i >  Network </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-03 16:43:13 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                < ? php 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    require_once  '../includes/device-groups.inc.php' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    $devices_groups  =  GetDeviceGroups (); 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                if  ( count ( $devices_groups )  >  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                    echo  '<li class="dropdown-submenu"><a href="#"><i class="fa fa-th fa-fw fa-lg" aria-hidden="true"></i> Device Groups Maps</a><ul class="dropdown-menu scrollable-menu">' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                    foreach  ( $devices_groups  as  $group )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                        echo  '<li><a href="' . generate_url ( array ( 'page' => 'map' , 'group' => $group [ 'id' ])) . '" title="' . $group [ 'desc' ] . '"><i class="fa fa-th fa-fw fa-lg" aria-hidden="true"></i> ' . ucfirst ( $group [ 'name' ]) . '</a></li>' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-03 16:43:13 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                    } 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                    unset ( $group ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    echo  '</ul></li>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-03 16:43:13 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                ?> 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-11 23:41:41 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            </ ul > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								          </ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								          < li  class = " dropdown-submenu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < a >< i  class = " fa fa-plug fa-fw fa-lg "  aria - hidden = " true " ></ i >  Plugins </ a > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-11 23:41:41 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < ul  class = " dropdown-menu scrollable-menu " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                < ? php 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                \LibreNMS\Plugins :: call ( 'menu' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                if  ( $_SESSION [ 'userlevel' ]  >=  '10' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    if  ( dbFetchCell ( " SELECT COUNT(*) from `plugins` WHERE plugin_active = '1' " )  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                        echo ( '<li role="presentation" class="divider"></li>' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    } 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                    echo ( '<li><a href="plugin/view=admin"> <i class="fa fa-lock fa-fw fa-lg" aria-hidden="true"></i>Plugin Admin</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-11 23:41:41 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                ?> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            </ ul > 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-18 19:15:23 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          </ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								          < li  class = " dropdown-submenu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < a  href = " <?php echo(generate_url(array('page'=>'overview'))); ?> " >< i  class = " fa fa-wrench fa-fw fa-lg "  aria - hidden = " true " ></ i >  Tools </ a > 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-18 19:15:23 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < ul  class = " dropdown-menu scrollable-menu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < li >< a  href = " <?php echo(generate_url(array('page'=>'ripenccapi'))); ?> " >< i  class = " fa fa-arrow-circle-up fa-fw fa-lg "  aria - hidden = " true " ></ i >  RIPE  NCC  API </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-18 19:15:23 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           </ ul > 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-20 14:25:36 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          </ li > 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-26 03:27:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li  role = " presentation "  class = " divider " ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " <?php echo(generate_url(array('page'=>'eventlog'))); ?> " >< i  class = " fa fa-book fa-fw fa-lg "  aria - hidden = " true " ></ i >  Eventlog </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-10 13:36:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								if  ( isset ( $config [ 'enable_syslog' ])  &&  $config [ 'enable_syslog' ])  {  
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo  '              <li><a href="' . generate_url ( array ( 'page' => 'syslog' )) . '"><i class="fa fa-book fa-fw fa-lg" aria-hidden="true"></i> Syslog</a></li>' ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-10 13:36:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								if  ( isset ( $config [ 'graylog' ][ 'server' ])  &&  isset ( $config [ 'graylog' ][ 'port' ]))  {  
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo  '              <li><a href="' . generate_url ( array ( 'page' => 'graylog' )) . '"><i class="fa fa-book fa-fw fa-lg" aria-hidden="true"></i> Graylog</a></li>' ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-10 13:36:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " <?php echo(generate_url(array('page'=>'inventory'))); ?> " >< i  class = " fa fa-cube fa-fw fa-lg "  aria - hidden = " true " ></ i >  Inventory </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-30 17:59:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( dbFetchCell ( " SELECT 1 from `packages` LIMIT 1 " ))  {  
						 
					
						
							
								
									
										
										
										
											2015-08-30 17:59:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        < li > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < a  href = " <?php echo(generate_url(array('page'=>'search','search'=>'packages'))); ?> " >< i  class = " fa fa-archive fa-fw fa-lg "  aria - hidden = " true " ></ i >  Packages </ a > 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-30 17:59:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        </ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  # if ($packages)
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li  role = " presentation "  class = " divider " ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            < li  role = " presentation "  class = " dropdown-header " >  Search </ li > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " <?php echo(generate_url(array('page'=>'search','search'=>'ipv4'))); ?> " >< i  class = " fa fa-search fa-fw fa-lg "  aria - hidden = " true " ></ i >  IPv4  Search </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " <?php echo(generate_url(array('page'=>'search','search'=>'ipv6'))); ?> " >< i  class = " fa fa-search fa-fw fa-lg "  aria - hidden = " true " ></ i >  IPv6  Search </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " <?php echo(generate_url(array('page'=>'search','search'=>'mac'))); ?> " >< i  class = " fa fa-search fa-fw fa-lg "  aria - hidden = " true " ></ i >  MAC  Search </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " <?php echo(generate_url(array('page'=>'search','search'=>'arp'))); ?> " >< i  class = " fa fa-search fa-fw fa-lg "  aria - hidden = " true " ></ i >  ARP  Tables </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-07 09:25:59 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								if  ( is_module_enabled ( 'poller' ,  'mib' ))  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2015-07-17 13:48:22 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li  role = " presentation "  class = " divider " ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " <?php echo(generate_url(array('page'=>'mibs'))); ?> " >< i  class = " fa fa-file-text-o fa-fw fa-lg "  aria - hidden = " true " ></ i >  MIB  definitions </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-07 09:25:59 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          </ ul > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        </ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        < li  class = " dropdown " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < a  href = " devices/ "  class = " dropdown-toggle "  data - hover = " dropdown "  data - toggle = " dropdown " >< i  class = " fa fa-server fa-fw fa-lg fa-nav-icons hidden-md "  aria - hidden = " true " ></ i >  < span  class = " hidden-sm " > Devices </ span ></ a > 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < ul  class = " dropdown-menu " > 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-16 17:47:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li  class = " dropdown-submenu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								              < a  href = " devices/ " >< i  class = " fa fa-server fa-fw fa-lg "  aria - hidden = " true " ></ i >  All  Devices </ a > 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-16 17:47:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								              < ul  class = " dropdown-menu scrollable-menu " > 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2010-07-30 17:05:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-09-15 02:46:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$param  =  array ();  
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( is_admin ()  ===  true  ||  is_read ()  ===  true )  {  
						 
					
						
							
								
									
										
										
										
											2015-04-22 21:11:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    $sql  =  " SELECT `type`,COUNT(`type`) AS total_type FROM `devices` AS D WHERE 1 GROUP BY `type` ORDER BY `type` " ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  else  {  
						 
					
						
							
								
									
										
										
										
											2015-04-22 21:11:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    $sql  =  " SELECT `type`,COUNT(`type`) AS total_type FROM `devices` AS `D`, `devices_perms` AS `P` WHERE `P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id` GROUP BY `type` ORDER BY `type` " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    $param []  =  $_SESSION [ 'user_id' ]; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								foreach  ( dbFetchRows ( $sql ,  $param )  as  $devtype )  {  
						 
					
						
							
								
									
										
										
										
											2015-02-16 17:47:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( empty ( $devtype [ 'type' ]))  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-10 14:07:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        $devtype [ 'type' ]  =  'generic' ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-16 17:47:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '            <li><a href="devices/type='  .  $devtype [ 'type' ]  .  '/"><i class="fa fa-angle-double-right fa-fw fa-lg" aria-hidden="true"></i> '  .  ucfirst ( $devtype [ 'type' ])  .  '</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2010-07-30 17:05:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2015-04-03 18:22:29 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-02-16 17:47:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        echo  ( ' </ ul > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								             </ li > ' ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( count ( $devices_groups )  >  0 )  {  
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo  '<li class="dropdown-submenu"><a href="#"><i class="fa fa-th fa-fw fa-lg" aria-hidden="true"></i> Device Groups</a><ul class="dropdown-menu scrollable-menu">' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    foreach  ( $devices_groups  as  $group )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        echo  '<li><a href="' . generate_url ( array ( 'page' => 'devices' , 'group' => $group [ 'id' ])) . '" title="' . $group [ 'desc' ] . '"><i class="fa fa-th fa-fw fa-lg" aria-hidden="true"></i> ' . ucfirst ( $group [ 'name' ]) . '</a></li>' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    unset ( $group ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    echo  '</ul></li>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2015-02-16 17:47:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $_SESSION [ 'userlevel' ]  >=  '10' )  {  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( $config [ 'show_locations' ])  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        echo ( ' 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-26 23:51:13 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li  role = " presentation "  class = " divider " ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li  class = " dropdown-submenu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < a  href = " # " >< i  class = " fa fa-map-marker fa-fw fa-lg "  aria - hidden = " true " ></ i >  Locations </ a > 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < ul  class = " dropdown-menu scrollable-menu " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            ' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        if  ( $config [ 'show_locations_dropdown' ])  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            foreach  ( getlocations ()  as  $location )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                echo ( '            <li><a href="devices/location='  .  urlencode ( $location )  .  '/"><i class="fa fa-building-o fa-fw fa-lg" aria-hidden="true"></i> '  .  $location  .  ' </a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        echo ( ' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            </ ul > 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            </ li > 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            ' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-30 18:04:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo  ' 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-07 09:25:59 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li  role = " presentation "  class = " divider " ></ li > ' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( is_module_enabled ( 'poller' ,  'mib' ))  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        echo  ' 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = '.generate_url(array(' page '=>' mib_assoc ')).' >< i  class = " fa fa-file-text-o fa-fw fa-lg "  aria - hidden = " true " ></ i >  MIB  associations </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-06 19:25:24 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li  role = " presentation "  class = " divider " ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-30 18:04:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								         ' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-07 09:25:59 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-30 18:04:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( $config [ 'navbar' ][ 'manage_groups' ][ 'hide' ]  ===  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        echo  '<li><a href="' . generate_url ( array ( 'page' => 'device-groups' )) . '"><i class="fa fa-th fa-fw fa-lg" aria-hidden="true"></i> Manage Groups</a></li>' ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-30 18:04:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								     echo  ' 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " addhost/ " >< i  class = " fa fa-plus fa-col-success fa-fw fa-lg "  aria - hidden = " true " ></ i >  Add  Device </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " delhost/ " >< i  class = " fa fa-trash fa-col-info fa-fw fa-lg "  aria - hidden = " true " ></ i >  Delete  Device </ a ></ li > ' ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2015-03-28 13:08:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2011-09-02 19:25:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          </ ul > 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        </ li > 
							 
						 
					
						
							
								
									
										
										
										
											2011-09-02 19:25:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-09-06 10:07:17 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $config [ 'show_services' ])  {  
						 
					
						
							
								
									
										
										
										
											2011-09-06 10:07:17 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        < li  class = " dropdown " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < a  href = " services/ "  class = " dropdown-toggle "  data - hover = " dropdown "  data - toggle = " dropdown " >< i  class = " fa fa-cogs fa-fw fa-lg fa-nav-icons hidden-md "  aria - hidden = " true " ></ i >  < span  class = " hidden-sm " > Services </ span ></ a > 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < ul  class = " dropdown-menu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " services/ " >< i  class = " fa fa-cogs fa-fw fa-lg "  aria - hidden = " true " ></ i >  All  Services  </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2011-09-02 19:25:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2012-01-19 10:35:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-29 17:11:21 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  (( $service_status [ 1 ]  >  0 )  ||  ( $service_status [ 2 ]  >  0 ))  {  
						 
					
						
							
								
									
										
										
										
											2016-03-15 22:16:08 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo  '            <li role="presentation" class="divider"></li>' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-29 17:11:21 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( $service_status [ 1 ]  >  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        echo  '            <li><a href="services/state=warning/"><i class="fa fa-bell-o fa-col-warning fa-fw fa-lg" aria-hidden="true"></i> Warning (' . $service_status [ 1 ] . ')</a></li>' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-15 22:16:08 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-29 17:11:21 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( $service_status [ 2 ]  >  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        echo  '            <li><a href="services/state=critical/"><i class="fa fa-bell-o fa-col-danger fa-fw fa-lg" aria-hidden="true"></i> Critical (' . $service_status [ 2 ] . ')</a></li>' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-03-15 22:16:08 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2012-01-19 10:35:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $_SESSION [ 'userlevel' ]  >=  '10' )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( ' 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li  role = " presentation "  class = " divider " ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " addsrv/ " >< i  class = " fa fa-cog fa-col-success fa-fw fa-lg "  aria - hidden = " true " ></ i >  Add  Service </ a ></ li > ' ); 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          </ ul > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        </ li > 
							 
						 
					
						
							
								
									
										
										
										
											2011-09-02 19:25:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2011-09-06 10:07:17 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-09-02 19:25:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    <!--  PORTS  --> 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        < li  class = " dropdown " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < a  href = " ports/ "  class = " dropdown-toggle "  data - hover = " dropdown "  data - toggle = " dropdown " >< i  class = " fa fa-link fa-fw fa-lg fa-nav-icons hidden-md "  aria - hidden = " true " ></ i >  < span  class = " hidden-sm " > Ports </ span ></ a > 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < ul  class = " dropdown-menu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " ports/ " >< i  class = " fa fa-link fa-fw fa-lg "  aria - hidden = " true " ></ i >  All  Ports </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2016-08-21 08:07:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$ports  =  new  ObjectCache ( 'ports' );  
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $ports [ 'errored' ]  >  0 )  {  
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '            <li><a href="ports/errors=1/"><i class="fa fa-exclamation-circle fa-fw fa-lg" aria-hidden="true"></i> Errored (' . $ports [ 'errored' ] . ')</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $ports [ 'ignored' ]  >  0 )  {  
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '            <li><a href="ports/ignore=1/"><i class="fa fa-question-circle fa-fw fa-lg" aria-hidden="true"></i> Ignored (' . $ports [ 'ignored' ] . ')</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-25 22:23:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $config [ 'enable_billing' ])  {  
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '            <li><a href="bills/"><i class="fa fa-money fa-fw fa-lg" aria-hidden="true"></i> Traffic Bills</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    $ifbreak  =  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $config [ 'enable_pseudowires' ])  {  
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '            <li><a href="pseudowires/"><i class="fa fa-arrows-alt fa-fw fa-lg" aria-hidden="true"></i> Pseudowires</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    $ifbreak  =  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-12-03 15:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $_SESSION [ 'userlevel' ]  >=  '5' )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '            <li role="presentation" class="divider"></li>' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( $config [ 'int_customers' ])  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        echo ( '            <li><a href="customers/"><i class="fa fa-users fa-fw fa-lg" aria-hidden="true"></i> Customers</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        $ifbreak  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( $config [ 'int_l2tp' ])  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        echo ( '            <li><a href="iftype/type=l2tp/"><i class="fa fa-link fa-fw fa-lg" aria-hidden="true"></i> L2TP</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        $ifbreak  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( $config [ 'int_transit' ])  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        echo ( '            <li><a href="iftype/type=transit/"><i class="fa fa-truck fa-fw fa-lg" aria-hidden="true"></i> Transit</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        $ifbreak  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( $config [ 'int_peering' ])  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        echo ( '            <li><a href="iftype/type=peering/"><i class="fa fa-user-plus fa-fw fa-lg" aria-hidden="true"></i> Peering</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        $ifbreak  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( $config [ 'int_peering' ]  &&  $config [ 'int_transit' ])  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        echo ( '            <li><a href="iftype/type=peering,transit/"><i class="fa fa-user-secret fa-fw fa-lg" aria-hidden="true"></i> Peering + Transit</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        $ifbreak  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( $config [ 'int_core' ])  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        echo ( '            <li><a href="iftype/type=core/"><i class="fa fa-anchor fa-fw fa-lg" aria-hidden="true"></i> Core</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        $ifbreak  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( is_array ( $config [ 'custom_descr' ])  ===  false )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-24 20:07:37 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        $config [ 'custom_descr' ]  =  array ( $config [ 'custom_descr' ]); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    foreach  ( $config [ 'custom_descr' ]  as  $custom_type )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        if  ( ! empty ( $custom_type ))  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            echo  '          <li><a href="iftype/type='  .  urlencode ( strtolower ( $custom_type ))  .  '"><i class="fa fa-connectdevelop fa-fw fa-lg" aria-hidden="true"></i> '  .  ucfirst ( $custom_type )  .  '</a></li>' ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-24 20:07:37 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            $ifbreak  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $ifbreak )  {  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '            <li role="presentation" class="divider"></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( isset ( $interface_alerts ))  {  
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '           <li><a href="ports/alerted=yes/"><i class="fa fa-exclamation-circle fa-fw fa-lg" aria-hidden="true"></i> Alerts (' . $interface_alerts . ')</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-12-03 15:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$deleted_ports  =  0 ;  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								foreach  ( dbFetchRows ( " SELECT * FROM `ports` AS P, `devices` as D WHERE P.`deleted` = '1' AND D.device_id = P.device_id " )  as  $interface )  {  
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( port_permitted ( $interface [ 'port_id' ],  $interface [ 'device_id' ]))  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        $deleted_ports ++ ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-03 15:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " ports/state=down/ " >< i  class = " fa fa-exclamation-triangle fa-col-danger fa-fw fa-lg "  aria - hidden = " true " ></ i >  Down </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " ports/state=admindown/ " >< i  class = " fa fa-pause fa-col-info fa-fw fa-lg "  aria - hidden = " true " ></ i >  Disabled </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2010-06-10 19:47:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2010-04-24 22:58:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $deleted_ports )  {  
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '            <li><a href="deleted-ports/"><i class="fa fa-minus-circle fa-col-primary fa-fw fa-lg" aria-hidden="true"></i> Deleted (' . $deleted_ports . ')</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2010-04-24 22:58:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2011-09-02 19:25:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          </ ul > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        </ li > 
							 
						 
					
						
							
								
									
										
										
										
											2011-04-21 10:37:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2012-05-25 12:24:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								// FIXME does not check user permissions...
  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								foreach  ( dbFetchRows ( " SELECT sensor_class,COUNT(sensor_id) AS c FROM sensors GROUP BY sensor_class ORDER BY sensor_class  " )  as  $row )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    $used_sensors [ $row [ 'sensor_class' ]]  =  $row [ 'c' ]; 
							 
						 
					
						
							
								
									
										
										
										
											2011-04-21 10:37:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								# Copy the variable so we can use $used_sensors later in other parts of the code
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								$menu_sensors  =  $used_sensors ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2010-02-11 23:37:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        < li  class = " dropdown " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < a  href = " health/ "  class = " dropdown-toggle "  data - hover = " dropdown "  data - toggle = " dropdown " >< i  class = " fa fa-heartbeat fa-fw fa-lg fa-nav-icons hidden-md "  aria - hidden = " true " ></ i >  < span  class = " hidden-sm " > Health </ span ></ a > 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < ul  class = " dropdown-menu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " health/metric=mempool/ " >< i  class = " fa fa-gears fa-fw fa-lg "  aria - hidden = " true " ></ i >  Memory </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " health/metric=processor/ " >< i  class = " fa fa-desktop fa-fw fa-lg "  aria - hidden = " true " ></ i >  Processor </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " health/metric=storage/ " >< i  class = " fa fa-database fa-fw fa-lg "  aria - hidden = " true " ></ i >  Storage </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2011-04-21 10:37:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $menu_sensors )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    $sep  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '            <li role="presentation" class="divider"></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2011-04-21 10:37:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-22 10:37:07 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$icons  =  array ( 'fanspeed' => 'tachometer' , 'humidity' => 'tint' , 'temperature' => 'fire' , 'current' => 'bolt' , 'frequency' => 'line-chart' , 'power' => 'power-off' , 'voltage' => 'bolt' , 'charge' => 'plus-square' , 'dbm' => 'sun-o' ,  'load' => 'spinner' , 'state' => 'bullseye' , 'signal' => 'wifi' );  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								foreach  ( array ( 'fanspeed' , 'humidity' , 'temperature' , 'signal' )  as  $item )  {  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( isset ( $menu_sensors [ $item ]))  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        echo ( '            <li><a href="health/metric=' . $item . '/"><i class="fa fa-' . $icons [ $item ] . ' fa-fw fa-lg" aria-hidden="true"></i> ' . nicecase ( $item ) . '</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        unset ( $menu_sensors [ $item ]); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        $sep ++ ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2011-04-21 10:37:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $sep  &&  array_keys ( $menu_sensors ))  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '          <li role="presentation" class="divider"></li>' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    $sep  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-09-19 13:59:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								foreach  ( array ( 'current' , 'frequency' , 'power' , 'voltage' )  as  $item )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( isset ( $menu_sensors [ $item ]))  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        echo ( '            <li><a href="health/metric=' . $item . '/"><i class="fa fa-' . $icons [ $item ] . ' fa-fw fa-lg" aria-hidden="true"></i> ' . nicecase ( $item ) . '</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        unset ( $menu_sensors [ $item ]); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        $sep ++ ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2011-09-19 13:59:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $sep  &&  array_keys ( $menu_sensors ))  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '            <li role="presentation" class="divider"></li>' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    $sep  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-04-21 10:37:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2011-09-19 13:59:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								foreach  ( array_keys ( $menu_sensors )  as  $item )  {  
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '            <li><a href="health/metric=' . $item . '/"><i class="fa fa-' . $icons [ $item ] . ' fa-fw fa-lg" aria-hidden="true"></i> ' . nicecase ( $item ) . '</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    unset ( $menu_sensors [ $item ]); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    $sep ++ ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-04-27 14:29:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2011-04-21 10:37:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          </ ul > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        </ li > 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2011-04-30 22:20:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-28 17:01:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$app_list  =  dbFetchRows ( " SELECT DISTINCT(`app_type`) AS `app_type` FROM `applications` ORDER BY `app_type` " );  
						 
					
						
							
								
									
										
										
										
											2012-04-20 10:36:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-28 17:01:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $_SESSION [ 'userlevel' ]  >=  '5'  &&  count ( $app_list )  >  " 0 " )  {  
						 
					
						
							
								
									
										
										
										
											2012-04-20 10:36:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        < li  class = " dropdown " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < a  href = " apps/ "  class = " dropdown-toggle "  data - hover = " dropdown "  data - toggle = " dropdown " >< i  class = " fa fa-tasks fa-fw fa-lg fa-nav-icons hidden-md "  aria - hidden = " true " ></ i >  < span  class = " hidden-sm " > Apps </ span ></ a > 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < ul  class = " dropdown-menu " > 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-20 10:36:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								foreach  ( $app_list  as  $app )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( isset ( $app [ 'app_type' ]))  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        $app_i_list  =  dbFetchRows ( " SELECT DISTINCT(`app_instance`) FROM `applications` WHERE `app_type` = ? ORDER BY `app_instance` " ,  array ( $app [ 'app_type' ])); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        $image  =  $config [ 'html_dir' ] . " /images/icons/ " . $app [ 'app_type' ] . " .png " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        $icon  =  ( file_exists ( $image )  ?  $app [ 'app_type' ]  :  " apps " ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        if  ( count ( $app_i_list )  >  1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            echo  '<li class="dropdown-submenu">' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            echo  '<a href="apps/app=' . $app [ 'app_type' ] . '/"><i class="fa fa-server fa-fw fa-lg" aria-hidden="true"></i> ' . nicecase ( $app [ 'app_type' ]) . ' </a>' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            echo  '<ul class="dropdown-menu scrollable-menu">' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            foreach  ( $app_i_list  as  $instance )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                echo  '            <li><a href="apps/app=' . $app [ 'app_type' ] . '/instance=' . $instance [ 'app_instance' ] . '/"><i class="fa fa-angle-double-right fa-fw fa-lg" aria-hidden="true"></i> '  .  nicecase ( $instance [ 'app_instance' ])  .  '</a></li>' ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-28 17:01:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            echo  '</ul></li>' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            echo ( '<li><a href="apps/app=' . $app [ 'app_type' ] . '/"><i class="fa fa-angle-double-right fa-fw fa-lg" aria-hidden="true"></i> ' . nicecase ( $app [ 'app_type' ]) . ' </a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2012-04-20 10:36:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								          </ ul > 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        </ li > 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-20 10:36:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-10-29 19:52:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$routing_count [ 'bgp' ]   =  dbFetchCell ( " SELECT COUNT(bgpPeer_id) from `bgpPeers` LEFT JOIN devices AS D ON bgpPeers.device_id=D.device_id WHERE D.device_id IS NOT NULL " );  
						 
					
						
							
								
									
										
										
										
											2012-04-05 13:21:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$routing_count [ 'ospf' ]  =  dbFetchCell ( " SELECT COUNT(ospf_instance_id) FROM `ospf_instances` WHERE `ospfAdminStat` = 'enabled' " );  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								$routing_count [ 'cef' ]   =  dbFetchCell ( " SELECT COUNT(cef_switching_id) from `cef_switching` " );  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								$routing_count [ 'vrf' ]   =  dbFetchCell ( " SELECT COUNT(vrf_id) from `vrfs` " );  
						 
					
						
							
								
									
										
										
										
											2011-04-30 22:20:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-21 08:07:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$component  =  new  LibreNMS\Component ();  
						 
					
						
							
								
									
										
										
										
											2016-01-21 22:04:20 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$options [ 'type' ]  =  'Cisco-OTV' ;  
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$otv  =  $component -> getComponents ( null ,  $options );  
						 
					
						
							
								
									
										
										
										
											2016-01-28 07:04:12 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$routing_count [ 'cisco-otv' ]  =  count ( $otv );  
						 
					
						
							
								
									
										
										
										
											2016-01-21 22:04:20 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $_SESSION [ 'userlevel' ]  >=  '5'  &&  ( $routing_count [ 'bgp' ] + $routing_count [ 'ospf' ] + $routing_count [ 'cef' ] + $routing_count [ 'vrf' ] + $routing_count [ 'cisco-otv' ])  >  " 0 " )  {  
						 
					
						
							
								
									
										
										
										
											2011-09-02 19:25:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        < li  class = " dropdown " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < a  href = " routing/ "  class = " dropdown-toggle "  data - hover = " dropdown "  data - toggle = " dropdown " >< i  class = " fa fa-arrows fa-fw fa-lg fa-nav-icons hidden-md "  aria - hidden = " true " ></ i >  < span  class = " hidden-sm " > Routing </ span ></ a > 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < ul  class = " dropdown-menu " > 
							 
						 
					
						
							
								
									
										
										
										
											2011-09-02 19:25:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    $separator  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $_SESSION [ 'userlevel' ]  >=  '5'  &&  $routing_count [ 'vrf' ])  {  
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '            <li><a href="routing/protocol=vrf/"><i class="fa fa-arrows-alt fa-fw fa-lg" aria-hidden="true"></i> VRFs</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    $separator ++ ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $_SESSION [ 'userlevel' ]  >=  '5'  &&  $routing_count [ 'ospf' ])  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( $separator )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        echo ( '            <li role="presentation" class="divider"></li>' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        $separator  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-02-15 20:59:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '<li><a href="routing/protocol=ospf/"><i class="fa fa-circle-o-notch fa-rotate-180 fa-fw fa-lg" aria-hidden="true"></i> OSPF Devices </a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    $separator ++ ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-01-21 22:04:20 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    // Cisco OTV Links
 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $_SESSION [ 'userlevel' ]  >=  '5'  &&  $routing_count [ 'cisco-otv' ])  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( $separator )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        echo ( '            <li role="presentation" class="divider"></li>' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        $separator  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-21 22:04:20 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '<li><a href="routing/protocol=cisco-otv/"><i class="fa fa-exchange fa-fw fa-lg" aria-hidden="true"></i> Cisco OTV </a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    $separator ++ ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2016-01-21 22:04:20 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    // BGP Sessions
 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $_SESSION [ 'userlevel' ]  >=  '5'  &&  $routing_count [ 'bgp' ])  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( $separator )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        echo ( '            <li role="presentation" class="divider"></li>' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        $separator  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( ' < li >< a  href = " routing/protocol=bgp/type=all/graph=NULL/ " >< i  class = " fa fa-link fa-fw fa-lg "  aria - hidden = " true " ></ i >  BGP  All  Sessions  </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " routing/protocol=bgp/type=external/graph=NULL/ " >< i  class = " fa fa-external-link fa-fw fa-lg "  aria - hidden = " true " ></ i >  BGP  External </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " routing/protocol=bgp/type=internal/graph=NULL/ " >< i  class = " fa fa-external-link fa-rotate-180 fa-fw fa-lg "  aria - hidden = " true " ></ i >  BGP  Internal </ a ></ li > ' ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2012-05-25 12:24:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  // Do Alerts at the bottom
 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $bgp_alerts )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( ' 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li  role = " presentation "  class = " divider " ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								            < li >< a  href = " routing/protocol=bgp/adminstatus=start/state=down/ " >< i  class = " fa fa-exclamation-circle fa-fw fa-lg "  aria - hidden = " true " ></ i >  Alerted  BGP  ( ' . $bgp_alerts . ' ) </ a ></ li > ' ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2011-04-17 12:00:13 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '          </ul>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2011-09-20 09:55:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        </ li ><!--  End  4  columns  container  --> 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-28 17:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-09-02 19:25:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2014-03-12 22:03:47 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-09-15 10:21:28 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$alerts  =  new  ObjectCache ( 'alerts' );  
						 
					
						
							
								
									
										
										
										
											2015-03-26 23:51:13 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-09-15 10:21:28 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $alerts [ 'active_count' ]  >  0 )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    $alert_colour  =  " danger " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  else  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    $alert_colour  =  " success " ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-03-12 22:03:47 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2016-09-15 10:21:28 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-03-12 22:03:47 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-09-11 23:41:41 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < li  class = " dropdown " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < a  href = " # "  class = " dropdown-toggle "  data - hover = " dropdown "  data - toggle = " dropdown " >< i  class = " fa fa-exclamation-circle fa-col-<?php echo  $alert_colour ;?> fa-fw fa-lg fa-nav-icons hidden-md "  aria - hidden = " true " ></ i >  < span  class = " hidden-sm " > Alerts </ span ></ a > 
							 
						 
					
						
							
								
									
										
										
										
											2014-03-12 22:03:47 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < ul  class = " dropdown-menu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								              < li >< a  href = " <?php echo(generate_url(array('page'=>'alerts'))); ?> " >< i  class = " fa fa-bell fa-fw fa-lg "  aria - hidden = " true " ></ i >  Notifications </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								              < li >< a  href = " <?php echo(generate_url(array('page'=>'alert-log'))); ?> " >< i  class = " fa fa-th-list fa-fw fa-lg "  aria - hidden = " true " ></ i >  Historical  Log </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								              < li >< a  href = " <?php echo(generate_url(array('page'=>'alert-stats'))); ?> " >< i  class = " fa fa-bar-chart fa-fw fa-lg "  aria - hidden = " true " ></ i >  Statistics </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-12 07:51:49 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                < ? php 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                if  ( $_SESSION [ 'userlevel' ]  >=  '10' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    ?> 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                  < li >< a  href = " <?php echo(generate_url(array('page'=>'alert-rules'))); ?> " >< i  class = " fa fa-tasks fa-fw fa-lg "  aria - hidden = " true " ></ i >  Rules </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                  < li >< a  href = " <?php echo(generate_url(array('page'=>'alert-schedule'))); ?> " >< i  class = " fa fa-calendar fa-fw fa-lg "  aria - hidden = " true " ></ i >  Maintenance  Windows </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                  < li >< a  href = " <?php echo(generate_url(array('page'=>'alert-map'))); ?> " >< i  class = " fa fa-link fa-fw fa-lg "  aria - hidden = " true " ></ i >  Rule  Mapping </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                  < li >< a  href = " <?php echo(generate_url(array('page'=>'templates'))); ?> " >< i  class = " fa fa-sitemap fa-fw fa-lg "  aria - hidden = " true " ></ i >  Templates </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-12 07:51:49 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                    < ? php 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                ?> 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-03-12 22:03:47 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          </ ul > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-11 23:41:41 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      </ li > 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-05 13:41:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-03-12 22:03:47 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2012-05-25 12:24:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								// Custom menubar entries.
  
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( is_file ( " includes/print-menubar-custom.inc.php " ))  {  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    require  'includes/print-menubar-custom.inc.php' ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-05 13:41:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2012-04-05 13:11:20 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-03-12 23:26:47 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    </ ul > 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								     < form  role = " search "  class = " navbar-form navbar-right global-search " > 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-12 23:26:47 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								         < div  class = " form-group " > 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								             < input  class = " form-control typeahead "  type = " search "  id = " gsearch "  name = " gsearch "  placeholder = " Global Search " > 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-12 23:26:47 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								         </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								     </ form > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    < ul  class = " nav navbar-nav navbar-right " > 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-09 23:56:12 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < li  class = " dropdown " > 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-27 15:35:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2016-08-21 08:07:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    $notifications  =  new  ObjectCache ( 'notifications' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-11 16:32:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    $style  =  '' ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( empty ( $notifications [ 'count' ])  &&  empty ( $notifications [ 'sticky_count' ]))  {  
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:27:34 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    $class  =  'badge-default' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  else  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    $class  =  'badge-danger' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '<a href="#" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-user fa-fw fa-lg fa-nav-icons" aria-hidden="true"></i> <span class="visible-xs-inline-block">User</span><span class="badge badge-navbar-user ' . $class . '">' . ( $notifications [ 'sticky_count' ] + $notifications [ 'count' ]) . '</span></a>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-27 15:35:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2015-12-09 23:56:12 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        < ul  class = " dropdown-menu " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								          < li  role = " presentation "  class = " dropdown-header " >  Settings </ li > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < li >< a  href = " preferences/ " >< i  class = " fa fa-cog fa-fw fa-lg "  aria - hidden = " true " ></ i >  My  Settings </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-11 22:00:26 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2016-08-21 08:07:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    $notifications  =  new  ObjectCache ( 'notifications' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-11 22:00:26 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo  ( '<li><a href="notifications/"><span class="badge count-notif">' . ( $notifications [ 'sticky_count' ] + $notifications [ 'count' ]) . '</span> Notifications</a></li>' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2015-12-09 23:56:12 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < li  role = " presentation "  class = " divider " ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2015-12-09 23:56:12 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $_SESSION [ 'authenticated' ])  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( ' 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < li >< a  href = " logout/ " >< i  class = " fa fa-sign-out fa-fw fa-lg "  aria - hidden = " true " ></ i >  Logout </ a ></ li > ' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-09 23:56:12 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								         </ ul > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								       </ li > 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < li  class = " dropdown " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        < a  href = " # "  class = " dropdown-toggle "  data - hover = " dropdown "  data - toggle = " dropdown "  style = " margin-left:5px " >< i  class = " fa fa-cog fa-fw fa-lg fa-nav-icons "  aria - hidden = " true " ></ i >  < span  class = " visible-xs-inline-block " > Settings </ span ></ a > 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        < ul  class = " dropdown-menu " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								          < li  role = " presentation "  class = " dropdown-header " >  Settings </ li > 
							 
						 
					
						
							
								
									
										
										
										
											2012-01-19 10:35:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $_SESSION [ 'userlevel' ]  >=  '10' )  {  
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( '<li><a href="settings/"><i class="fa fa-cogs fa-fw fa-lg" aria-hidden="true"></i> Global Settings</a></li>' ); 
							 
						 
					
						
							
								
									
										
										
										
											2012-01-19 10:35:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2012-01-19 10:35:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								          < li  role = " presentation "  class = " divider " ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								          < li  role = " presentation "  class = " dropdown-header " >  Users </ li > 
							 
						 
					
						
							
								
									
										
										
										
											2011-09-02 19:25:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< ? php  if  ( $_SESSION [ 'userlevel' ]  >=  '10' )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( auth_usermanagement ())  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        echo ( ' 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < li >< a  href = " adduser/ " >< i  class = " fa fa-user-plus fa-fw fa-lg "  aria - hidden = " true " ></ i >  Add  User </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								           < li >< a  href = " deluser/ " >< i  class = " fa fa-user-times fa-fw fa-lg "  aria - hidden = " true " ></ i >  Remove  User </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           ' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( ' 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < li >< a  href = " edituser/ " >< i  class = " fa fa-user-secret fa-fw fa-lg "  aria - hidden = " true " ></ i >  Edit  User </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								           < li >< a  href = " authlog/ " >< i  class = " fa fa-key fa-fw fa-lg "  aria - hidden = " true " ></ i >  Authlog </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < li  role = " presentation "  class = " divider " ></ li >  ' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( ' 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-02 17:02:28 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < li  class = " dropdown-submenu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								               < a  href = " # " >< i  class = " fa fa-clock-o fa-fw fa-lg "  aria - hidden = " true " ></ i >  Pollers </ a > 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-02 17:02:28 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								               < ul  class = " dropdown-menu scrollable-menu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								               < li >< a  href = " poll-log/ " >< i  class = " fa fa-list-alt fa-fw fa-lg "  aria - hidden = " true " ></ i >  Poll - log </ a ></ li > ' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-25 22:05:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    if  ( $config [ 'distributed_poller' ]  ===  true )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        echo  ( ' 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								                    < li >< a  href = " pollers/tab=pollers/ " >< i  class = " fa fa-clock-o fa-fw fa-lg "  aria - hidden = " true " ></ i >  Pollers </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    < li >< a  href = " pollers/tab=groups/ " >< i  class = " fa fa-gears fa-fw fa-lg "  aria - hidden = " true " ></ i >  Groups </ a ></ li > ' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    echo  ( ' 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-02 17:02:28 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								               </ ul > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								           </ li > 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < li  role = " presentation "  class = " divider " ></ li > ' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( ' 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-16 23:10:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < li  class = " dropdown-submenu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < a  href = " # " >< i  class = " fa fa-code fa-fw fa-lg "  aria - hidden = " true " ></ i >  API </ a > 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-16 23:10:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < ul  class = " dropdown-menu scrollable-menu " > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								             < li >< a  href = " api-access/ " >< i  class = " fa fa-wrench fa-fw fa-lg "  aria - hidden = " true " ></ i >  API  Settings </ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								             < li >< a  href = " http://docs.librenms.org/API/API-Docs/ "  target = " _blank " >< i  class = " fa fa-book fa-fw fa-lg "  aria - hidden = " true " ></ i >  API  Docs </ a ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-16 23:10:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           </ ul > 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-08 21:33:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           </ li > 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-16 23:10:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < li  role = " presentation "  class = " divider " ></ li > ' ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-05 12:27:12 -03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $_SESSION [ 'authenticated' ])  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    echo ( ' 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-08 21:33:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < li  class = " dropdown-submenu " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								               < a  href = " # " >< span  class = " countdown_timer "  id = " countdown_timer " ></ span ></ a > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								               < ul  class = " dropdown-menu scrollable-menu " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                   < li >< a  href = " # " >< span  class = " countdown_timer_status "  id = " countdown_timer_status " ></ span ></ a ></ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								               </ ul > 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-09 23:56:12 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           </ li > ' ); 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								?> 
  
						 
					
						
							
								
									
										
										
										
											2011-09-02 19:25:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < li  role = " presentation "  class = " divider " ></ li > 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-23 08:24:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								           < li >< a  href = " about/ " >< i  class = " fa fa-exclamation-circle fa-fw fa-lg "  aria - hidden = " true " ></ i >  About & nbsp ; < ? php  echo ( $config [ 'project_name' ]);  ?> </a></li>
 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								         </ ul > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								       </ li > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								     </ ul > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								   </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								 </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								</ nav >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								< script >  
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								var  devices  =  new  Bloodhound ({  
						 
					
						
							
								
									
										
										
										
											2015-05-03 23:15:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  datumTokenizer :  Bloodhound . tokenizers . obj . whitespace ( 'name' ), 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  queryTokenizer :  Bloodhound . tokenizers . whitespace , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  remote :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								      url :  " ajax_search.php?search=%QUERY&type=device " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        filter :  function  ( devices )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            return  $ . map ( devices ,  function  ( device )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    device_id :  device . device_id , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    device_image :  device . device_image , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    url :  device . url , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    name :  device . name , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    device_os :  device . device_os , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    version :  device . version , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    device_hardware :  device . device_hardware , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    device_ports :  device . device_ports , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    location :  device . location 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                }; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            }); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        }, 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								      wildcard :  " %QUERY " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								});  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								var  ports  =  new  Bloodhound ({  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  datumTokenizer :  Bloodhound . tokenizers . obj . whitespace ( 'name' ), 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  queryTokenizer :  Bloodhound . tokenizers . whitespace , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  remote :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								      url :  " ajax_search.php?search=%QUERY&type=ports " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        filter :  function  ( ports )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            return  $ . map ( ports ,  function  ( port )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    count :  port . count , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    url :  port . url , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    name :  port . name , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    description :  port . description , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    colours :  port . colours , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    hostname :  port . hostname 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                }; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            }); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        }, 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								      wildcard :  " %QUERY " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								});  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								var  bgp  =  new  Bloodhound ({  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  datumTokenizer :  Bloodhound . tokenizers . obj . whitespace ( 'name' ), 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  queryTokenizer :  Bloodhound . tokenizers . whitespace , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  remote :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								      url :  " ajax_search.php?search=%QUERY&type=bgp " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        filter :  function  ( bgp_sessions )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            return  $ . map ( bgp_sessions ,  function  ( bgp )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    count :  bgp . count , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    url :  bgp . url , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    name :  bgp . name , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    description :  bgp . description , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    localas :  bgp . localas , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    bgp_image :  bgp . bgp_image , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    remoteas :  bgp . remoteas , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    colours :  bgp . colours , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                    hostname :  bgp . hostname 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								                }; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								            }); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        }, 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								      wildcard :  " %QUERY " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								});  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 17:48:57 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								if  ( $ ( window ) . width ()  <  768 )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    var  cssMenu  =  'typeahead-left' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  else  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    var  cssMenu  =  '' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								devices . initialize ();  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								ports . initialize ();  
						 
					
						
							
								
									
										
										
										
											2015-04-29 17:48:57 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								bgp . initialize ();  
						 
					
						
							
								
									
										
										
										
											2015-07-18 18:27:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$ ( '#gsearch' ) . bind ( 'typeahead:select' ,  function ( ev ,  suggestion )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    window . location . href  =  suggestion . url ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								});  
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$ ( '#gsearch' ) . typeahead ({  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    hint :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    highlight :  true , 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 17:48:57 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    minLength :  1 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    classNames :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        menu :  cssMenu 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								},  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  source :  devices . ttAdapter (), 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 12:56:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  limit :  '<?php echo($typeahead_limit); ?>' , 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  async :  true , 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-03 23:15:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  display :  'name' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  valueKey :  'name' , 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    templates :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        header :  '<h5><strong> Devices</strong></h5>' , 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-03 14:08:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        suggestion :  Handlebars . compile ( '<p><a href="{{url}}"><img src="{{device_image}}" border="0"> <small><strong>{{name}}</strong> | {{device_os}} | {{version}} | {{device_hardware}} with {{device_ports}} port(s) | {{location}}</small></a></p>' ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								},  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  source :  ports . ttAdapter (), 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 12:56:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  limit :  '<?php echo($typeahead_limit); ?>' , 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  async :  true , 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-03 23:15:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  display :  'name' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  valueKey :  'name' , 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    templates :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        header :  '<h5><strong> Ports</strong></h5>' , 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-03 15:52:04 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
										 
							
							
								        suggestion :  Handlebars . compile ( '<p><a href="{{url}}"><small><img src="images/icons/port.png" /> <strong>{{name}}</strong> –  ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								},  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  source :  bgp . ttAdapter (), 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 12:56:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  limit :  '<?php echo($typeahead_limit); ?>' , 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  async :  true , 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-03 23:15:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  display :  'name' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  valueKey :  'name' , 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    templates :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								        header :  '<h5><strong> BGP Sessions</strong></h5>' , 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-03 15:52:04 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								        suggestion :  Handlebars . compile ( '<p><a href="{{url}}"><small><img src="{{bgp_image}}" border="0">{{name}} - {{hostname}}<br />AS{{localas}} -> AS{{remoteas}}</small></a></p>' ) 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-29 15:18:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								});  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								$ ( '#gsearch' ) . bind ( 'typeahead:open' ,  function ( ev ,  suggestion )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    $ ( '#gsearch' ) . addClass ( 'search-box' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								});  
						 
					
						
							
								
									
										
										
										
											2014-01-13 10:05:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								</ script >  
						 
					
						
							
								
									
										
										
										
											2016-04-21 12:56:45 +02:00