Merge remote-tracking branch 'upstream/master' into issue-714

Conflicts:
	html/includes/authentication/ldap.inc.php
This commit is contained in:
Ultra2D
2015-04-08 08:43:24 +02:00
15 changed files with 12130 additions and 12 deletions

BIN
html/images/os/cambium.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
html/images/os/f5.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -15,7 +15,7 @@ if ($config['auth_ldap_starttls'] && ($config['auth_ldap_starttls'] == 'optional
function authenticate($username,$password)
{
global $config, $ds;
if ($username && $ds)
{
if ($config['auth_ldap_version'])
@@ -30,9 +30,15 @@ function authenticate($username,$password)
}
else
{
if (ldap_compare($ds,$config['auth_ldap_group'], $config['auth_ldap_groupmemberattr'],get_membername($username))===true)
{
return 1;
$ldap_groups = get_group_list();
foreach($ldap_groups as $ldap_group) {
$ldap_comparison = ldap_compare($ds,
$ldap_group,
$config['auth_ldap_groupmemberattr'],
get_membername($username));
if($ldap_comparison === true) {
return 1;
}
}
}
}
@@ -154,10 +160,15 @@ function get_userlist()
$realname = $entry['cn'][0];
$user_id = $entry['uidnumber'][0];
$email = $entry[$config['auth_ldap_emailattr']][0];
if (!isset($config['auth_ldap_group']) || ldap_compare($ds,$config['auth_ldap_group'],$config['auth_ldap_groupmemberattr'],get_membername($username))===true)
{
$userlist[] = array('username' => $username, 'realname' => $realname, 'user_id' => $user_id, 'email' => $email);
$ldap_groups = get_group_list();
foreach($ldap_groups as $ldap_group) {
$ldap_comparison = ldap_compare($ds,
$ldap_group,
$config['auth_ldap_groupmemberattr'],
get_membername($username));
if (!isset($config['auth_ldap_group']) || $ldap_comparison === true) {
$userlist[] = array('username' => $username, 'realname' => $realname, 'user_id' => $user_id, 'email' => $email);
}
}
}
}
@@ -197,4 +208,21 @@ function get_membername ($username)
return $membername;
}
function get_group_list() {
global $config;
$ldap_groups = array();
$default_group = 'cn=groupname,ou=groups,dc=example,dc=com';
if(isset($config['auth_ldap_group'])) {
if($config['auth_ldap_group'] !== $default_group) {
$ldap_groups[] = $config['auth_ldap_group'];
}
}
foreach($config['auth_ldap_groups'] as $key => $value) {
$dn = "cn=$key," . $config['auth_ldap_groupbase'];
$ldap_groups[] = $dn;
}
return $ldap_groups;
}
?>

View File

@@ -38,6 +38,7 @@ foreach (dbFetchRows($sql,$param) as $alert) {
$log = dbFetchCell("SELECT details FROM alert_log WHERE rule_id = ? AND device_id = ? ORDER BY id DESC LIMIT 1", array($alert['rule_id'],$alert['device_id']));
$log_detail = json_decode(gzuncompress($log),true);
foreach ( $log_detail['rule'] as $tmp_alerts ) {
$fault_detail = '';
foreach ($tmp_alerts as $k=>$v) {
if (!empty($v) && $k != 'device_id' && (stristr($k,'id') || stristr($k,'desc')) && substr_count($k,'_') <= 1) {
$fault_detail .= $k.' => '.$v."\n ";
@@ -93,8 +94,8 @@ foreach (dbFetchRows($sql,$param) as $alert) {
}
$response[] = array('id'=>"<i>#".$rulei++."</i>",
'rule'=>"<i title=\"".htmlentities($alert['rule'])."\">".htmlentities($alert['name'])."</i></td>",
'hostname'=>"<a href=\"device/device=".$alert['device_id']."\"><i title='".htmlentities($fault_detail)."'>".$alert['hostname']."</i></a></td>",
'rule'=>"<i title=\"".htmlentities($alert['rule'])."\">".htmlentities($alert['name'])."</i>",
'hostname'=>"<a href=\"device/device=".$alert['device_id']."\"><i title='".htmlentities($fault_detail)."'>".$alert['hostname']."</i></a>",
'timestamp'=>($alert['timestamp'] ? $alert['timestamp'] : "N/A"),
'severity'=>$severity,
'ack_col'=>$ack_col,

View File

@@ -547,6 +547,17 @@ $config['os'][$os]['over'][0]['text'] = "Device Traffic";
$config['os'][$os]['over'][1]['graph'] = "device_processor";
$config['os'][$os]['over'][1]['text'] = "CPU Usage";
$os = "f5";
$config['os'][$os]['text'] = "F5 Big IP";
$config['os'][$os]['type'] = "loadbalancer";
$config['os'][$os]['icon'] = "f5";
$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'] = "CPU Usage";
$config['os'][$os]['over'][2]['graph'] = "device_ucd_memory";
$config['os'][$os]['over'][2]['text'] = "Memory Usage";
$os = "proxim";
$config['os'][$os]['text'] = "Proxim";
$config['os'][$os]['type'] = "network";
@@ -1016,6 +1027,12 @@ $config['os'][$os]['text'] = "Hikvision";
$config['os'][$os]['type'] = "network";
$config['os'][$os]['icon'] = "hikvision";
// Canopy / Cambium support
$os = "canopy";
$config['os'][$os]['text'] = "Cambium";
$config['os'][$os]['type'] = "wireless";
$config['os'][$os]['icon'] = "cambium";
foreach ($config['os'] as $this_os => $blah)
{
if (isset($config['os'][$this_os]['group']))

View File

@@ -0,0 +1,7 @@
<?php
if (!$os) {
if (preg_match("/^CANOPY/", $sysDescr)) {
$os = 'canopy';
}
}

View File

@@ -0,0 +1,6 @@
<?php
if(!$os || $os === "linux") {
$f5_sys_parent = "1.3.6.1.4.1.3375.2.1";
if(strpos($sysObjectId, $f5_sys_parent)) { $os = "f5"; }
}
?>

View File

@@ -14,10 +14,10 @@ if ($device['os'] == "ciscosb") {
echo("Cisco SB : ");
$descr = "CPU";
$usage = snmp_get($device, "rlCpuUtilDuringLastMinute", "-Ovqn", "CISCOSB-rndMng");
$usage = snmp_get($device, "rlCpuUtilDuringLastMinute.0", "-Ovqn", "CISCOSB-rndMng");
if (is_numeric($usage)) {
discover_processor($valid['processor'], $device, "CISCOSB-rndMng::rlCpuUtilDuringLastMinute", "0", "ciscosb", $descr, "1", $usage, NULL, NULL);
discover_processor($valid['processor'], $device, "CISCOSB-rndMng::rlCpuUtilDuringLastMinute.0", "0", "ciscosb", $descr, "1", $usage, NULL, NULL);
}
}

View File

@@ -0,0 +1,11 @@
<?php
$canopy_type = snmp_get($device,"boxDeviceType.0", "-Oqv", "WHISP-BOX-MIBV2-MIB");
if (stristr($canopy_type,"MIMO OFDM")) {
$hardware = 'PMP 450';
} elseif (stristr($canopy_type,"OFDM")) {
$hardware = 'PMP 430';
} else {
$hardware = 'PMP 100';
}

View File

@@ -0,0 +1,3 @@
<?php
$version = trim(snmp_get($device, ".1.3.6.1.4.1.3375.2.1.4.2.0", "-OQv", "", ""),'"');
?>

View File

@@ -251,8 +251,12 @@ foreach ($ports as $port)
echo("VLAN == ".$this_port['ifVlan']);
// Update IF-MIB data
$brk = false;
foreach ($data_oids as $oid)
{
if( $brk === true ) {
break;
}
if ($port[$oid] != $this_port[$oid] && !isset($this_port[$oid]))
{
$port['update'][$oid] = array('NULL');
@@ -263,6 +267,9 @@ foreach ($ports as $port)
log_event($oid . ": ".$port[$oid]." -> " . $this_port[$oid], $device, 'interface', $port['port_id']);
if ($debug) { echo($oid . ": ".$port[$oid]." -> " . $this_port[$oid]." "); } else { echo($oid . " "); }
}
if( ( $oid == 'ifOperStatus' || $oid == 'ifAdminStatus' ) && $this_port[$oid] == 'down' ) {
$brk = true;
}
}
// Parse description (usually ifAlias) if config option set

4157
mibs/WHISP-APS-MIB Normal file
View File

File diff suppressed because it is too large Load Diff

4404
mibs/WHISP-BOX-MIBV2-MIB Normal file
View File

File diff suppressed because it is too large Load Diff

93
mibs/WHISP-GLOBAL-REG-MIB Normal file
View File

@@ -0,0 +1,93 @@
--
-- whisp-reg.mib
--
-- *************************************************************************************
-- Copyright 2003-2012 (c) Cambium Networks
-- Cambium Networks Confidential Proprietary
-- *************************************************************************************
--
-- This module contains registrations for Canopy related items such
-- as the identity of products, product components and other MIB
-- related items.
--
-- *************************************************************************************
-- $Id: WHISP-GLOBAL-REG-MIB.txt,v 1.2 2007/07/25 16:16:52 qa6656 Exp $
--
-- Revision History:
--
-- <Date> <Author> <Changes>
-- 01/31/2002 Y.G Initial release.
-- 08/24/2005 M.D Change OS type for ucos.
-- 05/02/2006 M.D Add new global OID definitions
-- 07/12/2006 V.G Add new global OIDs whispPlvModem and whispPlvGateway
-- 11/10/2006 V.G Add new global OID whispPlvRepeater and
-- whispPlvBridge
-- **************************************************************************************
WHISP-GLOBAL-REG-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY,
enterprises
FROM SNMPv2-SMI;
whispGlobalRegModule MODULE-IDENTITY
LAST-UPDATED "200304100000Z"
ORGANIZATION "Motorola"
CONTACT-INFO
"Canopy Technical Support
email: technical-support@canopywireless.com"
DESCRIPTION
"The Canopy central registration module."
::= {whispModules 1}
-- the root of the sub-tree for Canopy Radio Modem Product Line.
mot OBJECT IDENTIFIER ::= {enterprises 161}
whispRoot OBJECT IDENTIFIER ::= {mot 19}
-- sub-tree for registrations, which includes modules
whispReg OBJECT IDENTIFIER ::= {whispRoot 1}
-- sub-tree for WHiSP wide objects and events
whispGeneric OBJECT IDENTIFIER ::= {whispRoot 2}
-- sub-tree for WHiSP product specific objects and events
whispProducts OBJECT IDENTIFIER ::= {whispRoot 3}
-- Product registrations. The OIDs should be assigned to
-- sysObjectID of the system group in SNMPv2-MIB supported
-- by the agent. A manager needs to know the (unique) IP
-- address of the agent and get the value (OID value) of
-- sysObjectID to uniquely identify the agent type. Once the
-- agent type has been identified, the manager will know what
-- MIBs the agent supports (from agent capabilities).
whispAps OBJECT IDENTIFIER ::= {whispProducts 1}
whispSm OBJECT IDENTIFIER ::= {whispProducts 2}
whispBox OBJECT IDENTIFIER ::= {whispProducts 3}
whispCMM OBJECT IDENTIFIER ::= {whispProducts 4}
whispPlv OBJECT IDENTIFIER ::= {whispProducts 5}
whispCMM4 OBJECT IDENTIFIER ::= {whispProducts 6}
whispPlvModem OBJECT IDENTIFIER ::= {whispProducts 7}
whispPlvGateway OBJECT IDENTIFIER ::= {whispProducts 8}
whispPlvRepeater OBJECT IDENTIFIER ::= {whispProducts 9}
whispPlvBridge OBJECT IDENTIFIER ::= {whispProducts 10}
-- the Canopy modules registrations
whispModules OBJECT IDENTIFIER ::= {whispReg 1}
-- These are the returned values of the agent type.
-- returned to: .iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0
--SNMP agent for Canopy units
canopySnmpAgent OBJECT IDENTIFIER ::= { whispRoot 250 }
--Canopy SNMP agent OID definition
ucos OBJECT IDENTIFIER ::= { canopySnmpAgent 256 }
-- prizm snmp agent
prizmSnmpAgent OBJECT IDENTIFIER ::= { whispRoot 1250 }
-- prizm managed object subtree
prizm OBJECT IDENTIFIER ::= {whispRoot 1000}
END

3384
mibs/WHISP-SM-MIB Normal file
View File

File diff suppressed because it is too large Load Diff