/* * Copyright (C) 2008 Groundwork Open Source * Written by Daniel Emmanuel Feinsmith * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301, USA. * * File: bronx_config.h * Author: root * * Created on October 16, 2007, 2:12 PM */ #ifndef _BRONX_CONFIG_H #define _BRONX_CONFIG_H #ifdef __cplusplus extern "C" { #endif #define BRONX_PATH_MAX 256 #define BRONX_FN_MAX 32 #define BRONX_CONFIG_TYPE_MAX 8 #define BRONX_CONFIG_ADDR_MAX 32 #define BRONX_CONFIG_NUM_ROUTES 64 #define BRONX_CONFIG_NUM_ALLOWED_HOSTS 128 #define BRONX_MAX_INPUT_BUFFER 1024 #define BRONX_NAGIOS_CMD_DENY 0 #define BRONX_NAGIOS_CMD_ALLOW 1 #define BRONX_NAGIOS_CMD_PASSWD_ALLOW 2 /* * Queue Insertion Method */ #define BRONX_QIM_IMMEDIATE 1 /* * Our configuration structure. */ typedef struct { char config_filename[BRONX_PATH_MAX]; // Full pathname of our bronx configuration file. /* * Configuration file options */ // Global options: int listener; char database_dir[BRONX_PATH_MAX]; int queue_size; // In # of Entries. int soft_state_changes; // bool, are soft state changes processed? int spillover_on_queue_full; // bool, should we spillover if the queue is full? int seconds_between_reconnect_attempts; int consolidation; // bool, send consolidation message? int startup_pause_timer; // # of seconds to pause after startup before starting processing. unsigned long tcp_socket_timeout; // tcp socket timeout. int num_aggregators; // # of aggregators. Helpful to know, if 0, can save processing time. // Listener configration parameters int listener_port; char listener_address[BRONX_CONFIG_ADDR_MAX]; char listener_password[BRONX_MAX_INPUT_BUFFER]; int listener_encryption_method; unsigned long listener_max_packet_age; char listener_allowed_hosts[BRONX_CONFIG_NUM_ALLOWED_HOSTS][BRONX_CONFIG_ADDR_MAX]; int listener_num_allowed_hosts; int listener_nagios_cmd_execution; // Auto-Add parameters. int listener_auto_add; FILE *listener_auto_add_log; int listener_auto_add_queue_size; char listener_auto_add_objects_cache[BRONX_PATH_MAX]; // Routes route_definition routes[BRONX_CONFIG_NUM_ROUTES]; int num_routes; } configuration_criteria; /* * Externally defined functions. */ extern void config_dump(configuration_criteria *); extern void config_set_defaults(configuration_criteria *config); extern int parse_args(configuration_criteria *config, char *args); extern int read_config_file(configuration_criteria *config); #ifdef __cplusplus } #endif #endif /* _BRONX_CONFIG_H */