From 04faec2d166e73fdef8f69e36052801e5cad3030 Mon Sep 17 00:00:00 2001 From: Frederik Mogensen Date: Mon, 28 Sep 2015 23:10:36 +0200 Subject: [PATCH] Added graphs for number of APs and number of Clients attached to the APs --- .../graphs/device/ciscowlc_numaps.inc.php | 20 ++++++++ .../graphs/device/ciscowlc_numclients.inc.php | 21 ++++++++ includes/definitions.inc.php | 4 ++ includes/polling/os/ciscowlc.inc.php | 51 +++++++++++++++++++ 4 files changed, 96 insertions(+) create mode 100644 html/includes/graphs/device/ciscowlc_numaps.inc.php create mode 100644 html/includes/graphs/device/ciscowlc_numclients.inc.php diff --git a/html/includes/graphs/device/ciscowlc_numaps.inc.php b/html/includes/graphs/device/ciscowlc_numaps.inc.php new file mode 100644 index 0000000000..c8507252f2 --- /dev/null +++ b/html/includes/graphs/device/ciscowlc_numaps.inc.php @@ -0,0 +1,20 @@ + $value) { + $numClients += $value['bsnApIfNoOfUsers']; +} + +$rrdfile = $host_rrd.'/ciscowlc'.safename('.rrd'); +if (!is_file($rrdfile)) { + rrdtool_create($rrdfile, ' --step 300 DS:NUMAPS:GAUGE:600:0:12500000000 DS:NUMCLIENTS:GAUGE:600:0:12500000000 '.$config['rrd_rra']); +} + +$fields = array( + 'NUMAPS' => $numAccessPoints, + 'NUMCLIENTS' => $numClients +); +$ret = rrdtool_update($rrdfile, $fields); + +// also save the info about how many clients in the same place as the wireless module +$wificlientsrrd = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename('wificlients-radio1.rrd'); + +if (!is_file($wificlientsrrd)) { + rrdtool_create($wificlientsrrd, '--step 300 DS:wificlients:GAUGE:600:-273:10000 '.$config['rrd_rra']); +} + +$fields = array( + 'wificlients' => $numClients +); + +rrdtool_update($wificlientsrrd, $fields); +$graphs['wifi_clients'] = true;