mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 00:24:21 +02:00
Merge pull request #2536 from paulgear/mib-poller-alpha2
MIB-based poller alpha2
This commit is contained in:
@@ -60,12 +60,12 @@ foreach (dbFetchRows($sql, array($deviceid)) as $entry) {
|
||||
}
|
||||
|
||||
// Attempt discovery of each IP only once per run.
|
||||
if (arp_discovery_is_cached($ip)) {
|
||||
if (object_is_cached('arp_discovery', $ip)) {
|
||||
echo '.';
|
||||
continue;
|
||||
}
|
||||
|
||||
arp_discovery_add_cache($ip);
|
||||
object_add_cache('arp_discovery', $ip);
|
||||
|
||||
$name = gethostbyaddr($ip);
|
||||
echo '+';
|
||||
|
||||
@@ -131,6 +131,11 @@ function discover_device($device, $options=null) {
|
||||
}
|
||||
}
|
||||
|
||||
if (is_mib_poller_enabled($device)) {
|
||||
$devicemib = array($device['sysObjectID'] => 'all');
|
||||
register_mibs($device, $devicemib, "includes/discovery/functions.inc.php");
|
||||
}
|
||||
|
||||
// Set type to a predefined type for the OS if it's not already set
|
||||
if ($device['type'] == 'unknown' || $device['type'] == '') {
|
||||
if ($config['os'][$device['os']]['type']) {
|
||||
@@ -575,7 +580,6 @@ function discover_processor(&$valid, $device, $oid, $index, $type, $descr, $prec
|
||||
'processor_precision' => $precision,
|
||||
);
|
||||
dbUpdate($update_data, 'processors', '`device_id`=? AND `processor_index`=? AND `processor_type`=?', array($device['device_id'], $index, $type));
|
||||
d_echo($query."\n");
|
||||
}//end if
|
||||
$valid[$type][$index] = 1;
|
||||
}//end if
|
||||
@@ -630,7 +634,6 @@ function discover_mempool(&$valid, $device, $index, $type, $descr, $precision='1
|
||||
}
|
||||
|
||||
dbUpdate($update_data, 'mempools', 'device_id=? AND mempool_index=? AND mempool_type=?', array($device['device_id'], $index, $type));
|
||||
d_echo($query."\n");
|
||||
}//end if
|
||||
$valid[$type][$index] = 1;
|
||||
}//end if
|
||||
@@ -704,25 +707,3 @@ function discover_process_ipv6(&$valid, $ifIndex, $ipv6_address, $ipv6_prefixlen
|
||||
}//end if
|
||||
|
||||
}//end discover_process_ipv6()
|
||||
|
||||
|
||||
// maintain a simple cache of seen IPs during ARP discovery
|
||||
|
||||
|
||||
function arp_discovery_add_cache($ip) {
|
||||
global $arp_discovery;
|
||||
$arp_discovery[$ip] = true;
|
||||
|
||||
}//end arp_discovery_add_cache()
|
||||
|
||||
|
||||
function arp_discovery_is_cached($ip) {
|
||||
global $arp_discovery;
|
||||
if (array_key_exists($ip, $arp_discovery)) {
|
||||
return $arp_discovery[$ip];
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}//end arp_discovery_is_cached()
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
* LibreNMS Ruckus Wireless OS information module
|
||||
*
|
||||
* Copyright (c) 2015 Søren Friis Rosiak <sorenrosiak@gmail.com>
|
||||
* Copyright (c) 2015 Gear Consulting Pty Ltd <github@libertysys.com.au>
|
||||
*
|
||||
* 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
|
||||
@@ -13,5 +15,13 @@
|
||||
if (!$os) {
|
||||
if (strstr($sysObjectId, '.1.3.6.1.4.1.25053.3.1')) {
|
||||
$os = 'ruckuswireless';
|
||||
|
||||
$ruckus_mibs = array(
|
||||
"ruckusZDSystemStats" => "RUCKUS-ZD-SYSTEM-MIB",
|
||||
"ruckusZDWLANTable" => "RUCKUS-ZD-WLAN-MIB",
|
||||
"ruckusZDWLANAPTable" => "RUCKUS-ZD-WLAN-MIB",
|
||||
"ruckusZDWLANAPRadioStatsTable" => "RUCKUS-ZD-WLAN-MIB",
|
||||
);
|
||||
register_mibs($device, $ruckus_mibs, "includes/discovery/os/ruckuswireless.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user