mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Add mib-based polling of Unifi Wifi Capacity
This commit is contained in:
35
html/includes/graphs/device/ubnt_unifi_RadioCu_0.inc.php
Normal file
35
html/includes/graphs/device/ubnt_unifi_RadioCu_0.inc.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
$rrd_filename = rrd_name($device['hostname'], 'ubnt-unifi-mib');
|
||||
|
||||
$colours = 'mixed';
|
||||
$unit_text = '% used';
|
||||
$scale_min = '0';
|
||||
$scale_max = '100';
|
||||
$rigid = true;
|
||||
$print_total = true;
|
||||
$simple_rrd = true;
|
||||
|
||||
if (is_file($rrd_filename)) {
|
||||
$rrd_list = array(
|
||||
array(
|
||||
'ds' => 'Radio0OtherBss',
|
||||
'filename' => $rrd_filename,
|
||||
'descr' => 'Radio0 Others',
|
||||
),
|
||||
array(
|
||||
'ds' => 'Radio0CuSelfRx',
|
||||
'filename' => $rrd_filename,
|
||||
'descr' => 'Radio0 RX',
|
||||
),
|
||||
array(
|
||||
'ds' => 'Radio0CuSelfTx',
|
||||
'filename' => $rrd_filename,
|
||||
'descr' => 'Radio0 TX',
|
||||
),
|
||||
);
|
||||
} else {
|
||||
echo "file missing: $rrd_filename";
|
||||
}
|
||||
|
||||
require 'includes/graphs/generic_multi.inc.php';
|
35
html/includes/graphs/device/ubnt_unifi_RadioCu_1.inc.php
Normal file
35
html/includes/graphs/device/ubnt_unifi_RadioCu_1.inc.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
$rrd_filename = rrd_name($device['hostname'], 'ubnt-unifi-mib');
|
||||
|
||||
$colours = 'mixed';
|
||||
$unit_text = '% used';
|
||||
$scale_min = '0';
|
||||
$scale_max = '100';
|
||||
$rigid = true;
|
||||
$print_total = true;
|
||||
$simple_rrd = true;
|
||||
|
||||
if (is_file($rrd_filename)) {
|
||||
$rrd_list = array(
|
||||
array(
|
||||
'ds' => 'Radio1OtherBss',
|
||||
'filename' => $rrd_filename,
|
||||
'descr' => 'Radio1 Others',
|
||||
),
|
||||
array(
|
||||
'ds' => 'Radio1CuSelfRx',
|
||||
'filename' => $rrd_filename,
|
||||
'descr' => 'Radio1 RX',
|
||||
),
|
||||
array(
|
||||
'ds' => 'Radio1CuSelfTx',
|
||||
'filename' => $rrd_filename,
|
||||
'descr' => 'Radio1 TX',
|
||||
),
|
||||
);
|
||||
} else {
|
||||
echo "file missing: $rrd_filename";
|
||||
}
|
||||
|
||||
require 'includes/graphs/generic_multi.inc.php';
|
@@ -2288,6 +2288,15 @@ $config['graph_types']['device']['ubnt_airfiber_RFTotPktsRx']['section'] = 'wire
|
||||
$config['graph_types']['device']['ubnt_airfiber_RFTotPktsRx']['order'] = '7';
|
||||
$config['graph_types']['device']['ubnt_airfiber_RFTotPktsRx']['descr'] = 'RF Total Packets Rx';
|
||||
|
||||
// Unifi Support
|
||||
$config['graph_types']['device']['ubnt_unifi_RadioCu_0']['section'] = 'wireless';
|
||||
$config['graph_types']['device']['ubnt_unifi_RadioCu_0']['order'] = '0';
|
||||
$config['graph_types']['device']['ubnt_unifi_RadioCu_0']['descr'] = 'Radio0 Capacity Used';
|
||||
|
||||
$config['graph_types']['device']['ubnt_unifi_RadioCu_1']['section'] = 'wireless';
|
||||
$config['graph_types']['device']['ubnt_unifi_RadioCu_1']['order'] = '1';
|
||||
$config['graph_types']['device']['ubnt_unifi_RadioCu_1']['descr'] = 'Radio1 Capacity Used';
|
||||
|
||||
// Siklu support
|
||||
$config['graph_types']['device']['siklu_rfAverageRssi']['section'] = 'wireless';
|
||||
$config['graph_types']['device']['siklu_rfAverageRssi']['order'] = '0';
|
||||
|
69
includes/polling/mib/ubnt-unifi-mib.inc.php
Normal file
69
includes/polling/mib/ubnt-unifi-mib.inc.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
// Polling of UniFi MIB AP for Ubiquiti Unifi Radios
|
||||
// based on Airfiber MIB work of Mark Gibbons
|
||||
|
||||
// UBNT-UniFi-MIB
|
||||
echo ' UBNT-UniFi-MIB ';
|
||||
|
||||
// $mib_oids (oidindex,dsname,dsdescription,dstype)
|
||||
$mib_oids = array(
|
||||
'unifiRadioCuTotal.0' => array(
|
||||
'',
|
||||
'Radio0CuTotal',
|
||||
'Radio0 Channel Utilized',
|
||||
'GAUGE',
|
||||
),
|
||||
'unifiRadioCuTotal.1' => array(
|
||||
'',
|
||||
'Radio1CuTotal',
|
||||
'Radio1 Channel Utilized',
|
||||
'GAUGE',
|
||||
),
|
||||
'unifiRadioCuSelfRx.0' => array(
|
||||
'',
|
||||
'Radio0CuSelfRx',
|
||||
'Radio0 Channel Utilized Rx',
|
||||
'GAUGE',
|
||||
),
|
||||
'unifiRadioCuSelfRx.1' => array(
|
||||
'',
|
||||
'Radio1CuSelfRx',
|
||||
'Radio1 Channel Utilized Rx',
|
||||
'GAUGE',
|
||||
),
|
||||
'unifiRadioCuSelfTx.0' => array(
|
||||
'',
|
||||
'Radio0CuSelfTx',
|
||||
'Radio0 Channel Utilized Tx',
|
||||
'GAUGE',
|
||||
),
|
||||
'unifiRadioCuSelfTx.1' => array(
|
||||
'',
|
||||
'Radio1CuSelfTx',
|
||||
'Radio1 Channel Utilized Tx',
|
||||
'GAUGE',
|
||||
),
|
||||
'unifiRadioOtherBss.0' => array(
|
||||
'',
|
||||
'Radio0OtherBss',
|
||||
'Radio0 Channel Utilized by Others',
|
||||
'GAUGE',
|
||||
),
|
||||
'unifiRadioOtherBss.1' => array(
|
||||
'',
|
||||
'Radio1OtherBss',
|
||||
'Radio1 Channel Utilized by Others',
|
||||
'GAUGE',
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
$mib_graphs = array(
|
||||
'ubnt_unifi_RadioCu_0',
|
||||
'ubnt_unifi_RadioCu_1',
|
||||
);
|
||||
|
||||
unset($graph, $oids, $oid);
|
||||
|
||||
poll_mib_def($device, 'UBNT-UniFi-MIB:UBNT', 'ubiquiti', $mib_oids, $mib_graphs, $graphs);
|
||||
// EOF
|
@@ -77,6 +77,7 @@ if ($device['type'] == 'network' || $device['type'] == 'firewall' || $device['ty
|
||||
}
|
||||
|
||||
echo (($wificlients1 + 0).' clients on Radio0, '.($wificlients2 + 0)." clients on Radio1\n");
|
||||
include 'includes/polling/mib/ubnt-unifi-mib.inc.php';
|
||||
}
|
||||
|
||||
if (isset($wificlients1) && $wificlients1 != '') {
|
||||
|
Reference in New Issue
Block a user