- if(lf->hostname == lf->location)
- {
- snprintf(oa_newlocation, 255, "%s|%s", lf->location, oa_location);
- free(lf->location);
- os_strdup(oa_newlocation, lf->location);
- lf->hostname = lf->location;
- }
- else
+
+ snprintf(agent_file, OS_SIZE_1024, "%s/%s->%s",
+ AGENTINFO_DIR, lf->hostname, lf->location);
+
+ snprintf(oa_newlocation, 255, "%s|%s", lf->location, oa_location);
+ free(lf->location);
+ os_strdup(oa_newlocation, lf->location);
+ lf->hostname = lf->location;
+
+
+
+ /* Writting to the agent file */
+ fp = fopen(agent_file, "w");
+ if(fp)