Thanks!
Would you believe it, but I've just started to merge generate_port_link into generate_entity_link. (we're trying to do away with "entity-type" specific functions).
Don't worry though, I'll merge generate_ap_link and generate_ap_url at the same time.
And now...
This part:
$ap=accesspoint_by_id($id);
$device = device_by_id_cache($ap['device_id']);
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] ."/".
safename("arubaap-$ap[name].$ap[radio_number].nummonclients.rrd");
Should be done in auth.inc.php, a 'graph category', like "port" or "sensor" is a grouping of things where the id passed is related to the same thing.
Are the different RRDs optional? Is there scope to merge any of them? Each RRD file we write involves at least a read to read the pointer, and a write to write the pointer, on top of the data writing.
Why are you using numeric oids? this is weird :
$type =$aruba_apstats["1.3.6.1.4.1.14823.2.2.1.5.2.1.5.1.2.$radioid"][''];
And I just noticed, but the table should be called accesspoints, as the id field is "accesspoint_id" (it makes it easier to do a lot of other things later). It'd also be a good idea to make sure the same term is used everywhere in the code, i.e. ap vs accesspoint vs access_point, it gets hard to guess 
Could you also attach a couple of rows from your database from the accesspoints table, and the matching rrds in a .tar.gz? So i can put them on the dev install and see how it looks.
I don't think anyone else has every committed anything which creates a new entity category before. It's hard work :>
adam.
Using this on a master and slave aruba 3400 controller, when viewing the "Access points" tab on the controller host page it show "noauth" on the graphs and if you click on the graph you get a "You do are not authorized to view this page" message. I am logged in as a level 10 user on SVN revision 3835.
Here is the url that I am not permitted to view:
http://observium/graphs/to=1364490153/type=accesspoints_numasoclients/from=1363885353/
and screenshots of the errors here: http://dl.dropbox.com/u/5551808/Screenshots/s.png and http://dl.dropbox.com/u/5551808/Screenshots/t.png
If this needs to be a new bug report let me know.