PROXY  WHOIS  RQUOTE  TEXTS  SOFT  FOREX  BBOARD
 Music  Philosophy  Code  Literature  Russian

= ROOT|Technical|Code_Examples|C|nagios-2.9|xdata|xpddefault.c =

page 1 of 9



/*****************************************************************************
 *
 * 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=

= PAGE 1 = NEXT > |2|3|4|5|6|7|8|9

UP TO ROOT | UP TO DIR

Google
 


E-mail Facebook Google Digg del.icio.us BlinkList Fark Furl Ma.gnolia Netscape NewsVine Reddit Slashdot Spurl StumbleUpon Technorati YahooMyWeb LiveJournal Blogmarks TwitThis Live News2.ru BobrDobr.ru Memori.ru MoeMesto.ru

0.0182941 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)