Icinga-core 1.4.0
next gen monitoring
module/idoutils/src/ido2db.c File Reference
#include "../../../include/config.h"
#include "../include/common.h"
#include "../include/io.h"
#include "../include/utils.h"
#include "../include/protoapi.h"
#include "../include/ido2db.h"
#include "../include/db.h"
#include "../include/dbhandlers.h"

Go to the source code of this file.

Functions

int ido2db_open_debug_log (void)
int ido2db_close_debug_log (void)
int main (int argc, char **argv)
int ido2db_process_arguments (int argc, char **argv)
int ido2db_process_config_file (char *filename)
int ido2db_process_config_var (char *arg)
int ido2db_initialize_variables (void)
int ido2db_free_program_memory (void)
int ido2db_check_init_reqs (void)
int ido2db_drop_privileges (char *user, char *group)
int ido2db_daemonize (void)
int ido2db_cleanup_socket (void)
void ido2db_parent_sighandler (int sig)
void ido2db_child_sighandler (int sig)
int ido2db_wait_for_connections (void)
int ido2db_handle_client_connection (int sd)
int ido2db_idi_init (ido2db_idi *idi)
int ido2db_check_for_client_input (ido2db_idi *idi)
int ido2db_handle_client_input (ido2db_idi *idi, char *buf)
int ido2db_start_input_data (ido2db_idi *idi)
int ido2db_add_input_data_item (ido2db_idi *idi, int type, char *buf)
int ido2db_add_input_data_mbuf (ido2db_idi *idi, int type, int mbuf_slot, char *buf)
int ido2db_end_input_data (ido2db_idi *idi)
int ido2db_free_input_memory (ido2db_idi *idi)
int ido2db_free_connection_memory (ido2db_idi *idi)
int ido2db_convert_standard_data_elements (ido2db_idi *idi, int *type, int *flags, int *attr, struct timeval *tstamp)
int ido2db_convert_string_to_int (char *buf, int *i)
int ido2db_convert_string_to_float (char *buf, float *f)
int ido2db_convert_string_to_double (char *buf, double *d)
int ido2db_convert_string_to_long (char *buf, long *l)
int ido2db_convert_string_to_unsignedlong (char *buf, unsigned long *ul)
int ido2db_convert_string_to_timeval (char *buf, struct timeval *tv)
int ido2db_log_debug_info (int level, int verbosity, const char *fmt,...)
void * ido2db_thread_worker (void *data)
void * ido2db_thread_cleanup (void *data)
int ido2db_terminate_threads (void)
int terminate_worker_thread (void)
int terminate_cleanup_thread (void)

Variables

int use_ssl
int errno
char * ido2db_db_tablenames [IDO2DB_MAX_DBTABLES]
ido_dbuf dbuf
char * ido2db_config_file = NULL
char * lock_file = NULL
char * ido2db_user = NULL
char * ido2db_group = NULL
int ido2db_sd = 0
int ido2db_socket_type = IDO_SINK_UNIXSOCKET
char * ido2db_socket_name = NULL
int ido2db_tcp_port = IDO_DEFAULT_TCP_PORT
int ido2db_use_inetd = IDO_FALSE
int ido2db_show_version = IDO_FALSE
int ido2db_show_license = IDO_FALSE
int ido2db_show_help = IDO_FALSE
int ido2db_run_foreground = IDO_FALSE
ido2db_dbconfig ido2db_db_settings
ido2db_idi thread_idi
pthread_t thread_pool [IDO2DB_NR_OF_THREADS]
time_t ido2db_db_last_checkin_time = 0L
char * ido2db_debug_file = NULL
int ido2db_debug_level = IDO2DB_DEBUGL_NONE
int ido2db_debug_verbosity = IDO2DB_DEBUGV_BASIC
FILE * ido2db_debug_file_fp = NULL
unsigned long ido2db_max_debug_file_size = 0L
int stop_signal_detected = IDO_FALSE
char * sigs [35] = {"EXIT","HUP","INT","QUIT","ILL","TRAP","ABRT","BUS","FPE","KILL","USR1","SEGV","USR2","PIPE","ALRM","TERM","STKFLT","CHLD","CONT","STOP","TSTP","TTIN","TTOU","URG","XCPU","XFSZ","VTALRM","PROF","WINCH","IO","PWR","UNUSED","ZERR","DEBUG",(char *)NULL}
int dummy

