mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
Merge branch 'master' of https://github.com/librenms/librenms
This commit is contained in:
@@ -68,4 +68,5 @@ Contributors to LibreNMS:
|
||||
- Robert Gornall <roblnm@khobbits.co.uk (KHobbits)
|
||||
- Rob Gormley <robert@gormley.me> (rgormley)
|
||||
- Richard Kojedzinszky <krichy@nmdps.net> (rkojedzinszky)
|
||||
- Tony Murray <murraytony@gmail.com> (murrant)
|
||||
[1]: http://observium.org/ "Observium web site"
|
||||
|
||||
@@ -108,7 +108,7 @@ Config option: `active_directory`
|
||||
|
||||
This is similar to LDAP Authentication. Install __php_ldap__ for CentOS/RHEL or __php5-ldap__ for Debian/Ubuntu.
|
||||
|
||||
If you have issues with secure LDAP try setting `$config['auth_ad_dont_check_certificates']` to `1`.
|
||||
If you have issues with secure LDAP try setting `$config['auth_ad_check_certificates']` to `0`.
|
||||
|
||||
##### Require actual membership of the configured groups
|
||||
|
||||
@@ -118,7 +118,7 @@ If you set ```$config['auth_ad_require_groupmembership']``` to 1, the authentica
|
||||
|
||||
```
|
||||
$config['auth_ad_url'] = "ldaps://your-domain.controll.er";
|
||||
$config['auth_ad_dont_check_certificates'] = 1; // or 0
|
||||
$config['auth_ad_check_certificates'] = 1; // or 0
|
||||
$config['auth_ad_domain'] = "your-domain.com";
|
||||
$config['auth_ad_base_dn'] = "dc=your-domain,dc=com";
|
||||
$config['auth_ad_groups']['admin']['level'] = 10;
|
||||
|
||||
@@ -436,7 +436,7 @@ $config['auth_mechanism'] = "mysql";
|
||||
```
|
||||
This is the authentication type to use for the WebUI. MySQL is the default and configured when following the installation
|
||||
instructions. ldap and http-auth are also valid options. For instructions on the different authentication modules please
|
||||
see [Authentication](http://doc.librenms.org/Extensions/Authentication/).
|
||||
see [Authentication](http://docs.librenms.org/Extensions/Authentication/).
|
||||
|
||||
```php
|
||||
$config['auth_remember'] = '30';
|
||||
|
||||
+4
-4
@@ -31,14 +31,14 @@ if (is_numeric($_GET['id']) && ($config['allow_unauth_graphs'] || port_permitted
|
||||
$auth = true;
|
||||
}
|
||||
|
||||
$in = snmp_get($device, 'ifInOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB');
|
||||
$out = snmp_get($device, 'ifOutOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB');
|
||||
$in = snmp_get($device, 'ifHCInOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB');
|
||||
if (empty($in)) {
|
||||
$in = snmp_get($device, 'ifHCInOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB');
|
||||
$in = snmp_get($device, 'ifInOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB');
|
||||
}
|
||||
|
||||
$out = snmp_get($device, 'ifHCOutOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB');
|
||||
if (empty($out)) {
|
||||
$out = snmp_get($device, 'ifHCOutOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB');
|
||||
$out = snmp_get($device, 'ifOutOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB');
|
||||
}
|
||||
|
||||
$time = time();
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
// easier to rewrite for Active Directory than to bash it into existing LDAP implementation
|
||||
|
||||
// disable certificate checking before connect if required
|
||||
if (isset($config['auth_ad_check_certificates']) &&
|
||||
$config['auth_ad_check_certificates'] == 0) {
|
||||
putenv('LDAPTLS_REQCERT=never');
|
||||
};
|
||||
|
||||
$ds = @ldap_connect($config['auth_ad_url']);
|
||||
|
||||
// disable referrals and force ldap version to 3
|
||||
@@ -9,13 +15,6 @@ $ds = @ldap_connect($config['auth_ad_url']);
|
||||
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
|
||||
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||
|
||||
// disable certificate checking if required
|
||||
|
||||
if (isset($config['auth_ad_dont_check_certificates']) &&
|
||||
$config['auth_ad_dont_check_certificates'] > 0) {
|
||||
putenv('LDAPTLS_REQCERT=never');
|
||||
};
|
||||
|
||||
function authenticate($username, $password) {
|
||||
global $config, $ds;
|
||||
|
||||
|
||||
@@ -50,12 +50,12 @@ unset($break);
|
||||
|
||||
if ($port_details) {
|
||||
foreach (dbFetchRows('SELECT * FROM `ipv4_addresses` WHERE `port_id` = ?', array($port['port_id'])) as $ip) {
|
||||
echo "$break <a class=interface-desc href=\"javascript:popUp('/netcmd.php?cmd=whois&query=$ip[ipv4_address]')\">".$ip['ipv4_address'].'/'.$ip['ipv4_prefixlen'].'</a>';
|
||||
echo "$break <a class=interface-desc href=\"javascript:popUp('netcmd.php?cmd=whois&query=$ip[ipv4_address]')\">".$ip['ipv4_address'].'/'.$ip['ipv4_prefixlen'].'</a>';
|
||||
$break = '<br />';
|
||||
}
|
||||
|
||||
foreach (dbFetchRows('SELECT * FROM `ipv6_addresses` WHERE `port_id` = ?', array($port['port_id'])) as $ip6) {
|
||||
echo "$break <a class=interface-desc href=\"javascript:popUp('/netcmd.php?cmd=whois&query=".$ip6['ipv6_address']."')\">".Net_IPv6::compress($ip6['ipv6_address']).'/'.$ip6['ipv6_prefixlen'].'</a>';
|
||||
echo "$break <a class=interface-desc href=\"javascript:popUp('netcmd.php?cmd=whois&query=".$ip6['ipv6_address']."')\">".Net_IPv6::compress($ip6['ipv6_address']).'/'.$ip6['ipv6_prefixlen'].'</a>';
|
||||
$break = '<br />';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ foreach (dbFetchRows('SELECT * FROM `bill_history` WHERE `bill_id` = ? ORDER BY
|
||||
<td>$total_data</td>
|
||||
<td>$rate_95th</td>
|
||||
<td style=\"text-align: center;\">$overuse</td>
|
||||
<td width=\"250\">".print_percentage_bar(250, 20, $perc, null, 'ffffff', $background['left'], $percent.'%', 'ffffff', $background['right']).'</td>
|
||||
<td width=\"250\">".print_percentage_bar(250, 20, $percent, null, 'ffffff', $background['left'], $percent.'%', 'ffffff', $background['right']).'</td>
|
||||
<td>
|
||||
<a href="'.$url.'"><img src="images/16/chart_curve.png" border="0" align="absmiddle" alt="Show details" title="Show details"/></a>
|
||||
</td>
|
||||
|
||||
@@ -60,7 +60,7 @@ foreach (dbFetchRows('SELECT * FROM `bills` ORDER BY `bill_name`') as $bill) {
|
||||
<td>$total_data</td>
|
||||
<td>$rate_95th</td>
|
||||
<td style=\"text-align: center;\">$overuse</td>
|
||||
<td>".print_percentage_bar(250, 20, $perc, null, 'ffffff', $background['left'], $percent.'%', 'ffffff', $background['right']).'</td>
|
||||
<td>".print_percentage_bar(250, 20, $percent, null, 'ffffff', $background['left'], $percent.'%', 'ffffff', $background['right']).'</td>
|
||||
</tr>';
|
||||
|
||||
$i++;
|
||||
|
||||
@@ -33,7 +33,7 @@ echo '<div class="status-boxes">';
|
||||
$count_boxes = 0;
|
||||
|
||||
// Device down boxes
|
||||
if ($_SESSION['userlevel'] >= '10') {
|
||||
if (is_admin() === true || is_read() === true) {
|
||||
$sql = "SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0' LIMIT ".$config['front_page_down_box_limit'];
|
||||
}
|
||||
else {
|
||||
@@ -50,7 +50,7 @@ foreach (dbFetchRows($sql) as $device) {
|
||||
++$count_boxes;
|
||||
}
|
||||
|
||||
if ($_SESSION['userlevel'] >= '10') {
|
||||
if (is_admin() === true || is_read() === true) {
|
||||
$sql = "SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0' AND `D`.`status` = '1' LIMIT ".$config['front_page_down_box_limit'];
|
||||
}
|
||||
else {
|
||||
@@ -79,7 +79,7 @@ if ($config['warn']['ifdown']) {
|
||||
/*
|
||||
FIXME service permissions? seem nonexisting now.. */
|
||||
// Service down boxes
|
||||
if ($_SESSION['userlevel'] >= '10') {
|
||||
if (is_admin() === true || is_read() === true) {
|
||||
$sql = "SELECT * FROM `services` AS S, `devices` AS D WHERE S.device_id = D.device_id AND service_status = 'down' AND D.ignore = '0' AND S.service_ignore = '0' AND `D`.`status` = '1' LIMIT ".$config['front_page_down_box_limit'];
|
||||
$param[] = '';
|
||||
}
|
||||
@@ -101,7 +101,7 @@ foreach (dbFetchRows($sql, $param) as $service) {
|
||||
|
||||
// BGP neighbour down boxes
|
||||
if (isset($config['enable_bgp']) && $config['enable_bgp']) {
|
||||
if ($_SESSION['userlevel'] >= '10') {
|
||||
if (is_admin() === true || is_read() === true) {
|
||||
$sql = "SELECT * FROM `devices` AS D, bgpPeers AS B WHERE bgpPeerAdminStatus != 'start' AND bgpPeerState != 'established' AND bgpPeerState != '' AND B.device_id = D.device_id AND D.ignore = 0 AND `D`.`status` = '1' LIMIT ".$config['front_page_down_box_limit'];
|
||||
}
|
||||
else {
|
||||
@@ -122,7 +122,7 @@ if (isset($config['enable_bgp']) && $config['enable_bgp']) {
|
||||
|
||||
// Device rebooted boxes
|
||||
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== false && $config['uptime_warning'] > 0) {
|
||||
if ($_SESSION['userlevel'] >= '10') {
|
||||
if (is_admin() === true || is_read() === true) {
|
||||
$sql = "SELECT * FROM `devices` AS D WHERE D.status = '1' AND D.uptime > 0 AND D.uptime < '".$config['uptime_warning']."' AND D.ignore = 0 LIMIT ".$config['front_page_down_box_limit'];
|
||||
}
|
||||
else {
|
||||
@@ -204,7 +204,7 @@ if ($config['enable_syslog']) {
|
||||
echo '</div>';
|
||||
}
|
||||
else {
|
||||
if ($_SESSION['userlevel'] >= '10') {
|
||||
if (is_admin() === true || is_read() === true) {
|
||||
$query = "SELECT *,DATE_FORMAT(datetime, '".$config['dateformat']['mysql']['compact']."') as humandate FROM `eventlog` ORDER BY `datetime` DESC LIMIT 0,15";
|
||||
$alertquery = 'SELECT devices.device_id,name,state,time_logged FROM alert_log LEFT JOIN devices ON alert_log.device_id=devices.device_id LEFT JOIN alert_rules ON alert_log.rule_id=alert_rules.id ORDER BY `time_logged` DESC LIMIT 0,15';
|
||||
}
|
||||
|
||||
@@ -114,7 +114,11 @@ $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'][0]['text'] = 'Device Traffic';
|
||||
$config['os'][$os]['over'][1]['graph'] = 'device_processor';
|
||||
$config['os'][$os]['over'][1]['text'] = 'Processor Usage';
|
||||
$config['os'][$os]['over'][2]['graph'] = 'device_mempool';
|
||||
$config['os'][$os]['over'][2]['text'] = 'Memory Usage';
|
||||
|
||||
$os = 'airos';
|
||||
$config['os'][$os]['text'] = 'Ubiquiti AirOS';
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS Ubiquiti UniFi memory information module
|
||||
*
|
||||
* Copyright (c) 2015 Mike Rostermund <mike@kollegienet.dk>
|
||||
* 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. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'unifi') {
|
||||
echo 'UNIFI-MEMORY-POOL: ';
|
||||
|
||||
$total = snmp_get($device, '.1.3.6.1.4.1.10002.1.1.1.1.1.0', '-OvQ');
|
||||
$free = snmp_get($device, '.1.3.6.1.4.1.10002.1.1.1.1.2.0', '-OvQ');
|
||||
|
||||
if (is_numeric($total) && is_numeric($free)) {
|
||||
discover_mempool($valid_mempool, $device, 0, 'unifi', 'Memory', '1', null, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS Ubiquiti UniFi CPU information module
|
||||
*
|
||||
* Copyright (c) 2015 Mike Rostermund <mike@kollegienet.dk>
|
||||
* 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. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'unifi') {
|
||||
echo 'Ubiquiti UniFi: ';
|
||||
|
||||
$descr = 'CPU';
|
||||
$usage = snmp_get($device, '.1.3.6.1.4.1.10002.1.1.1.4.2.1.3.2', '-Ovqn');
|
||||
|
||||
if (is_numeric($usage)) {
|
||||
discover_processor($valid['processor'], $device, '.1.3.6.1.4.1.10002.1.1.1.4.2.1.3.2', '0', 'unifi', $descr, '1', $usage, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
unset($processors_array);
|
||||
@@ -4,8 +4,9 @@
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-ntpdserver-'.$app['app_id'].'.rrd';
|
||||
$options = '-O qv';
|
||||
$oid = 'nsExtendOutputFull.10.110.116.112.100.115.101.114.118.101.114';
|
||||
$mib = 'NET-SNMP-EXTEND-MIB';
|
||||
|
||||
$ntpdserver = snmp_get($device, $oid, $options);
|
||||
$ntpdserver = snmp_get($device, $oid, $options, $mib);
|
||||
|
||||
echo ' ntpd-server';
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS Ubiquiti UniFi memory information module
|
||||
*
|
||||
* Copyright (c) 2015 Mike Rostermund <mike@kollegienet.dk>
|
||||
* 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. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$total = snmp_get($device, '.1.3.6.1.4.1.10002.1.1.1.1.1.0', '-OvQ');
|
||||
$free = snmp_get($device, '.1.3.6.1.4.1.10002.1.1.1.1.2.0', '-OvQ');
|
||||
$mempool['total'] = $total * 1024;
|
||||
$mempool['free'] = $free * 1024;
|
||||
$mempool['used'] = ($mempool['total'] - $mempool['free']);
|
||||
Reference in New Issue
Block a user