mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Alternate Poller IP instead of Hostname (#10981)
* optional alternative poller ip * add missing schema update * . * enhance API Call 'add_device' with overwrite_ip key * . * . * updating docs
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Device;
|
||||
use LibreNMS\Config;
|
||||
use LibreNMS\RRD\RrdDefinition;
|
||||
|
||||
@@ -43,7 +44,7 @@ function add_service($device, $type, $desc, $ip = 'localhost', $param = "", $ign
|
||||
}
|
||||
|
||||
if (empty($ip)) {
|
||||
$ip = $device['hostname'];
|
||||
$ip = Device::pollerTarget($device['hostname']);
|
||||
}
|
||||
|
||||
$insert = array('device_id' => $device['device_id'], 'service_ip' => $ip, 'service_type' => $type, 'service_changed' => array('UNIX_TIMESTAMP(NOW())'), 'service_desc' => $desc, 'service_param' => $param, 'service_ignore' => $ignore, 'service_status' => 3, 'service_message' => 'Service not yet checked', 'service_ds' => '{}', 'service_disabled' => $disabled);
|
||||
|
Reference in New Issue
Block a user