mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: Actually reload oxidized when we should not when we think we should (#6515)
This commit is contained in:
committed by
Tony Murray
parent
6b5faa75dd
commit
153f0de12f
@@ -131,6 +131,10 @@ $proctime = substr($run, 0, 5);
|
|||||||
|
|
||||||
if ($discovered_devices) {
|
if ($discovered_devices) {
|
||||||
dbInsert(array('type' => 'discover', 'doing' => $doing, 'start' => $start, 'duration' => $proctime, 'devices' => $discovered_devices, 'poller' => $config['distributed_poller_name']), 'perf_times');
|
dbInsert(array('type' => 'discover', 'doing' => $doing, 'start' => $start, 'duration' => $proctime, 'devices' => $discovered_devices, 'poller' => $config['distributed_poller_name']), 'perf_times');
|
||||||
|
if ($doing === 'new') {
|
||||||
|
// We have added a new device by this point so we might want to do some other work
|
||||||
|
oxidized_reload_nodes();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$string = $argv[0]." $doing ".date($config['dateformat']['compact'])." - $discovered_devices devices discovered in $proctime secs";
|
$string = $argv[0]." $doing ".date($config['dateformat']['compact'])." - $discovered_devices devices discovered in $proctime secs";
|
||||||
|
@@ -371,6 +371,7 @@ function delete_device($id)
|
|||||||
|
|
||||||
$ret .= "Removed device $host\n";
|
$ret .= "Removed device $host\n";
|
||||||
log_event("Device $host has been removed", 0, 'system', 3);
|
log_event("Device $host has been removed", 0, 'system', 3);
|
||||||
|
oxidized_reload_nodes();
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -718,7 +719,6 @@ function createHost(
|
|||||||
|
|
||||||
$device_id = dbInsert($device, 'devices');
|
$device_id = dbInsert($device, 'devices');
|
||||||
if ($device_id) {
|
if ($device_id) {
|
||||||
oxidized_reload_nodes();
|
|
||||||
return $device_id;
|
return $device_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1559,7 +1559,7 @@ function oxidized_reload_nodes()
|
|||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if ($config['oxidized']['enabled'] === true && $config['oxidized']['reload_nodes'] === true && isset($config['oxidized']['url'])) {
|
if ($config['oxidized']['enabled'] === true && $config['oxidized']['reload_nodes'] === true && isset($config['oxidized']['url'])) {
|
||||||
$oxidized_reload_url = $config['oxidized']['url'] . '/reload?format=json';
|
$oxidized_reload_url = $config['oxidized']['url'] . '/reload.json';
|
||||||
$ch = curl_init($oxidized_reload_url);
|
$ch = curl_init($oxidized_reload_url);
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
|
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
|
||||||
|
Reference in New Issue
Block a user