mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Basic commit
This commit is contained in:
@@ -580,6 +580,7 @@ function createHost($host, $community = NULL, $snmpver, $port = 161, $transport
|
||||
if (host_exists($host) === false) {
|
||||
$device_id = dbInsert($device, 'devices');
|
||||
if ($device_id) {
|
||||
oxidized_reload_nodes();
|
||||
return($device_id);
|
||||
}
|
||||
else {
|
||||
@@ -1302,3 +1303,20 @@ function warn_innodb_buffer($innodb_buffer) {
|
||||
$output .= 'Config proposal: "innodb_buffer_pool_size = '.pow(2,ceil(log(($innodb_buffer['used'] / 1024 / 1024),2))).'M"'.PHP_EOL;
|
||||
return $output;
|
||||
}
|
||||
|
||||
function oxidized_reload_nodes() {
|
||||
|
||||
global $config;
|
||||
|
||||
if ($config['oxidized']['enabled'] === TRUE && $config['oxidized']['reload_nodes'] === TRUE && isset($config['oxidized']['url'])) {
|
||||
$oxidized_reload_url = $config['oxidized']['url'] . '/reload';
|
||||
$ch = curl_init($oxidized_reload_url);
|
||||
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 1);
|
||||
curl_exec($ch);
|
||||
curl_close($ch);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user