1 /* @(#) $Id: ./src/util/verify-agent-conf.c, 2011/09/08 dcid Exp $
4 /* Copyright (C) 2010 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
15 #include "config/localfile-config.h"
16 #include "config/config.h"
17 #include "logcollector/logcollector.h"
21 #define ARGV0 "verify-agent-conf"
27 printf("\nOSSEC HIDS %s: Verify agent.conf syntax for errors.\n", ARGV0);
28 printf("Usage: %s [-f <agent.conf file>]\n\n", ARGV0);
29 printf("Available options:\n");
30 printf("\t-h This help message.\n");
31 printf("\t-f Full file name and path to config file to be tested.\n");
32 printf("\t If this option is not specified the following default\n");
33 printf("\t will be used.\n");
35 printf("\t Validation is successful, if no errors are shown.\n");
40 /* main: v0.3: 2005/04/04 */
41 int main(int argc, char **argv)
46 logreader_config log_config;
49 /* Setting the name */
53 /* printf ("Agrc [%d], Argv [%s]\n", argc, *argv); */
58 while((c = getopt(argc, argv, "Vdhf:")) != -1)
73 merror("%s: -f needs an argument",ARGV0);
88 printf("\n%s: Verifying [%s].\n\n", ARGV0, ar);
91 modules|= CAGENT_CONFIG;
92 log_config.config = NULL;
93 if(ReadConfig(modules, ar, &log_config, NULL) < 0)
98 logff = log_config.config;