1 /* @(#) $Id: ./src/monitord/monitor_agents.c, 2011/09/08 dcid Exp $
4 /* Copyright (C) 2009 Trend Micro Inc.
7 * This program is a free software; you can redistribute it
8 * and/or modify it under the terms of the GNU General Public
9 * License (version 2) as published by the FSF - Free Software
16 #include "read-agents.h"
25 av_agents = get_agents(GA_ACTIVE);
31 mond.agents = av_agents;
35 /* Checking if any of the previous available agents
38 cr_agents = mond.agents;
45 while(tmp_av && *tmp_av)
47 if(strcmp(*cr_agents, *tmp_av) == 0)
55 /* Agent disconnected */
58 char str[OS_SIZE_1024 +1];
60 /* Sending disconnected message */
61 snprintf(str, OS_SIZE_1024 -1, OS_AG_DISCON, *cr_agents);
62 if(SendMSG(mond.a_queue, str, ARGV0,
65 merror(QUEUE_SEND, ARGV0);
73 /* Removing old agent list and adding currently one */
74 free_agents(mond.agents);
75 mond.agents = av_agents;