mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix: discovery.php -h all stops working after ping only device (#7593)
* Temporary array per device in discovery. * Return at the beginning of discover_device() if snmp_disable.
This commit is contained in:
@@ -110,6 +110,10 @@ function load_discovery(&$device)
|
||||
|
||||
function discover_device(&$device, $options = null)
|
||||
{
|
||||
if ($device['snmp_disable'] == '1') {
|
||||
return;
|
||||
}
|
||||
|
||||
global $valid;
|
||||
|
||||
$valid = array();
|
||||
@@ -145,19 +149,15 @@ function discover_device(&$device, $options = null)
|
||||
echo "\n";
|
||||
|
||||
$force_module = false;
|
||||
if ($device['snmp_disable'] != '1') {
|
||||
// If we've specified modules, use them, else walk the modules array
|
||||
if ($options['m']) {
|
||||
Config::set('discovery_modules', array());
|
||||
foreach (explode(',', $options['m']) as $module) {
|
||||
if (is_file("includes/discovery/$module.inc.php")) {
|
||||
Config::set("discovery_modules.$module", 1);
|
||||
$force_module = true;
|
||||
}
|
||||
// If we've specified modules, use them, else walk the modules array
|
||||
if ($options['m']) {
|
||||
Config::set('discovery_modules', array());
|
||||
foreach (explode(',', $options['m']) as $module) {
|
||||
if (is_file("includes/discovery/$module.inc.php")) {
|
||||
Config::set("discovery_modules.$module", 1);
|
||||
$force_module = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Config::set('discovery_modules', array());
|
||||
}
|
||||
foreach (Config::get('discovery_modules', array()) as $module => $module_status) {
|
||||
$os_module_status = Config::getOsSetting($device['os'], "discovery_modules.$module");
|
||||
|
Reference in New Issue
Block a user