mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 16:26:55 +02:00
change setting to dp_autocreate (with fallback to cdp_autocreate), allowing new device discovery through discovery protocols to be disabled
git-svn-id: http://www.observium.org/svn/observer/trunk@2464 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -71,7 +71,7 @@ $config['snmp']['transports'] = array('udp', 'udp6', 'tcp', 'tcp6');
|
|||||||
|
|
||||||
### Autodiscovery Settings
|
### Autodiscovery Settings
|
||||||
|
|
||||||
$config['cdp_autocreate'] = false; ## Autodiscover unknown hosts seen via CDP
|
$config['dp_autocreate'] = false; ## Autodiscover unknown hosts seen via discovery protocols
|
||||||
$config['snmp_autodiscovery'] = false; ## Autodiscover hosts on new subnets
|
$config['snmp_autodiscovery'] = false; ## Autodiscover hosts on new subnets
|
||||||
$config['discover_services'] = false; ## Autodiscover services via SNMP on devices of type "server"
|
$config['discover_services'] = false; ## Autodiscover services via SNMP on devices of type "server"
|
||||||
|
|
||||||
|
|||||||
@@ -14,10 +14,12 @@
|
|||||||
|
|
||||||
function discover_new_device($hostname)
|
function discover_new_device($hostname)
|
||||||
{
|
{
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if ( isDomainResolves($hostname . "." . $config['mydomain']) ) {
|
if ($config['dp_autocreate'])
|
||||||
|
{
|
||||||
|
if (isDomainResolves($hostname . "." . $config['mydomain']))
|
||||||
|
{
|
||||||
$dst_host = $hostname . "." . $config['mydomain'];
|
$dst_host = $hostname . "." . $config['mydomain'];
|
||||||
} else {
|
} else {
|
||||||
$dst_host = $hostname;
|
$dst_host = $hostname;
|
||||||
@@ -27,7 +29,8 @@ function discover_new_device($hostname)
|
|||||||
if (match_network($config['nets'], $ip))
|
if (match_network($config['nets'], $ip))
|
||||||
{
|
{
|
||||||
$remote_device_id = addHost ($dst_host, NULL, "v2c");
|
$remote_device_id = addHost ($dst_host, NULL, "v2c");
|
||||||
if($remote_device_id) {
|
if($remote_device_id)
|
||||||
|
{
|
||||||
$remote_device = device_by_id_cache($remote_device_id, 1);
|
$remote_device = device_by_id_cache($remote_device_id, 1);
|
||||||
echo("+[".$remote_device['hostname']."(".$remote_device['device_id'].")]");
|
echo("+[".$remote_device['hostname']."(".$remote_device['device_id'].")]");
|
||||||
discover_device($remote_device);
|
discover_device($remote_device);
|
||||||
@@ -36,6 +39,7 @@ function discover_new_device($hostname)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function discover_device($device, $options = NULL)
|
function discover_device($device, $options = NULL)
|
||||||
|
|||||||
@@ -946,6 +946,11 @@ if (!isset($config['log_file']))
|
|||||||
$config['log_file'] = $config['install_dir'] . "/observium.log";
|
$config['log_file'] = $config['install_dir'] . "/observium.log";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($config['cdp_autocreate']))
|
||||||
|
{
|
||||||
|
$config['dp_autocreate'] = $config['cdp_autocreate'];
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($config['mibdir']))
|
if (!isset($config['mibdir']))
|
||||||
{
|
{
|
||||||
$config['mibdir'] = $config['install_dir']."/mibs/";
|
$config['mibdir'] = $config['install_dir']."/mibs/";
|
||||||
|
|||||||
Reference in New Issue
Block a user