Index: html/pages/device/graphs/wireless.inc.php
===================================================================
--- html/pages/device/graphs/wireless.inc.php	(revision 2920)
+++ html/pages/device/graphs/wireless.inc.php	(working copy)
@@ -7,4 +7,5 @@
   include("includes/print-device-graph.php");
 }
 
-?>
\ No newline at end of file
+
+?>
Index: html/pages/device.inc.php
===================================================================
--- html/pages/device.inc.php	(revision 2920)
+++ html/pages/device.inc.php	(working copy)
@@ -6,6 +6,7 @@
   $permit_ports = 1;
 }
 
+
 if (device_permitted($vars['device']) || $check_device == $vars['device'])
 {
   $selected['iface'] = "selected";
@@ -99,6 +100,15 @@
   </li>');
     }
 
+    if (@dbFetchCell("SELECT COUNT(accesspoint_id) FROM accesspoint WHERE device_id = '" . $device['device_id'] . "'") > '0')
+    {
+      echo('<li class="' . $select['accesspoints'] . '">
+    <a href="'.generate_device_url($device, array('tab' => 'accesspoints')). '">
+      <img src="images/icons/wireless.png" align="absmiddle" border="0" /> Access Points
+    </a>
+  </li>');
+    }
+
     if (isset($config['smokeping']['dir']))
     {
       $smokeping_files = array();
Index: html/includes/graphs/graph.inc.php
===================================================================
--- html/includes/graphs/graph.inc.php	(revision 2920)
+++ html/includes/graphs/graph.inc.php	(working copy)
@@ -39,10 +39,11 @@
   {
     include($config['install_dir'] . "/html/includes/graphs/$type/$subtype.inc.php");
   }
+
 }
 else
 {
-  graph_error("Graph Template Missing");
+  graph_error("$type*$subtype ");//Graph Template Missing");
 }
 
 function graph_error($string)
@@ -79,6 +80,7 @@
   }
 }
 
