Updated to log discovery info via discover_new_device()

This commit is contained in:
laf
2015-07-12 19:57:25 +01:00
parent 2ff989474c
commit 1bbe1b7ccf
3 changed files with 8 additions and 14 deletions

View File

@@ -11,7 +11,7 @@
* See COPYING for more details.
*/
function discover_new_device($hostname)
function discover_new_device($hostname,$device,$method)
{
global $config, $debug;
@@ -44,6 +44,11 @@ function discover_new_device($hostname)
echo("+[".$remote_device['hostname']."(".$remote_device['device_id'].")]");
discover_device($remote_device);
device_by_id_cache($remote_device_id, 1);
if ($remote_device_id) {
log_event("Device $". $remote_device['hostname'] ." ($ip) autodiscovered through $method on ".$device['hostname'], $remote_device_id, 'system');
} else {
log_event("$method discovery of ". $remote_device['hostname'] ." ($ip) failed - check ping and SNMP access", $device['device_id'], 'system');
}
return $remote_device_id;
}
} else {