-/* @(#) $Id: agentlessd.c,v 1.13 2009/06/24 17:06:20 dcid Exp $ */
+/* @(#) $Id$ */
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
*
* This program is a free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public
- * License (version 3) as published by the FSF - Free Software
+ * License (version 2) as published by the FSF - Free Software
* Foundation
*/
+/* Send generic log message. */
+int send_log_msg(char *script, char *host, char *msg)
+{
+ char sys_location[1024 +1];
+
+ sys_location[1024] = '\0';
+ snprintf(sys_location, 1024, "(%s) %s->%s", script, host, SYSCHECK);
+
+ if(SendMSG(lessdc.queue, msg, sys_location, LOCALFILE_MQ) < 0)
+ {
+ merror(QUEUE_SEND, ARGV0);
+ if((lessdc.queue = StartMQ(DEFAULTQPATH, WRITE)) < 0)
+ {
+ ErrorExit(QUEUE_FATAL, ARGV0, DEFAULTQPATH);
+ }
+
+ /* If we reach here, we can try to send it again */
+ SendMSG(lessdc.queue, msg, sys_location, LOCALFILE_MQ);
+ }
+ return(0);
+}
+
+
+
/* Generate diffs alerts. */
int gen_diff_alert(char *host, char *script, int alert_diff_time)
{
send_intcheck_msg(entry->type, entry->server[i]+1,
tmp_str);
}
+ else if(strncmp(buf, "LOG: ", 4) == 0)
+ {
+ tmp_str = buf + 5;
+ send_log_msg(entry->type, entry->server[i]+1,
+ tmp_str);
+ }
else if((entry->state & LESSD_STATE_DIFF) &&
(strncmp(buf, "STORE: ", 7) == 0))
{