/*****************************************************************************
*
* XPDDEFAULT.C - Default performance data routines
*
* Copyright (c) 2000-2007 Ethan Galstad (nagios@nagios.org)
* Last Modified: 03-12-2007
*
* License:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*****************************************************************************/
/*********** COMMON HEADER FILES ***********/
#include "../include/config.h"
#include "../include/common.h"
#include "../include/objects.h"
#include "../include/nagios.h"
/**** DATA INPUT-SPECIFIC HEADER FILES ****/
#include "xpddefault.h"
int xpddefault_perfdata_timeout;
char *xpddefault_host_perfdata_command=NULL;
char *xpddefault_service_perfdata_command=NULL;
char *xpddefault_host_perfdata_file_template=NULL;
char *xpddefault_service_perfdata_file_template=NULL;
char *xpddefault_host_perfdata_file=NULL;
char *xpddefault_service_perfdata_file=NULL;
int xpddefault_host_perfdata_file_append=TRUE;
int xpddefault_service_perfdata_file_append=TRUE;
unsigned long xpddefault_host_perfdata_file_processing_interval=0L;
unsigned long xpddefault_service_perfdata_file_processing_interval=0L;
char *xpddefault_host_perfdata_file_processing_command;
char *xpddefault_service_perfdata_file_processing_command;
FILE *xpddefault_host_perfdata_fp=NULL;
FILE *xpddefault_service_perfdata_fp=NULL;
extern char *macro_x[MACRO_X_COUNT];
/******************************************************************/
/************** INITIALIZATION & CLEANUP FUNCTIONS ****************/
/******************************************************************/
/* initializes performance data */
int xpddefault_initialize_performance_data(char *config_file){
char buffer[MAX_INPUT_BUFFER];
char temp_buffer[MAX_INPUT_BUFFER];
char *temp_command_name;
time_t current_time;
time(¤t_time);
/* default values */
xpddefault_perfdata_timeout=DEFAULT_PERFDATA_TIMEOUT;
xpddefault_host_perfdata_command=NULL;
xpddefault_service_perfdata_command=NULL;
xpddefault_host_perfdata_file_template=NULL;
xpddefault_service_perfdata_file_template=NULL;
xpddefault_host_perfdata_file=NULL;
xpddefault_service_perfdata_file=NULL;
xpddefault_host_perfdata_fp=NULL;
xpddefault_service_perfdata_fp=NULL;
xpddefault_host_perfdata_file_processing_interval=0L;
xpddefault_service_perfdata_file_processing_interval=0L;
xpddefault_host_perfdata_file_processing_command=NULL;
xpddefault_service_perfdata_file_processing_command=NULL;
/* grab config info from main config file */
xpddefault_grab_config_info(config_file);
/* make sure we have some templates defined */
if(xpddefault_host_perfdata_file_template==NULL)
xpddefault_host_perfdata_file_template=strdup(DEFAULT_HOST_PERFDATA_FILE_TEMPLATE);
=1= |