Added fallback for poller_group if empty

This commit is contained in:
laf
2015-05-24 20:48:54 +01:00
parent 26ee1cbeb7
commit 071dd060a3

View File

@ -526,8 +526,12 @@ function utime()
function createHost($host, $community = NULL, $snmpver, $port = 161, $transport = 'udp', $v3 = array(), $poller_group='0') function createHost($host, $community = NULL, $snmpver, $port = 161, $transport = 'udp', $v3 = array(), $poller_group='0')
{ {
global $config;
$host = trim(strtolower($host)); $host = trim(strtolower($host));
if (is_numeric($poller_group) === FALSE) {
$poller_group = $config['distributed_poller_group'];
}
$device = array('hostname' => $host, $device = array('hostname' => $host,
'sysName' => $host, 'sysName' => $host,
'community' => $community, 'community' => $community,