mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
Added support for AirOS and AirFibre from UBNT
This commit is contained in:
@@ -57,6 +57,33 @@ $config['os'][$os]['over'][1]['text'] = "Processor Usage";
|
||||
$config['os'][$os]['over'][2]['graph'] = "device_ucd_memory";
|
||||
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
|
||||
|
||||
// Ubiquiti
|
||||
|
||||
$os = "unifi";
|
||||
$config['os'][$os]['text'] = "Ubiquiti UniFi";
|
||||
$config['os'][$os]['type'] = "wireless";
|
||||
$config['os'][$os]['icon'] = "ubiquiti";
|
||||
$config['os'][$os]['nobulk'] = 1;
|
||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||
|
||||
$os = "airos";
|
||||
$config['os'][$os]['text'] = "Ubiquiti AirOS";
|
||||
$config['os'][$os]['type'] = "network";
|
||||
$config['os'][$os]['icon'] = "ubiquiti";
|
||||
$config['os'][$os]['nobulk'] = 1;
|
||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||
|
||||
$os = "airos-af";
|
||||
$config['os'][$os]['text'] = "Ubiquiti AirFiber";
|
||||
$config['os'][$os]['type'] = "network";
|
||||
$config['os'][$os]['icon'] = "ubiquiti";
|
||||
$config['os'][$os]['nobulk'] = 1;
|
||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||
$config['os'][$os]['over'][1]['graph'] = "device_processor";
|
||||
|
||||
|
||||
// Linux-based OSes here please.
|
||||
|
||||
$os = "linux";
|
||||
@@ -580,12 +607,12 @@ $config['os'][$os]['text'] = "D-Link Access Point";
|
||||
$config['os'][$os]['type'] = "wireless";
|
||||
$config['os'][$os]['icon'] = "dlink";
|
||||
|
||||
$os = "ubiquitiap";
|
||||
$config['os'][$os]['text'] = "Ubiquiti Networks Wireless";
|
||||
$config['os'][$os]['type'] = "wireless";
|
||||
$config['os'][$os]['icon'] = "ubiquiti";
|
||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||
//$os = "ubiquitiap";
|
||||
//$config['os'][$os]['text'] = "Ubiquiti Networks Wireless";
|
||||
//$config['os'][$os]['type'] = "wireless";
|
||||
//$config['os'][$os]['icon'] = "ubiquiti";
|
||||
//$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||
//$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||
|
||||
$os = "axiscam";
|
||||
$config['os'][$os]['text'] = "AXIS Network Camera";
|
||||
@@ -1011,6 +1038,280 @@ foreach ($config['os'] as $this_os => $blah)
|
||||
|
||||
$config['graph_sections'] = array('general', 'system', 'firewall', 'netstats', 'wireless', 'storage', 'vpdn', 'load balancer');
|
||||
|
||||
|
||||
// Device - Wireless - AirMAX
|
||||
$config['graph_types']['device']['ubnt_airmax_WlStatStaCount'] = array(
|
||||
'section' => 'wireless',
|
||||
'order' => '0',
|
||||
'descr' => 'Wireless Clients',
|
||||
'file' => 'ubnt-airmax-mib.rrd',
|
||||
'colours' => 'reds',
|
||||
'unit_text' => 'Number',
|
||||
'ds' => array(
|
||||
'WlStatStaCount' => array('label' => 'Clients', 'draw' => 'LINE', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airmax_RadioDistance'] = array(
|
||||
'section' => 'wireless',
|
||||
'order' => '1',
|
||||
'descr' => 'Radio Distance',
|
||||
'file' => 'ubnt-airmax-mib.rrd',
|
||||
'colours' => 'blues',
|
||||
'unit_text' => 'Metres',
|
||||
'ds' => array(
|
||||
'RadioDistance' => array('label' => 'Distance', 'draw' => 'LINE', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airmax_RadioFreq'] = array(
|
||||
'section' => 'wireless',
|
||||
'order' => '2',
|
||||
'descr' => 'Radio Frequency',
|
||||
'file' => 'ubnt-airmax-mib.rrd',
|
||||
'colours' => 'reds',
|
||||
'unit_text' => 'Mhz',
|
||||
'ds' => array(
|
||||
'RadioFreq' => array('label' => 'Frequency', 'draw' => 'LINE', 'line' => TRUE, 'rra_min' => FALSE, 'rra_max' => FALSE, 'colour' => '3ca3c1')
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airmax_RadioTxPower'] = array(
|
||||
'section' => 'wireless',
|
||||
'order' => '3',
|
||||
'descr' => 'Radio Tx Power',
|
||||
'file' => 'ubnt-airmax-mib.rrd',
|
||||
'colours' => 'reds',
|
||||
'unit_text' => 'dBm',
|
||||
'ds' => array(
|
||||
'RadioTxPower' => array('label' => 'Tx Power', 'draw' => 'LINE', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airmax_RadioRssi_0'] = array(
|
||||
'section' => 'wireless',
|
||||
'order' => '4',
|
||||
'descr' => 'Radio Rssi Chain 0',
|
||||
'file' => 'ubnt-airmax-mib.rrd',
|
||||
'colours' => 'blues',
|
||||
'unit_text' => 'dBm',
|
||||
'ds' => array(
|
||||
'RadioRssi_0' => array('label' => 'RSSI', 'draw' => 'AREA', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airmax_RadioRssi_1'] = array(
|
||||
'section' => 'wireless',
|
||||
'order' => '5',
|
||||
'descr' => 'Radio Rssi Chain 1',
|
||||
'file' => 'ubnt-airmax-mib.rrd',
|
||||
'colours' => 'blues',
|
||||
'unit_text' => 'dBm',
|
||||
'ds' => array(
|
||||
'RadioRssi_1' => array('label' => 'RSSI', 'draw' => 'AREA', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airmax_WlStatSignal'] = array(
|
||||
'section' => 'wireless',
|
||||
'order' => '6',
|
||||
'descr' => 'Radio Signal',
|
||||
'file' => 'ubnt-airmax-mib.rrd',
|
||||
'colours' => 'reds',
|
||||
'unit_text' => 'dBm',
|
||||
'ds' => array(
|
||||
'WlStatSignal' => array('label' => 'Signal', 'draw' => 'LINE', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airmax_WlStatRssi'] = array(
|
||||
'section' => 'wireless',
|
||||
'order' => '7',
|
||||
'descr' => 'Radio Overall RSSI',
|
||||
'file' => 'ubnt-airmax-mib.rrd',
|
||||
'colours' => 'blues',
|
||||
'unit_text' => 'dBm',
|
||||
'ds' => array(
|
||||
'WlStatRssi' => array('label' => 'RSSI', 'draw' => 'AREA', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airmax_WlStatCcq'] = array(
|
||||
'section' => 'wireless',
|
||||
'order' => '8',
|
||||
'descr' => 'Radio CCQ',
|
||||
'file' => 'ubnt-airmax-mib.rrd',
|
||||
'colours' => 'blues',
|
||||
'unit_text' => 'Percent',
|
||||
'ds' => array(
|
||||
'WlStatCcq' => array('label' => 'CCQ', 'draw' => 'AREA', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airmax_WlStatNoiseFloor'] = array(
|
||||
'section' => 'wireless',
|
||||
'order' => '10',
|
||||
'descr' => 'Radio Noise Floor',
|
||||
'file' => 'ubnt-airmax-mib.rrd',
|
||||
'colours' => 'blues',
|
||||
'unit_text' => 'dBm',
|
||||
'ds' => array(
|
||||
'WlStatNoiseFloor' => array('label' => 'Noise', 'draw' => 'AREA', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airmax_WlStatTxRate'] = array(
|
||||
'section' => 'wireless',
|
||||
'order' => '11',
|
||||
'descr' => 'Radio Tx Rate',
|
||||
'file' => 'ubnt-airmax-mib.rrd',
|
||||
'colours' => 'reds',
|
||||
'unit_text' => 'mbps',
|
||||
'ds' => array(
|
||||
'WlStatTxRate' => array('label' => 'Tx Rate', 'draw' => 'LINE', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airmax_WlStatRxRate'] = array(
|
||||
'section' => 'wireless',
|
||||
'order' => '12',
|
||||
'descr' => 'Radio Rx Rate',
|
||||
'file' => 'ubnt-airmax-mib.rrd',
|
||||
'colours' => 'greens',
|
||||
'unit_text' => 'mbps',
|
||||
'ds' => array(
|
||||
'WlStatRxRate' => array('label' => 'Rx Rate', 'draw' => 'LINE', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airmax_AirMaxQuality'] = array(
|
||||
'section' => 'wireless',
|
||||
'order' => '13',
|
||||
'descr' => 'AirMax Quality',
|
||||
'file' => 'ubnt-airmax-mib.rrd',
|
||||
'colours' => 'greens',
|
||||
'unit_text' => 'Percent',
|
||||
'ds' => array(
|
||||
'AirMaxQuality' => array('label' => 'Quality', 'draw' => 'LINE', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airmax_AirMaxCapacity'] = array(
|
||||
'section' => 'wireless',
|
||||
'order' => '14',
|
||||
'descr' => 'AirMax Capacity',
|
||||
'file' => 'ubnt-airmax-mib.rrd',
|
||||
'colours' => 'greens',
|
||||
'unit_text' => 'Percent',
|
||||
'ds' => array(
|
||||
'AirMaxCapacity' => array('label' => 'Capacity', 'draw' => 'LINE', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
// Device - AirFIBER
|
||||
$config['graph_types']['device']['ubnt_airfiber_RadioFreqs'] = array(
|
||||
'section' => 'wireless',
|
||||
'order' => '0',
|
||||
'descr' => 'Radio Frequencies',
|
||||
'file' => 'ubnt-airfiber-mib.rrd',
|
||||
'colours' => 'blues',
|
||||
'unit_text' => 'Mhz',
|
||||
'ds' => array(
|
||||
'txFrequency' => array('label' => 'Tx Frequency', 'draw' => 'LINE', 'line' => TRUE),
|
||||
'rxFrequency' => array('label' => 'Rx Frequency', 'draw' => 'LINE', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airfiber_TxPower'] = array(
|
||||
'section' => 'wireless',
|
||||
'descr' => 'Radio Tx Power',
|
||||
'file' => 'ubnt-airfiber-mib.rrd',
|
||||
'colours' => 'reds',
|
||||
'unit_text' => 'dBm',
|
||||
'ds' => array(
|
||||
'txPower' => array('label' => 'Tx Power', 'draw' => 'LINE', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airfiber_LinkDist'] = array(
|
||||
'section' => 'wireless',
|
||||
'descr' => 'Link Distance',
|
||||
'file' => 'ubnt-airfiber-mib.rrd',
|
||||
'colours' => 'reds',
|
||||
'unit_text' => 'Metres',
|
||||
'ds' => array(
|
||||
'radioLinkDistM' => array('label' => 'Distance', 'draw' => 'LINE', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airfiber_Capacity'] = array(
|
||||
'section' => 'wireless',
|
||||
'descr' => 'Link Capacity',
|
||||
'file' => 'ubnt-airfiber-mib.rrd',
|
||||
'colours' => 'blues',
|
||||
'unit_text' => 'bps',
|
||||
'ds' => array(
|
||||
'rxCapacity' => array('label' => 'Rx Capacity', 'draw' => 'LINE', 'line' => TRUE),
|
||||
'txCapacity' => array('label' => 'Tx Capacity', 'draw' => 'LINE', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airfiber_RadioTemp'] = array(
|
||||
'section' => 'wireless',
|
||||
'descr' => 'Radio Temperatures',
|
||||
'file' => 'ubnt-airfiber-mib.rrd',
|
||||
'colours' => 'blues',
|
||||
'unit_text' => 'Deg C',
|
||||
'ds' => array(
|
||||
'radio0TempC' => array('label' => 'Radio 0 Temp', 'draw' => 'LINE', 'line' => TRUE),
|
||||
'radio1TempC' => array('label' => 'Radio 1 Temp', 'draw' => 'LINE', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airfiber_RFTotOctetsTx'] = array(
|
||||
'section' => 'wireless',
|
||||
'descr' => 'RF Total Octets Tx',
|
||||
'file' => 'ubnt-airfiber-mib.rrd',
|
||||
'colours' => 'reds',
|
||||
'unit_text' => 'Octets',
|
||||
'ds' => array(
|
||||
'txoctetsAll' => array('label' => 'Octets', 'draw' => 'AREA', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airfiber_RFTotPktsTx'] = array(
|
||||
'section' => 'wireless',
|
||||
'descr' => 'RF Total Packets Tx',
|
||||
'file' => 'ubnt-airfiber-mib.rrd',
|
||||
'colours' => 'reds',
|
||||
'unit_text' => 'Packets',
|
||||
'ds' => array(
|
||||
'txpktsAll' => array('label' => 'Packets', 'draw' => 'AREA', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airfiber_RFTotOctetsRx'] = array(
|
||||
'section' => 'wireless',
|
||||
'descr' => 'RF Total Octets Rx',
|
||||
'file' => 'ubnt-airfiber-mib.rrd',
|
||||
'colours' => 'greens',
|
||||
'unit_text' => 'Octets',
|
||||
'ds' => array(
|
||||
'rxoctetsAll' => array('label' => 'Octets', 'draw' => 'AREA', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['ubnt_airfiber_RFTotPktsRx'] = array(
|
||||
'section' => 'wireless',
|
||||
'descr' => 'RF Total Packets Rx',
|
||||
'file' => 'ubnt-airfiber-mib.rrd',
|
||||
'colours' => 'greens',
|
||||
'unit_text' => 'Packets',
|
||||
'ds' => array(
|
||||
'rxpktsAll' => array('label' => 'Packets', 'draw' => 'AREA', 'line' => TRUE)
|
||||
)
|
||||
);
|
||||
|
||||
$config['graph_types']['device']['wifi_clients']['section'] = 'wireless';
|
||||
$config['graph_types']['device']['wifi_clients']['order'] = '0';
|
||||
$config['graph_types']['device']['wifi_clients']['descr'] = 'Wireless Clients';
|
||||
|
||||
@@ -15,6 +15,13 @@ if (!$os)
|
||||
elseif (strstr($sysDescr, "endian")) { $os = "endian"; }
|
||||
elseif (preg_match("/Cisco Small Business/", $sysDescr)) { $os = "ciscosmblinux"; }
|
||||
elseif (strpos($entPhysicalMfgName, "QNAP") !== FALSE) { $os = "qnap"; }
|
||||
elseif (strstr($sysObjectId, ".1.3.6.1.4.1.10002.1") || strstr($sysObjectId, ".1.3.6.1.4.1.41112.1.4") || strpos(trim(snmp_get($device, "dot11manufacturerName.5", "-Osqnv", "IEEE802dot11-MIB")), "Ubiquiti") !== FALSE)
|
||||
{
|
||||
$os = "airos";
|
||||
if (strpos(trim(snmp_get($device, "dot11manufacturerProductName.5", "-Osqnv", "IEEE802dot11-MIB")), "UAP") !== FALSE) { $os = "unifi"; }
|
||||
elseif (strpos(trim(snmp_get($device, "dot11manufacturerProductName.2", "-Osqnv", "IEEE802dot11-MIB")), "UAP") !== FALSE) { $os = "unifi"; }
|
||||
elseif (trim(snmp_get($device, "fwVersion.1", "-Osqnv", "UBNT-AirFIBER-MIB")) != '') { $os = "airos-af"; }
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check for Synology DSM
|
||||
|
||||
@@ -241,4 +241,82 @@ function poll_device($device, $options)
|
||||
}
|
||||
}
|
||||
|
||||
function poll_mib_def($device, $mib_name_table, $mib_subdir, $mib_oids, $mib_graphs, &$graphs)
|
||||
{
|
||||
|
||||
global $config;
|
||||
|
||||
echo("This is mag_poll_mib_def Processing\n");
|
||||
$rrd = array();
|
||||
$mib = NULL;
|
||||
$table = NULL;
|
||||
|
||||
list($mib,$table) = explode(":", $mib_name_table, 2);
|
||||
|
||||
//$mib_dirs = mib_dirs($mib_subdir);
|
||||
|
||||
$rrd_file = strtolower(safename($mib)).'.rrd';
|
||||
|
||||
$rrdcreate = '--step 300 ';
|
||||
$oidglist = array();
|
||||
foreach ($mib_oids as $oid => $param)
|
||||
{
|
||||
$oidindex = $param[0];
|
||||
$oiddsname = $param[1];
|
||||
$oiddsdesc = $param[2];
|
||||
$oiddstype = $param[3];
|
||||
|
||||
if (strlen($oiddsname) > 19) { $oiddsname = truncate($oiddsname, 19, ''); }
|
||||
$rrdcreate .= ' DS:'.$oiddsname.':'.$oiddstype.':600:U:100000000000';
|
||||
|
||||
if ($oidindex != '')
|
||||
{
|
||||
$fulloid = $oid.'.'.$oidindex;
|
||||
} else {
|
||||
$fulloid = $oid;
|
||||
}
|
||||
|
||||
// Add to oid GET list
|
||||
$oidglist[] = $fulloid;
|
||||
|
||||
}
|
||||
|
||||
// Implde for LibreNMS Version
|
||||
$oidilist = implode(" ",$oidglist);
|
||||
|
||||
$snmpdata = snmp_get_multi($device, $oidilist, "-OQUs", $mib);
|
||||
if (isset($GLOBALS['exec_status']['exitcode']) && $GLOBALS['exec_status']['exitcode'] !== 0)
|
||||
{
|
||||
print_debug(" ERROR, bad snmp response");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$rrdupdate = 'N';
|
||||
foreach ($oidglist as $fulloid)
|
||||
{
|
||||
list($splitoid, $splitindex) = explode(".", $fulloid, 2);
|
||||
if (is_numeric($snmpdata[$splitindex][$splitoid]))
|
||||
{
|
||||
$rrdupdate .= ':'.$snmpdata[$splitindex][$splitoid];
|
||||
} else {
|
||||
$rrdupdate .= ':U';
|
||||
}
|
||||
}
|
||||
|
||||
$rrdfilename = $config['rrd_dir']."/".$device['hostname']."/".$rrd_file;
|
||||
|
||||
if (!is_file($rrdfilename))
|
||||
{
|
||||
rrdtool_create($rrdfilename, $rrdcreate." ".$config['rrd_rra']);
|
||||
}
|
||||
rrdtool_update($rrdfilename, $rrdupdate);
|
||||
|
||||
foreach ($mib_graphs as $graphtoenable)
|
||||
{
|
||||
$graphs[$graphtoenable] = TRUE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @copyright (C) 2015 Mark Gibbons
|
||||
*
|
||||
*/
|
||||
|
||||
// Polling of AirFIBER MIB AP for Ubiquiti AirFIBER Radios
|
||||
//
|
||||
// UBNT-AirFIBER-MIB
|
||||
|
||||
echo(" UBNT-AirFIBER-MIB ");
|
||||
|
||||
// $mib_oids (oidindex,dsname,dsdescription,dstype)
|
||||
|
||||
$mib_oids = array(
|
||||
'txFrequency' => array('1', 'txFrequency', 'Tx Frequency', 'GAUGE'),
|
||||
'rxFrequency' => array('1', 'rxFrequency', 'Rx Frequency', 'GAUGE'),
|
||||
'txPower' => array('1', 'txPower', 'Tx Power', 'GAUGE'),
|
||||
'radioLinkDistM' => array('1', 'radioLinkDistM', 'Link Distance', 'GAUGE'),
|
||||
'rxCapacity' => array('1', 'rxCapacity', 'Rx Capacity', 'GAUGE'),
|
||||
'txCapacity' => array('1', 'txCapacity', 'Tx Capacity', 'GAUGE'),
|
||||
'radio0TempC' => array('1', 'radio0TempC', 'Radio 0 Temp', 'GAUGE'),
|
||||
'radio1TempC' => array('1', 'radio1TempC', 'Radio 1 Temp', 'GAUGE'),
|
||||
'txOctetsOK' => array('1', 'txOctetsOK', 'Tx Octets OK', 'COUNTER'),
|
||||
'rxOctetsOK' => array('1', 'rxOctetsOK', 'Rx Octets OK', 'COUNTER'),
|
||||
'rxValidUnicastFrames' => array('1', 'rxValUnicastFrms', 'TODOa', 'COUNTER'),
|
||||
'rxValidMulticastFrames' => array('1', 'rxValMulticastFrms', 'TODOa', 'COUNTER'),
|
||||
'rxValidBroadcastFrames' => array('1', 'rxValBroadcastFrms', 'TODO', 'COUNTER'),
|
||||
'txValidUnicastFrames' => array('1', 'txValUnicastFrms', 'TODO', 'COUNTER'),
|
||||
'txValidMulticastFrames' => array('1', 'txValMulticastFrms', 'TODO', 'COUNTER'),
|
||||
'txValidBroadcastFrames' => array('1', 'txValBroadcastFrms', 'TODO', 'COUNTER'),
|
||||
'rxTotalOctets' => array('1', 'rxTotalOctets', 'TODO', 'COUNTER'),
|
||||
'rxTotalFrames' => array('1', 'rxTotalFrms', 'TODO', 'COUNTER'),
|
||||
'rx64BytePackets' => array('1', 'rx64BytePkts', 'TODO', 'COUNTER'),
|
||||
'rx65-127BytePackets' => array('1', 'rx65-127BytePkts', 'TODO', 'COUNTER'),
|
||||
'rx128-255BytePackets' => array('1', 'rx128-255BytePkts', 'TODO', 'COUNTER'),
|
||||
'rx256-511BytePackets' => array('1', 'rx256-511BytePkts', 'TODO', 'COUNTER'),
|
||||
'rx512-1023BytePackets' => array('1', 'rx512-1023BytePkts', 'TODO', 'COUNTER'),
|
||||
'rx1024-1518BytesPackets' => array('1', 'rx1024-1518BytePkts', 'TODO', 'COUNTER'),
|
||||
'rx1519PlusBytePackets' => array('1', 'rx1519PlusBytePkts', 'TODO', 'COUNTER'),
|
||||
'txoctetsAll' => array('1', 'txoctetsAll', 'TODO', 'COUNTER'),
|
||||
'txpktsAll' => array('1', 'txpktsAll', 'TODO', 'COUNTER'),
|
||||
'rxoctetsAll' => array('1', 'rxoctetsAll', 'TODO', 'COUNTER'),
|
||||
'rxpktsAll' => array('1', 'rxpktsAll', 'TODO', 'COUNTER'),
|
||||
);
|
||||
|
||||
|
||||
$mib_graphs = array('ubnt_airfiber_RadioFreqs', 'ubnt_airfiber_TxPower', 'ubnt_airfiber_LinkDist', 'ubnt_airfiber_Capacity', 'ubnt_airfiber_RadioTemp',
|
||||
'AF1', 'AF2', 'AF3', 'AF4', 'AF5',
|
||||
'ubnt_airfiber_RFTotOctetsTx', 'ubnt_airfiber_RFTotPktsTx', 'ubnt_airfiber_RFTotOctetsRx', 'ubnt_airfiber_RFTotPktsRx');
|
||||
|
||||
unset($graph, $oids, $oid);
|
||||
|
||||
poll_mib_def($device, 'UBNT-AirFIBER-MIB:UBNT', 'ubiquiti', $mib_oids, $mib_graphs, $graphs);
|
||||
|
||||
// EOF
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @copyright (C) 2015 Mark Gibbons
|
||||
*
|
||||
*/
|
||||
|
||||
// Polling of Airmax MIB AP for Ubiquiti Airmax Radios
|
||||
//
|
||||
// UBNT-AirMAX-MIB
|
||||
|
||||
echo(" UBNT-AirMAX-MIB ");
|
||||
|
||||
// Check If It Is A Device that supports latest Airmax MIB By Trying To Read Frequency
|
||||
//if (substr($device['version'],0,3) == "5.6")
|
||||
if (is_numeric(snmp_get($device, "ubntRadioFreq.1", "-OUqnv", "UBNT-AirMAX-MIB", $config['mib_dir'])))
|
||||
{
|
||||
|
||||
// $mib_oids (oidindex,dsname,dsdescription,dstype)
|
||||
|
||||
$mib_oids = array(
|
||||
'ubntRadioFreq' => array('1', 'RadioFreq', 'Frequency', 'GAUGE'),
|
||||
'ubntRadioTxPower' => array('1', 'RadioTxPower', 'Tx Power', 'GAUGE'),
|
||||
'ubntRadioDistance' => array('1', 'RadioDistance', 'Distance', 'GAUGE'),
|
||||
'ubntRadioRssi.1.1' => array('', 'RadioRssi_0', 'RSSI Chain 0', 'GAUGE'),
|
||||
'ubntRadioRssi.1.2' => array('', 'RadioRssi_1', 'RSSI Chain 1', 'GAUGE'),
|
||||
'ubntWlStatSignal' => array('1', 'WlStatSignal', 'Signal', 'GAUGE'),
|
||||
'ubntWlStatRssi' => array('1', 'WlStatRssi', 'Overall RSSI', 'GAUGE'),
|
||||
'ubntWlStatCcq' => array('1', 'WlStatCcq', 'Transmit CCQ', 'GAUGE'),
|
||||
'ubntWlStatNoiseFloor' => array('1', 'WlStatNoiseFloor', 'Noise Floor', 'GAUGE'),
|
||||
'ubntWlStatTxRate' => array('1', 'WlStatTxRate', 'Tx Rate', 'GAUGE'),
|
||||
'ubntWlStatRxRate' => array('1', 'WlStatRxRate', 'Rx Rate', 'GAUGE'),
|
||||
'ubntWlStatStaCount' => array('1', 'WlStatStaCount', 'Sta Count', 'GAUGE'),
|
||||
'ubntAirMaxQuality' => array('1', 'AirMaxQuality', 'AirMax Quality', 'GAUGE'),
|
||||
'ubntAirMaxCapacity' => array('1', 'AirMaxCapacity', 'AirMax Capacity', 'GAUGE'),
|
||||
);
|
||||
|
||||
$mib_graphs = array();
|
||||
|
||||
// Build Graph List Array
|
||||
|
||||
if (1 == 1)
|
||||
{
|
||||
|
||||
// Is It An AP
|
||||
if (stristr(snmp_get($device, "ubntRadioMode.1", "-OUqnv", "UBNT-AirMAX-MIB", $config['mib_dir']),"ap"))
|
||||
{
|
||||
// Yes - Add Station Count Graph
|
||||
array_push($mib_graphs, 'ubnt_airmax_WlStatStaCount');
|
||||
}
|
||||
|
||||
// Add Common Graphs
|
||||
array_push($mib_graphs, 'ubnt_airmax_RadioFreq', 'ubnt_airmax_RadioTxPower', 'ubnt_airmax_RadioDistance', 'ubnt_airmax_RadioRssi_0', 'ubnt_airmax_RadioRssi_1',
|
||||
'ubnt_airmax_WlStatSignal', 'ubnt_airmax_WlStatRssi', 'ubnt_airmax_WlStatCcq', 'ubnt_airmax_WlStatNoiseFloor', 'ubnt_airmax_WlStatTxRate',
|
||||
'ubnt_airmax_WlStatRxRate');
|
||||
// Is Airmax Enabled?
|
||||
if (snmp_get($device, "ubntAirMaxEnabled.1", "-OUqnv", "UBNT-AirMAX-MIB", $config['mib_dir']) == 'true')
|
||||
{
|
||||
// Check To See If It Is An AC Device - Returns Airmax Capacity of 0
|
||||
if (snmp_get($device, "ubntAirMaxCapacity.1", "-OUqnv", "UBNT-AirMAX-MIB", $config['mib_dir']) != 0)
|
||||
{
|
||||
//No - Not AC - add AirMax Graphs
|
||||
array_push($mib_graphs, 'ubnt_airmax_AirMaxQuality', 'ubnt_airmax_AirMaxCapacity');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($graph, $oids, $oid);
|
||||
|
||||
poll_mib_def($device, 'UBNT-AirMAX-MIB:UBNT', 'ubiquiti', $mib_oids, $mib_graphs, $graphs);
|
||||
|
||||
// EOF
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
$hardware = "Ubiquiti AF ".trim(snmp_get($device, "dot11manufacturerProductName.5", "-Ovq", "IEEE802dot11-MIB", "/opt/librenms/mibs:/opt/librenms/mibs/rfc:/opt/librenms/mibs/net-snmp:/opt/librenms/mibs/ubiquiti"));
|
||||
|
||||
$version = trim(snmp_get($device, "dot11manufacturerProductVersion.5", "-Ovq", "IEEE802dot11-MIB", "/opt/librenms/mibs:/opt/librenms/mibs/rfc:/opt/librenms/mibs/net-snmp:/opt/librenms/mibs/ubiquiti"));
|
||||
list(, $version) = preg_split('/\.v/',$version);
|
||||
|
||||
// EOF
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
$hardware = "Ubiquiti ".trim(snmp_get($device, "dot11manufacturerProductName.5", "-Ovq", "IEEE802dot11-MIB"));
|
||||
|
||||
$version = trim(snmp_get($device, "dot11manufacturerProductVersion.5", "-Ovq", "IEEE802dot11-MIB"));
|
||||
list(, $version) = preg_split('/\.v/',$version);
|
||||
|
||||
// EOF
|
||||
@@ -1,8 +1,24 @@
|
||||
<?php
|
||||
|
||||
if ($device['type'] == 'network' || $device['type'] == 'firewall')
|
||||
if ($device['type'] == 'network' || $device['type'] == 'firewall' || $device['type'] == 'wireless')
|
||||
{
|
||||
echo("Wireless: ");
|
||||
echo("Wireless: MAG\n");
|
||||
|
||||
if ($device['os'] == 'airos')
|
||||
{
|
||||
|
||||
echo("It Is Airos\n");
|
||||
include("includes/polling/mib/ubnt-airmax-mib.inc.php");
|
||||
|
||||
}
|
||||
|
||||
if ($device['os'] == 'airos-af')
|
||||
{
|
||||
|
||||
echo("It Is AirFIBER\n");
|
||||
include("includes/polling/mib/ubnt-airfiber-mib.inc.php");
|
||||
|
||||
}
|
||||
|
||||
///# GENERIC FRAMEWORK, FILLING VARIABLES
|
||||
if ($device['os'] == 'airport')
|
||||
|
||||
Reference in New Issue
Block a user