In include/hosts.inc.php around line 1122 in the "validate_templates" function comment out the second check (which is the check for duplicate applications)
It should look like this..
Yeah I know it disables the application duplicate check, but as many have found out. things work fine w/ dup applications between templates. and It contradicts Alexei own comment here where he encourages another user to duplicate the application across templates.
It should look like this..
Yeah I know it disables the application duplicate check, but as many have found out. things work fine w/ dup applications between templates. and It contradicts Alexei own comment here where he encourages another user to duplicate the application across templates.
Code:
function validate_templates($templateid_list)
{
if(is_numeric($templateid_list))return true;
if(!is_array($templateid_list)) return false;
if(count($templateid_list)<2) return true;
$result = true;
$db_cnt = DBfetch(DBselect('select key_,type,count(*) as cnt from items '.
' where hostid in ('.implode(',',$templateid_list).') '.
' group by key_,type order by cnt desc'
));
$result &= $db_cnt['cnt'] > 1 ? false : true;
/*$db_cnt = DBfetch(DBselect('select name,count(*) as cnt from applications '.
' where hostid in ('.implode(',',$templateid_list).') '.
' group by name order by cnt desc'
));
$result &= $db_cnt['cnt'] > 1 ? false : true;*/
return $result;
}


Here is my previous post with the fix.
It's a very logical thing to want to do, to create multiple templates specific to application groups. Seems barking mad that I have to invent unique application names for each template if I want to link them all to the same server.
Comment