Function Documentation

int ido2db_add_input_data_item ( ido2db_idi idi,
int  type,
char *  buf 
)

Definition at line 1866 of file ido2db.c.

int ido2db_add_input_data_mbuf ( ido2db_idi idi,
int  type,
int  mbuf_slot,
char *  buf 
)

Definition at line 2046 of file ido2db.c.

int ido2db_check_for_client_input ( ido2db_idi idi)

Definition at line 1440 of file ido2db.c.

int ido2db_check_init_reqs ( void  )

Definition at line 705 of file ido2db.c.

void ido2db_child_sighandler ( int  sig)

Definition at line 984 of file ido2db.c.

int ido2db_cleanup_socket ( void  )

Definition at line 921 of file ido2db.c.

int ido2db_close_debug_log ( void  )

Definition at line 2543 of file ido2db.c.

int ido2db_convert_standard_data_elements ( ido2db_idi idi,
int *  type,
int *  flags,
int *  attr,
struct timeval *  tstamp 
)

Definition at line 2366 of file ido2db.c.

int ido2db_convert_string_to_double ( char *  buf,
double *  d 
)

Definition at line 2427 of file ido2db.c.

int ido2db_convert_string_to_float ( char *  buf,
float *  f 
)

Definition at line 2402 of file ido2db.c.

int ido2db_convert_string_to_int ( char *  buf,
int *  i 
)

Definition at line 2388 of file ido2db.c.

int ido2db_convert_string_to_long ( char *  buf,
long *  l 
)

Definition at line 2446 of file ido2db.c.

int ido2db_convert_string_to_timeval ( char *  buf,
struct timeval *  tv 
)

Definition at line 2485 of file ido2db.c.

int ido2db_convert_string_to_unsignedlong ( char *  buf,
unsigned long *  ul 
)

Definition at line 2466 of file ido2db.c.

int ido2db_daemonize ( void  )

Definition at line 797 of file ido2db.c.

int ido2db_drop_privileges ( char *  user,
char *  group 
)

Definition at line 722 of file ido2db.c.

int ido2db_end_input_data ( ido2db_idi idi)

Definition at line 2095 of file ido2db.c.

int ido2db_free_connection_memory ( ido2db_idi idi)

Definition at line 2327 of file ido2db.c.

int ido2db_free_input_memory ( ido2db_idi idi)

Definition at line 2281 of file ido2db.c.

int ido2db_free_program_memory ( void  )

Definition at line 646 of file ido2db.c.

int ido2db_handle_client_connection ( int  sd)

Definition at line 1176 of file ido2db.c.

int ido2db_handle_client_input ( ido2db_idi idi,
char *  buf 
)

Definition at line 1507 of file ido2db.c.

int ido2db_idi_init ( ido2db_idi idi)

Definition at line 1397 of file ido2db.c.

int ido2db_initialize_variables ( void  )

Definition at line 609 of file ido2db.c.

int ido2db_log_debug_info ( int  level,
int  verbosity,
const char *  fmt,
  ... 
)

Definition at line 2555 of file ido2db.c.

int ido2db_open_debug_log ( void  )

Definition at line 2523 of file ido2db.c.

void ido2db_parent_sighandler ( int  sig)

Definition at line 945 of file ido2db.c.

int ido2db_process_arguments ( int  argc,
char **  argv 
)

Definition at line 325 of file ido2db.c.

