1 /* @(#) $Id: monitor_agents.c,v 1.5 2009/06/24 17:06:27 dcid Exp $ */
3 /* Copyright (C) 2009 Trend Micro Inc.
6 * This program is a free software; you can redistribute it
7 * and/or modify it under the terms of the GNU General Public
8 * License (version 3) as published by the FSF - Free Software
15 #include "read-agents.h"
24 av_agents = get_agents(GA_ACTIVE);
30 mond.agents = av_agents;
34 /* Checking if any of the previous available agents
37 cr_agents = mond.agents;
44 while(tmp_av && *tmp_av)
46 if(strcmp(*cr_agents, *tmp_av) == 0)
54 /* Agent disconnected */
57 char str[OS_SIZE_1024 +1];
59 /* Sending disconnected message */
60 snprintf(str, OS_SIZE_1024 -1, OS_AG_DISCON, *cr_agents);
61 if(SendMSG(mond.a_queue, str, ARGV0,
64 merror(QUEUE_SEND, ARGV0);
72 /* Removing old agent list and adding currently one */
73 free_agents(mond.agents);
74 mond.agents = av_agents;