+
 if ($error_msg) {
   graph_error($graph_error);
 } elseif (!$auth) {
@@ -109,6 +111,7 @@
     unlink($graphfile);
     echo("</div>");
   } else {
+
     if ($rrd_options)
     {
       rrdtool_graph($graphfile, $rrd_options);
Index: html/includes/functions.inc.php
===================================================================
--- html/includes/functions.inc.php	(revision 2920)
+++ html/includes/functions.inc.php	(working copy)
@@ -264,6 +264,7 @@
 
 function generate_graph_tag($args)
 {
+
   foreach ($args as $key => $arg)
   {
     $urlargs[] = $key."=".$arg;
@@ -352,11 +353,57 @@
   }
 }
 
+function generate_ap_link($args, $text = NULL, $type = NULL)
+{
+  global $config;
+
+
+
+  $args = ifNameDescr($args);
+  if (!$text) { $text = fixIfName($args['label']); }
+  if ($type) { $args['graph_type'] = $type; }
+  if (!isset($args['graph_type'])) { $args['graph_type'] = 'port_bits'; }
+
+  if (!isset($args['hostname'])) { $args = array_merge($args, device_by_id_cache($args['device_id'])); }
+
+  $content = "<div class=list-large>".$args['text']." - " . fixifName($args['label']) . "</div>";
+  if ($args['ifAlias']) { $content .= $args['ifAlias']."<br />"; }
+  $content .= "<div style=\'width: 850px\'>";
+  $graph_array['type']     = $args['graph_type'];
+  $graph_array['legend']   = "yes";
+  $graph_array['height']   = "100";
+  $graph_array['width']    = "340";
+  $graph_array['to']           = $config['time']['now'];
+  $graph_array['from']     = $config['time']['day'];
+  $graph_array['id']       = $args['accesspoint_id'];
+  $content .= generate_graph_tag($graph_array);
+  $graph_array['from']     = $config['time']['week'];
+  $content .= generate_graph_tag($graph_array);
+  $graph_array['from']     = $config['time']['month'];
+  $content .= generate_graph_tag($graph_array);
+  $graph_array['from']     = $config['time']['year'];
+  $content .= generate_graph_tag($graph_array);
+  $content .= "</div>";
+
+
+  $url = generate_ap_url($args);
+  if (port_permitted($args['interface_id'], $args['device_id'])) {
+    return overlib_link($url, $text, $content, $class);
+  } else {
+    return fixifName($text);
+  }
+}
+
 function generate_port_url($port, $vars=array())
 {
   return generate_url(array('page' => 'device', 'device' => $port['device_id'], 'tab' => 'port', 'port' => $port['interface_id']), $vars);
 }
 
+function generate_ap_url($ap, $vars=array())
+{
+  return generate_url(array('page' => 'device', 'device' => $ap['device_id'], 'tab' => 'accesspoint', 'ap' => $ap['accesspoint_id']), $vars);
+}
+
 function generate_port_thumbnail($args)
 {
   if (!$args['bg']) { $args['bg'] = "FFFFFF"; }
Index: includes/static-config.php
===================================================================
--- includes/static-config.php	(revision 2920)
+++ includes/static-config.php	(working copy)
@@ -865,6 +865,13 @@
 $config['os'][$os]['type']              = "wireless";
 $config['os'][$os]['icon']              = "arubaos";
 
+$config['os'][$os]['over'][0]['graph']  = "device_arubacontroller_numaps";
+$config['os'][$os]['over'][0]['text']   = "Number of APs";
+$config['os'][$os]['over'][1]['graph']  = "device_arubacontroller_numclients";
+$config['os'][$os]['over'][1]['text']   = "Number of Clients";
+
+
+
 foreach ($config['os'] as $this_os => $blah)
 {
   if (isset($config['os'][$this_os]['group']))
Index: includes/polling/os/arubaos.inc.php
===================================================================
--- includes/polling/os/arubaos.inc.php	(revision 2920)
+++ includes/polling/os/arubaos.inc.php	(working copy)
@@ -4,4 +4,19 @@
 $badchars = array("(", ")", ",");
 list(,,$hardware,,$version,) = str_replace($badchars, "", explode (" ", $poll_device['sysDescr']));
 
+//// Build SNMP Cache Array
+
+//stuff about the controller
+$switch_info_oids = array('wlsxSwitchRole','wlsxSwitchMasterIp');
+echo("Caching Oids: ");
+foreach ($switch_info_oids as $oid) { echo("$oid "); $aruba_info = snmpwalk_cache_oid($device, $oid, $aruba_info, "WLSX-SWITCH-MIB"); }
+
+echo("\n");
+
+if ($aruba_info[0]['wlsxSwitchRole']=='master') {
+	$features="Master Controller";
+} else {
+	$features="Local Controller for ".$aruba_info[0]['wlsxSwitchMasterIp'];
+}	
+
 ?>
Index: includes/defaults.inc.php
===================================================================
--- includes/defaults.inc.php	(revision 2920)
+++ includes/defaults.inc.php	(working copy)
@@ -33,6 +33,20 @@
 $config['neato']          = "/usr/bin/neato";
 $config['sfdp']           = "/usr/bin/sfdp";
 
+
+
+
+### RRD Format Settings
+### These should not normally be changed
+### Though one could conceivably increase or decrease the size of each RRA if one had performance problems
+### Or if one had a very fast I/O subsystem with no performance worries.
+
+$config['rrd_rra']  = " RRA:AVERAGE:0.5:1:2016 RRA:AVERAGE:0.5:6:1440 RRA:AVERAGE:0.5:24:1440 RRA:AVERAGE:0.5:288:1440 ";
+$config['rrd_rra'] .= " RRA:MAX:0.5:1:720 RRA:MIN:0.5:6:1440     RRA:MIN:0.5:24:775     RRA:MIN:0.5:288:797 ";
+$config['rrd_rra'] .= " RRA:MAX:0.5:1:720 RRA:MAX:0.5:6:1440     RRA:MAX:0.5:24:775     RRA:MAX:0.5:288:797 ";
+$config['rrd_rra'] .= " RRA:LAST:0.5:1:1440 ";
+
+
 ### RRDCacheD - Make sure it can write to your RRD dir!
 
 #$config['rrdcached']    = "unix:/var/run/rrdcached.sock";
@@ -381,6 +395,7 @@
 $config['poller_modules']['cisco-ace-serverfarms']	  = 1;
 $config['poller_modules']['netscaler-vsvr']               = 1;
 $config['poller_modules']['entity-physical']              = 1;
+$config['poller_modules']['aruba-controller']		  = 1;
 
 ## List of discovery modules. Need to be in this array to be
 ## considered for execution.
Index: includes/snmp.inc.php
===================================================================
--- includes/snmp.inc.php	(revision 2920)
+++ includes/snmp.inc.php	(working copy)
@@ -161,6 +161,9 @@
   else { return false; }
 }
 
+
+
+
 function snmp_walk($device, $oid, $options = NULL, $mib = NULL, $mibdir = NULL)
 {
   global $debug,$config,$runtime_stats;
@@ -363,6 +366,29 @@
   return $array;
 }
 
+// just like snmpwalk_cache_oid except that it returns the numerical oid as the index
+// this is useful when the oid is indexed by the mac address and snmpwalk would
+// return periods (.) for non-printable numbers, thus making many different indexes appear 
+// to be the same.
+function snmpwalk_cache_oid_num($device, $oid, $array, $mib = NULL, $mibdir = NULL)
+{
+  $data = snmp_walk($device, $oid, "-OQUn", $mib, $mibdir);
+
+  foreach (explode("\n", $data) as $entry)
+  {
+    list($oid,$value) = explode("=", $entry);
+    $oid = trim($oid); $value = trim($value);
+    list($oid, $index) = explode(".", $oid, 2);
+    if (!strstr($value, "at this OID") && isset($oid) && isset($index))
+    {
+      $array[$index][$oid] = $value;
+    }
+  }
+
+  return $array;
+}
+
+
 function snmpwalk_cache_multi_oid($device, $oid, $array, $mib = NULL, $mibdir = NULL)
 {
   global $cache;
Index: includes/common.php
===================================================================
--- includes/common.php	(revision 2920)
+++ includes/common.php	(working copy)
@@ -260,6 +260,16 @@
   return device_by_id_cache(getidbyname($name), $refresh);
 }
 
+
+function accesspoint_by_id($ap_id, $refresh = '0') {
+
+  $ap = dbFetchRow("SELECT * FROM `accesspoint` WHERE `accesspoint_id` = ?", array($ap_id));
+
+  return $ap;
+
+}
+
+
 function device_by_id_cache($device_id, $refresh = '0')
 {
   global $cache;
