I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md.

This commit is contained in:
NetworkNub
2016-10-18 10:03:05 -04:00
24 changed files with 2559 additions and 6 deletions

View File

@@ -140,6 +140,8 @@ LibreNMS contributors:
- Layne Breitkreutz <github@thelenon.com> (Gorian)
- Karl Shea <karl@karlshea.com> (karlshea)
- Justin Settle <jus10@partlycloudy.org> (jquagga)
- Alexander Kratzsch <klump@devrandom.se> (klump)
- Joseph Eames <j.eames@outlook.com> (j-ems)
- Eric Conroy <eric@conroy.co> (NetworkNub)
[1]: http://observium.org/ "Observium web site"

28
doc/General/Security.md Normal file
View File

@@ -0,0 +1,28 @@
source: General/Security.md
# Security
### General
Like any good software we take security seriously. However, bugs do make it into the software
along with the history of the code base we inherited. It's how we deal with identified vulnerabilities
that should show that we take things seriously.
### Securing your install
As with any system of this nature, we highly recommend that you restrict access to the install via
a firewall or VPN.
It is also highly recommended that the Web interface is protected with an SSL certificate such as one
provided by [LetsEncrypt](http://www.letsencrypt.org).
Please ensure you keep your install [up to date](Updating.md).
### Reporting vulnerabilities
Like anyone, we appreciate the work people put in to find flaws in software and welcome anyone
to do so with LibreNMS, this will lead to better quality and more secure software for everyone.
If you think you've found a vulnerability and want to discuss it with some of the core team then
you can email us at [team@librenms.org](team@librenms.org) and we will endeavour to get back to
as quick as we can, this is usually within 24 hours.
We are happy to attribute credit to the findings but we ask that we're given a chance to patch
any vulnerability before public disclosure so that our users can update as soon as a fix is
available.

View File

@@ -59,7 +59,7 @@ if (isset($_REQUEST['search'])) {
foreach ($results as $result) {
$name = $result['hostname'];
if ($result['sysName'] != $name && !empty($result['sysName'])) {
if ($_REQUEST['map'] != 1 && $result['sysName'] != $name && !empty($result['sysName'])) {
$name .= ' ('.$result['sysName'].') ';
}
if ($result['disabled'] == 1) {

View 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 (rrdtool_check_rrd_exists($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';

View 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 (rrdtool_check_rrd_exists($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';

View File

@@ -1451,6 +1451,13 @@ $config['os'][$os]['icon'] = 'mge';
$config['os'][$os]['over'][0]['graph'] = 'device_current';
$config['os'][$os]['over'][0]['text'] = 'Current';
$os = 'sinetica';
$config['os'][$os]['text'] = 'Sinetica UPS';
$config['os'][$os]['group'] = 'ups';
$config['os'][$os]['type'] = 'power';
$config['os'][$os]['over'][0]['graph'] = 'device_current';
$config['os'][$os]['over'][0]['text'] = 'Current';
$os = 'mgepdu';
$config['os'][$os]['text'] = 'MGE PDU';
$config['os'][$os]['type'] = 'power';
@@ -2288,6 +2295,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';

View File

@@ -31,7 +31,7 @@ if ($config['enable_libvirt'] == '1' && $device['os'] == 'linux') {
if ($ssh_ok || !strstr($method, 'ssh')) {
// Fetch virtual machine list
unset($domlist);
exec($config['virsh'].' -c '.$uri.' list', $domlist);
exec($config['virsh'].' -rc '.$uri.' list', $domlist);
foreach ($domlist as $dom) {
list($dom_id,) = explode(' ', trim($dom), 2);
@@ -39,8 +39,9 @@ if ($config['enable_libvirt'] == '1' && $device['os'] == 'linux') {
if (is_numeric($dom_id)) {
// Fetch the Virtual Machine information.
unset($vm_info_array);
exec($config['virsh'].' -c '.$uri.' dumpxml '.$dom_id, $vm_info_array);
exec($config['virsh'].' -rc '.$uri.' dumpxml '.$dom_id, $vm_info_array);
// Example xml:
// <domain type='kvm' id='3'>
// <name>moo.example.com</name>
// <uuid>48cf6378-6fd5-4610-0611-63dd4b31cfd6</uuid>
@@ -54,6 +55,8 @@ if ($config['enable_libvirt'] == '1' && $device['os'] == 'linux') {
// <features>
// <acpi/>
// (...)
// See spec at https://libvirt.org/formatdomain.html
// Convert array to string
unset($vm_info_xml);
foreach ($vm_info_array as $line) {
@@ -66,10 +69,49 @@ if ($config['enable_libvirt'] == '1' && $device['os'] == 'linux') {
$vmwVmDisplayName = $xml->name;
$vmwVmGuestOS = '';
// libvirt does not supply this
$vmwVmMemSize = ($xml->currentMemory / 1024);
exec($config['virsh'].' -c '.$uri.' domstate '.$dom_id, $vm_state);
exec($config['virsh'].' -rc '.$uri.' domstate '.$dom_id, $vm_state);
$vmwVmState = ucfirst($vm_state[0]);
$vmwVmCpus = $xml->vcpu;
$vmwVmCpus = $xml->vcpu['current'];
if (!isset($vmwVmCpus)) {
$vmwVmCpus = $xml->vcpu;
}
$vmwVmMemSize = $xml->memory;
// Convert memory size to MiB
switch ($vmwVmMemSize['unit']) {
case 'T':
case 'TiB':
$vmwVmMemSize = $vmwVmMemSize * 1048576;
break;
case 'TB':
$vmwVmMemSize = $vmwVmMemSize * 1000000;
break;
case 'G':
case 'GiB':
$vmwVmMemSize = $vmwVmMemSize * 1024;
break;
case 'GB':
$vmwVmMemSize = $vmwVmMemSize * 1000;
break;
case 'M':
case 'MiB':
$vmwVmMemSize = $vmwVmMemSize;
break;
case 'MB':
$vmwVmMemSize = $vmwVmMemSize * 1000000 / 1048576;
break;
case 'KB':
$vmwVmMemSize = $vmwVmMemSize / 1000;
break;
case 'b':
case 'bytes':
$vmwVmMemSize = $vmwVmMemSize / 1048576;
break;
default:
// KiB or k or no value
$vmwVmMemSize = $vmwVmMemSize / 1024;
break;
}
// Check whether the Virtual Machine is already known for this host.
$result = dbFetchRow("SELECT * FROM `vminfo` WHERE `device_id` = ? AND `vmwVmVMID` = ? AND `vm_type` = 'libvirt'", array($device['device_id'], $dom_id));

View File

@@ -0,0 +1,28 @@
<?php
/**
* sinetica.inc.php
*
* LibreNMS os discovery module for Sinetica
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Neil Lathwood
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
if (starts_with($sysDescr, 'Sinetica UPSController.')) {
$os = 'sinetica';
}

View File

@@ -0,0 +1,55 @@
<?php
/**
* sinecta.php
*
* -Description-
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
if ($device['os'] == 'sinetica') {
$charge_oid = '.1.3.6.1.4.1.13891.101.2.4.0';
$charge = snmp_get($device, $charge_oid, '-Osqnv');
if (!empty($charge)) {
$type = 'sinetica';
$index = 0;
$limit = 100;
$lowlimit = 0;
$lowwarnlimit = 10;
$descr = 'Battery Charge';
discover_sensor(
$valid['sensor'],
'charge',
$device,
$charge_oid,
$index,
$type,
$descr,
1,
1,
$lowlimit,
$lowwarnlimit,
null,
$limit,
$charge
);
}
}

View File

@@ -0,0 +1,76 @@
<?php
/**
* sinetica.inc.php
*
* -Description-
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
if ($device['os'] == 'sinetica') {
$battery_oid = '.1.3.6.1.4.1.13891.101.2.6.0';
$battery_current = snmp_get($device, $battery_oid, '-Oqv');
if (!empty($battery_current) || $battery_current == 0) {
$divisor = 10;
$current = $battery_current / $divisor;
$descr = 'Battery';
$type = 'sinetica';
$index = '2.6.0';
discover_sensor($valid['sensor'], 'current', $device, $battery_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
}
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.3', array());
foreach ($oids as $oid => $data) {
$current_id = substr($oid, strrpos($oid, '.') + 1);
$current_oid = ".$oid";
$descr = 'Output';
if (count($oids) > 1) {
$descr .= " Phase $current_id";
}
$divisor = 100;
$current = current($data) / $divisor;
$type = 'sinetica';
$index = '4.4.1.3.'.$current_id;
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
}
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.3.3.1.4', array());
foreach ($oids as $oid => $data) {
$current_id = substr($oid, strrpos($oid, '.') + 1);
$current_oid = ".$oid";
$descr = 'Input';
if (count($oids) > 1) {
$descr .= " Phase $current_id";
}
$divisor = 10;
$current = current($data) / $divisor;
$type = 'sinetica';
$index = '3.3.1.3.'.$current_id;
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
}
}//end if

View File

@@ -0,0 +1,71 @@
<?php
/**
* sinetica.inc.php
*
* -Description-
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
if ($device['os'] == 'sinetica') {
$output_oid = '.1.3.6.1.4.1.13891.101.4.2.0';
$output_current = snmp_get($device, $output_oid, '-Oqv');
if (!empty($output_current) || $output_current == 0) {
$divisor = 10;
$current = $output_current / $divisor;
$descr = 'Output';
$type = 'sinetica';
$index = '4.2.0';
discover_sensor($valid['sensor'], 'frequency', $device, $output_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
}
$bypass_oid = '.1.3.6.1.4.1.13891.101.5.1.0';
$bypass_current = snmp_get($device, $bypass_oid, '-Oqv');
if (!empty($bypass_current) || $bypass_current == 0) {
$divisor = 10;
$current = $bypass_current / $divisor;
$descr = 'Bypass';
$type = 'sinetica';
$index = '5.1.0';
discover_sensor($valid['sensor'], 'frequency', $device, $bypass_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
}
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.3.3.1.2', array());
foreach ($oids as $oid => $data) {
$current_id = substr($oid, strrpos($oid, '.') + 1);
$current_oid = ".$oid";
$descr = 'Input';
if (count($oids) > 1) {
$descr .= " Phase $current_id";
}
$divisor = 10;
$current = current($data) / $divisor;
$type = 'sinetica';
$index = '3.3.1.2.'.$current_id;
discover_sensor($valid['sensor'], 'frequency', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
}
}//end if

View File

@@ -0,0 +1,44 @@
<?php
/**
* sinetica.inc.php
*
* -Description-
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
if ($device['os'] == 'sinetica') {
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.5', array());
foreach ($oids as $oid => $data) {
$current_id = substr($oid, strrpos($oid, '.') + 1);
$current_oid = ".$oid";
$descr = 'Output';
if (count($oids) > 1) {
$descr .= " $current_id";
}
$current = current($data);
$type = 'sinetica';
$index = '4.4.1.5.' . $current_id;
discover_sensor($valid['sensor'], 'load', $device, $current_oid, $index, $type, $descr, 1, 1, null, null, null, null, $current);
}
}

View File

@@ -0,0 +1,44 @@
<?php
/**
* sinetica.inc.php
*
* -Description-
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
if ($device['os'] == 'sinetica') {
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.4', array());
foreach ($oids as $oid => $data) {
$current_id = substr($oid, strrpos($oid, '.') + 1);
$current_oid = ".$oid";
$descr = 'Output';
if (count($oids) > 1) {
$descr .= " Phase $current_id";
}
$divisor = 10;
$current = current($data) / $divisor;
$type = 'sinetica';
$index = '4.4.1.4.' . $current_id;
discover_sensor($valid['sensor'], 'power', $device, $current_oid, $index, $type, $descr, $divisor, 1, null, null, null, null, $current);
}
}

View File

@@ -0,0 +1,38 @@
<?php
/**
* sinetica.inc.php
*
* -Description-
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
if ($device['os'] == 'sinetica') {
$runtime_oid = '.1.3.6.1.4.1.13891.101.2.3.0';
$runtime = snmp_get($device, $runtime_oid, '-Osqvt');
if (!empty($runtime)) {
$type = 'sinetcia';
$index = '2.3.0';
$descr = 'Runtime';
$low_limit = 5;
$low_limit_warn = 10;
discover_sensor($valid['sensor'], 'runtime', $device, $runtime_oid, $index, $type, $descr, 1, 1, $low_limit, $low_limit_warn, null, null, $runtime);
}
}//end if

View File

@@ -0,0 +1,73 @@
<?php
/**
* sinetica.inc.php
*
* -Description-
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
if ($device['os'] == 'sinetica') {
$battery_oid = '.1.3.6.1.4.1.13891.101.2.5.0';
$battery_current = snmp_get($device, $battery_oid, '-Oqv');
if (!empty($battery_current) || $battery_current == 0) {
$divisor = 10;
$current = $battery_current / $divisor;
$descr = 'Battery';
$type = 'sinetica';
$index = '2.5.0';
discover_sensor($valid['sensor'], 'voltage', $device, $battery_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
}
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.3.3.1.3', array());
foreach ($oids as $oid => $data) {
$current_id = substr($oid, strrpos($oid, '.') + 1);
$current_oid = ".$oid";
$descr = 'Output';
if (count($oids) > 1) {
$descr .= " Phase $current_id";
}
$current = current($data);
$type = 'sinetica';
$index = '3.3.1.3.'.$current_id;
discover_sensor($valid['sensor'], 'voltage', $device, $current_oid, $index, $type, $descr, 1, 1, null, null, null, null, $current);
}
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.2', array());
foreach ($oids as $oid => $data) {
$current_id = substr($oid, strrpos($oid, '.') + 1);
$current_oid = ".$oid";
$descr = 'Input';
if (count($oids) > 1) {
$descr .= " Phase $current_id";
}
$current = current($data);
$type = 'sinetica';
$index = '4.4.1.2.'.$current_id;
discover_sensor($valid['sensor'], 'voltage', $device, $current_oid, $index, $type, $descr, 1, '1', null, null, null, null, $current);
}
}//end if

View 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

View File

@@ -0,0 +1,31 @@
<?php
/**
* sinetica.inc.php
*
* LibreNMS os polling module for Sinetica
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Neil Lathwood
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
// Sinetica UPSController. Versions: App. 6.04.03, OS 6.3, Btldr 1.06.09, H/w ZBBNC2 Rev 1.01.06
list($os_temp, $os_ver, $btldr, $hardware_temp) = explode(', ', $poll_device['sysDescr']);
list($ignore, $version) = explode('App. ', $os_temp);
$hardware = preg_replace('/H\/w /', '', $hardware_temp);

View File

@@ -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 != '') {

606
mibs/UBNT-UniFi-MIB Normal file
View File

@@ -0,0 +1,606 @@
UBNT-UniFi-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE, Integer32, Unsigned32, Counter32, Gauge32, IpAddress, enterprises
FROM SNMPv2-SMI
TEXTUAL-CONVENTION, DisplayString, MacAddress, DateAndTime, TruthValue
FROM SNMPv2-TC
MODULE-COMPLIANCE, OBJECT-GROUP
FROM SNMPv2-CONF
ubntMIB, ubntUniFi, ubntUniFiGroups
FROM UBNT-MIB;
ubntUniFi MODULE-IDENTITY
LAST-UPDATED "201606250000Z"
ORGANIZATION "Ubiquiti Networks, Inc."
CONTACT-INFO "support@ubnt.com"
DESCRIPTION "The UniFi MIB module for Ubiquiti Networks, Inc. entities"
REVISION "201606250000Z"
DESCRIPTION "Initial Revision."
::= { ubntMIB 6 }
unifiApWireless OBJECT IDENTIFIER ::= { ubntUniFi 1 }
unifiApIf OBJECT IDENTIFIER ::= { ubntUniFi 2 }
unifiApSystem OBJECT IDENTIFIER ::= { ubntUniFi 3 }
TableIndex ::= TEXTUAL-CONVENTION
DISPLAY-HINT "d"
STATUS current
DESCRIPTION
"A unique value, greater than zero. It is recommended
that values are assigned contiguously starting from 1."
SYNTAX Integer32 (1..2147483647)
ObjectIndex ::= TEXTUAL-CONVENTION
DISPLAY-HINT "x"
STATUS current
DESCRIPTION "Internal "
SYNTAX Integer32 (0..2147483647)
-- SYNTAX Integer32 (-2147483648..2147483647)
-- SYNTAX Unsigned32 (0..4294967295)
Voltage ::= TEXTUAL-CONVENTION
DISPLAY-HINT "d-2"
STATUS current
DESCRIPTION ""
SYNTAX Integer32 (-2147483648..2147483647)
Temperature ::= TEXTUAL-CONVENTION
DISPLAY-HINT "d-1"
STATUS current
DESCRIPTION ""
SYNTAX Integer32 (-2147483648..2147483647)
unifiIfTable OBJECT-TYPE
SYNTAX SEQUENCE OF UbntIfEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION ""
::= { unifiApIf 1 }
unifiIfEntry OBJECT-TYPE
SYNTAX UbntIfEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "Ethernet interface"
INDEX { unifiIfIndex }
::= { unifiIfTable 1 }
UbntIfEntry ::= SEQUENCE {
unifiIfIndex ObjectIndex,
unifiIfFullDuplex TruthValue,
unifiIfIp IpAddress,
unifiIfMac MacAddress,
unifiIfName DisplayString,
unifiIfRxBytes Counter32,
unifiIfRxDropped Counter32,
unifiIfRxError Counter32,
unifiIfRxMulticast Counter32,
unifiIfRxPackets Counter32,
unifiIfSpeed Integer32,
unifiIfTxBytes Counter32,
unifiIfTxDropped Counter32,
unifiIfTxError Counter32,
unifiIfTxPackets Counter32,
unifiIfUp TruthValue
}
unifiIfIndex OBJECT-TYPE
SYNTAX ObjectIndex
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 1 }
unifiIfFullDuplex OBJECT-TYPE
SYNTAX TruthValue
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 2 }
unifiIfIp OBJECT-TYPE
SYNTAX IpAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 3 }
unifiIfMac OBJECT-TYPE
SYNTAX MacAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 4 }
unifiIfName OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 5 }
unifiIfRxBytes OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 6 }
unifiIfRxDropped OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 7 }
unifiIfRxError OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 8 }
unifiIfRxMulticast OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 9 }
unifiIfRxPackets OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 10 }
unifiIfSpeed OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 11 }
unifiIfTxBytes OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 12 }
unifiIfTxDropped OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 13 }
unifiIfTxError OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 14 }
unifiIfTxPackets OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 15 }
unifiIfUp OBJECT-TYPE
SYNTAX TruthValue
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiIfEntry 16 }
unifiRadioTable OBJECT-TYPE
SYNTAX SEQUENCE OF UbntRadioEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION ""
::= { unifiApWireless 1 }
unifiRadioEntry OBJECT-TYPE
SYNTAX UbntRadioEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "Wireless interface"
INDEX { unifiRadioIndex }
::= { unifiRadioTable 1 }
UbntRadioEntry ::= SEQUENCE {
unifiRadioIndex ObjectIndex,
unifiRadioName DisplayString,
unifiRadioRadio DisplayString,
unifiRadioRxPackets Counter32,
unifiRadioTxPackets Counter32,
unifiRadioCuTotal Integer32,
unifiRadioCuSelfRx Integer32,
unifiRadioCuSelfTx Integer32,
unifiRadioOtherBss Integer32
}
unifiRadioIndex OBJECT-TYPE
SYNTAX ObjectIndex
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION ""
::= { unifiRadioEntry 1 }
unifiRadioName OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiRadioEntry 2 }
unifiRadioRadio OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiRadioEntry 3 }
unifiRadioRxPackets OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiRadioEntry 4 }
unifiRadioTxPackets OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiRadioEntry 5 }
unifiRadioCuTotal OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiRadioEntry 6 }
unifiRadioCuSelfRx OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiRadioEntry 7 }
unifiRadioCuSelfTx OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiRadioEntry 8 }
unifiRadioOtherBss OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiRadioEntry 9 }
unifiVapTable OBJECT-TYPE
SYNTAX SEQUENCE OF UbntVapEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION ""
::= { unifiApWireless 2 }
unifiVapEntry OBJECT-TYPE
SYNTAX UbntVapEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "BSS"
INDEX { unifiVapIndex }
::= { unifiVapTable 1 }
UbntVapEntry ::= SEQUENCE {
unifiVapIndex ObjectIndex,
unifiVapBssId MacAddress,
unifiVapCcq Integer32,
unifiVapChannel Integer32,
unifiVapExtChannel Integer32,
unifiVapEssId DisplayString,
unifiVapName DisplayString,
unifiVapNumStations Integer32,
unifiVapRadio DisplayString,
unifiVapRxBytes Counter32,
unifiVapRxCrypts Counter32,
unifiVapRxDropped Counter32,
unifiVapRxErrors Counter32,
unifiVapRxFrags Counter32,
unifiVapRxPackets Counter32,
unifiVapTxBytes Counter32,
unifiVapTxDropped Counter32,
unifiVapTxErrors Counter32,
unifiVapTxPackets Counter32,
unifiVapTxRetries Counter32,
unifiVapTxPower Integer32,
unifiVapUp TruthValue,
unifiVapUsage DisplayString
}
unifiVapIndex OBJECT-TYPE
SYNTAX ObjectIndex
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 1 }
unifiVapBssId OBJECT-TYPE
SYNTAX MacAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 2 }
unifiVapCcq OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 3 }
unifiVapChannel OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 4 }
unifiVapExtChannel OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 5 }
unifiVapEssId OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 6 }
unifiVapName OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 7 }
unifiVapNumStations OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 8 }
unifiVapRadio OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 9 }
unifiVapRxBytes OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 10 }
unifiVapRxCrypts OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 11 }
unifiVapRxDropped OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 12 }
unifiVapRxErrors OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 13 }
unifiVapRxFrags OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 14 }
unifiVapRxPackets OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 15 }
unifiVapTxBytes OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 16 }
unifiVapTxDropped OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 17 }
unifiVapTxErrors OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 18 }
unifiVapTxPackets OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 19 }
unifiVapTxRetries OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 20 }
unifiVapTxPower OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 21 }
unifiVapUp OBJECT-TYPE
SYNTAX TruthValue
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiVapEntry 22 }
unifiVapUsage OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION "guest or regular user"
::= { unifiVapEntry 23 }
unifiApSystemIp OBJECT-TYPE
SYNTAX IpAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiApSystem 1 }
unifiApSystemIsolated OBJECT-TYPE
SYNTAX TruthValue
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiApSystem 2 }
unifiApSystemModel OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiApSystem 3 }
unifiApSystemUplink OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiApSystem 4 }
unifiApSystemUptime OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiApSystem 5 }
unifiApSystemVersion OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION ""
::= { unifiApSystem 6 }
unifiIfGroup OBJECT-GROUP OBJECTS {
unifiIfFullDuplex,
unifiIfIp,
unifiIfMac,
unifiIfName,
unifiIfRxBytes,
unifiIfRxDropped,
unifiIfRxError,
unifiIfRxMulticast,
unifiIfRxPackets,
unifiIfSpeed,
unifiIfTxBytes,
unifiIfTxDropped,
unifiIfTxError,
unifiIfTxPackets,
unifiIfUp
}
STATUS current
DESCRIPTION ""
::= { ubntUniFiGroups 1 }
unifiRadioGroups OBJECT-GROUP OBJECTS {
unifiRadioName,
unifiRadioRadio,
unifiRadioRxPackets,
unifiRadioTxPackets,
unifiRadioCuTotal,
unifiRadioCuSelfRx,
unifiRadioCuSelfTx,
unifiRadioOtherBss
}
STATUS current
DESCRIPTION ""
::= { ubntUniFiGroups 2 }
unifiVapGroups OBJECT-GROUP OBJECTS {
unifiVapBssId,
unifiVapCcq,
unifiVapChannel,
unifiVapExtChannel,
unifiVapEssId,
unifiVapName,
unifiVapNumStations,
unifiVapRadio,
unifiVapRxBytes,
unifiVapRxCrypts,
unifiVapRxDropped,
unifiVapRxErrors,
unifiVapRxFrags,
unifiVapRxPackets,
unifiVapTxBytes,
unifiVapTxDropped,
unifiVapTxErrors,
unifiVapTxPackets,
unifiVapTxRetries,
unifiVapTxPower,
unifiVapUp,
unifiVapUsage
}
STATUS current
DESCRIPTION ""
::= { ubntUniFiGroups 3 }
unifiApSystemGroup OBJECT-GROUP OBJECTS {
unifiApSystemIp, unifiApSystemIsolated, unifiApSystemModel, unifiApSystemUplink, unifiApSystemUptime, unifiApSystemVersion
}
STATUS current
DESCRIPTION ""
::= { ubntUniFiGroups 4 }
END

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,67 @@
NET-SNMP-MIB DEFINITIONS ::= BEGIN
--
-- Top-level infrastructure of the Net-SNMP project enterprise MIB tree
--
IMPORTS
MODULE-IDENTITY, enterprises FROM SNMPv2-SMI;
netSnmp MODULE-IDENTITY
LAST-UPDATED "200201300000Z"
ORGANIZATION "www.net-snmp.org"
CONTACT-INFO
"postal: Wes Hardaker
P.O. Box 382
Davis CA 95617
email: net-snmp-coders@lists.sourceforge.net"
DESCRIPTION
"Top-level infrastructure of the Net-SNMP project enterprise MIB tree"
REVISION "200201300000Z"
DESCRIPTION
"First draft"
::= { enterprises 8072}
--
-- Net-SNMP enterprise-specific management objects
--
netSnmpObjects OBJECT IDENTIFIER ::= {netSnmp 1}
-- netSnmpExamples OBJECT IDENTIFIER ::= {netSnmp 2}
netSnmpEnumerations OBJECT IDENTIFIER ::= {netSnmp 3}
netSnmpModuleIDs OBJECT IDENTIFIER ::= {netSnmpEnumerations 1}
netSnmpAgentOIDs OBJECT IDENTIFIER ::= {netSnmpEnumerations 2}
netSnmpDomains OBJECT IDENTIFIER ::= {netSnmpEnumerations 3}
netSnmpExperimental OBJECT IDENTIFIER ::= {netSnmp 9999}
--
-- A subtree specifically designed for private testing purposes.
-- No "public" management objects should ever be defined within this tree.
--
-- It is provided for private experimentation, prior to transferring a MIB
-- structure to another part of the overall OID tree
--
netSnmpPlaypen OBJECT IDENTIFIER ::= {netSnmpExperimental 9999}
--
-- Notifications
--
netSnmpNotificationPrefix OBJECT IDENTIFIER ::= {netSnmp 4}
netSnmpNotifications OBJECT IDENTIFIER ::= {netSnmpNotificationPrefix 0}
netSnmpNotificationObjects OBJECT IDENTIFIER ::= {netSnmpNotificationPrefix 1}
--
-- Conformance
-- (No laughing at the back!)
--
netSnmpConformance OBJECT IDENTIFIER ::= {netSnmp 5}
netSnmpCompliances OBJECT IDENTIFIER ::= {netSnmpConformance 1}
netSnmpGroups OBJECT IDENTIFIER ::= {netSnmpConformance 2}
END

View File

@@ -34,6 +34,7 @@ pages:
- General/Credits.md
- General/Updating.md
- General/Releases.md
- General/Security.md
- General/Welcome-to-Observium-users.md
- Extensions:
- Extensions/Alerting.md

View File

@@ -1190,6 +1190,11 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
$this->checkOS('siklu');
}
public function testSinetica()
{
$this->checkOS('sinetica');
}
public function testSmartax()
{
$this->checkOS('smartax');

View File

@@ -0,0 +1,2 @@
1.3.6.1.2.1.1.1.0|4|Sinetica UPSController. Versions: App. 6.04.03, OS 6.3, Btldr 1.06.09, H/w ZBBNC2 Rev 1.01.06
1.3.6.1.2.1.1.2.0|6|.1.3.6.1.4.1.13891.101