mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #3929 from murrant/discovery-events
addHost: Reduce discovery event logs of existing devices and adds better error messages when adding hosts
This commit is contained in:
@@ -290,13 +290,13 @@ function add_device() {
|
||||
}
|
||||
if (empty($message)) {
|
||||
$result = addHost($hostname, $snmpver, $port, $transport, 1, $poller_group, $force_add);
|
||||
if ($result) {
|
||||
if (is_numeric($result)) {
|
||||
$code = 201;
|
||||
$status = 'ok';
|
||||
$message = "Device $hostname has been added successfully";
|
||||
}
|
||||
else {
|
||||
$message = "Failed adding $hostname";
|
||||
$message = $result;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user