anchor.diff:  			 [IpTuple|_] = Hostent#hostent.h_addr_list,
   			 IpTuple
   		 end,
  -    ok = snmpm:register_agent(Uid, NewAgentIp, AgentUdpPort),   
  -    lists:foreach(fun({Item, Val}) ->
  -			  snmpm:update_agent_info(Uid, NewAgentIp, 
  -						  AgentUdpPort, Item, Val)
  -		  end, AgentConf),
  -    setup_managed_agents(Rest).
  +    AgentConf =
  +	case lists:keymember(engine_id,1,AgentConf0) of
  +	    true ->
  +		AgentConf0;
  +	    false ->
  +		DefaultEngineID = ct:get_config({AgentConfName,agent_engine_id},
  +						?AGENT_ENGINE_ID),
  +		[{engine_id,DefaultEngineID}|AgentConf0]
  +	end,
  +    ok = snmpm:register_agent(Uid, target_name(AgentName),
  +			      [{address,NewAgentIp},{port,AgentUdpPort} |
  +			       AgentConf]),
  +    setup_managed_agents(AgentConfName,Rest).
   %%%---------------------------------------------------------------------------
   setup_usm_users(UsmUsers, EngineID)->
       lists:foreach(fun({UsmUser, Conf}) ->
  
positive.code: %%% @doc Issues a synchronous snmp set request. 
  set_values(Agent, VarsAndVals, MgrAgentConfName, Config) ->
      PrivDir = ?config(priv_dir, Config),
      [Uid, AgentIp, AgentUdpPort | _] = 
  	agent_conf(Agent, MgrAgentConfName),
      Oids = lists:map(fun({Oid, _, _}) -> Oid end, VarsAndVals),
      {ok, SnmpGetReply, _} =
  	snmpm:g(Uid, AgentIp, AgentUdpPort, Oids),
      {ok, SnmpSetReply, _} =
  	snmpm:s(Uid, AgentIp, AgentUdpPort, VarsAndVals),
      case SnmpSetReply of
  	{noError, 0, _} when PrivDir /= false ->
  	    log(PrivDir, Agent, SnmpGetReply, VarsAndVals);
  
negative.code: %%%
  %%% @doc Issues a synchronous snmp get request. 
  get_values(Agent, Oids, MgrAgentConfName) ->
      [Uid | _] = agent_conf(Agent, MgrAgentConfName),
      {ok, SnmpReply, _} = snmpm:sync_get2(Uid, target_name(Agent), Oids),
      SnmpReply.
  
  %%% @spec get_next_values(Agent, Oids, MgrAgentConfName) -> SnmpReply 
  