int ido2db_process_config_file ( char *  filename)

Definition at line 401 of file ido2db.c.

int ido2db_process_config_var ( char *  arg)

Definition at line 445 of file ido2db.c.

int ido2db_start_input_data ( ido2db_idi idi)

Definition at line 1841 of file ido2db.c.

int ido2db_terminate_threads ( void  )

Definition at line 2807 of file ido2db.c.

void* ido2db_thread_cleanup ( void *  data)

Definition at line 2685 of file ido2db.c.

void* ido2db_thread_worker ( void *  data)

Definition at line 2617 of file ido2db.c.

int ido2db_wait_for_connections ( void  )

Definition at line 1015 of file ido2db.c.

int main ( int  argc,
char **  argv 
)

Definition at line 100 of file ido2db.c.

int terminate_cleanup_thread ( void  )

Definition at line 2836 of file ido2db.c.

int terminate_worker_thread ( void  )

Definition at line 2822 of file ido2db.c.


Variable Documentation

Definition at line 41 of file ido2db.c.

int dummy

Definition at line 97 of file ido2db.c.

int errno
char* ido2db_config_file = NULL

Definition at line 58 of file ido2db.c.

Definition at line 80 of file ido2db.c.

Definition at line 76 of file ido2db.c.

char* ido2db_db_tablenames[IDO2DB_MAX_DBTABLES]

Definition at line 200 of file db.c.

char* ido2db_debug_file = NULL

Definition at line 82 of file ido2db.c.

FILE* ido2db_debug_file_fp = NULL

Definition at line 85 of file ido2db.c.

int ido2db_debug_level = IDO2DB_DEBUGL_NONE

Definition at line 83 of file ido2db.c.

int ido2db_debug_verbosity = IDO2DB_DEBUGV_BASIC

Definition at line 84 of file ido2db.c.

char* ido2db_group = NULL

Definition at line 61 of file ido2db.c.

unsigned long ido2db_max_debug_file_size = 0L

Definition at line 86 of file ido2db.c.

int ido2db_run_foreground = IDO_FALSE

Definition at line 74 of file ido2db.c.

int ido2db_sd = 0

Definition at line 63 of file ido2db.c.

int ido2db_show_help = IDO_FALSE

Definition at line 72 of file ido2db.c.

int ido2db_show_license = IDO_FALSE

Definition at line 71 of file ido2db.c.

int ido2db_show_version = IDO_FALSE

Definition at line 70 of file ido2db.c.

char* ido2db_socket_name = NULL

Definition at line 65 of file ido2db.c.

int ido2db_socket_type = IDO_SINK_UNIXSOCKET

Definition at line 64 of file ido2db.c.

int ido2db_tcp_port = IDO_DEFAULT_TCP_PORT

Definition at line 67 of file ido2db.c.

int ido2db_use_inetd = IDO_FALSE

Definition at line 68 of file ido2db.c.

char* ido2db_user = NULL

Definition at line 60 of file ido2db.c.

char* lock_file = NULL

Definition at line 59 of file ido2db.c.

char* sigs[35] = {"EXIT","HUP","INT","QUIT","ILL","TRAP","ABRT","BUS","FPE","KILL","USR1","SEGV","USR2","PIPE","ALRM","TERM","STKFLT","CHLD","CONT","STOP","TSTP","TTIN","TTOU","URG","XCPU","XFSZ","VTALRM","PROF","WINCH","IO","PWR","UNUSED","ZERR","DEBUG",(char *)NULL}

Definition at line 90 of file ido2db.c.

int stop_signal_detected = IDO_FALSE

Definition at line 88 of file ido2db.c.

Definition at line 77 of file ido2db.c.

pthread_t thread_pool[IDO2DB_NR_OF_THREADS]

Definition at line 78 of file ido2db.c.

int use_ssl

Definition at line 20 of file io.c.

 All Data Structures Files Functions Variables Typedefs Defines