Back to index

nagios-plugins  1.4.16
parse_ini.h
Go to the documentation of this file.
00001 #ifndef _PARSE_INI_H_
00002 #define _PARSE_INI_H_
00003 
00004 /*
00005  * parse_ini.h: routines for loading nagios-plugin defaults from ini
00006  * configuration files.
00007  */
00008 
00009 /* np_arg_list is a linked list of arguments passed between the ini
00010  * parser and the argument parser to construct the final array */
00011 typedef struct np_arg_el {
00012        char *arg;
00013        struct np_arg_el *next;
00014 } np_arg_list;
00015 
00016 /* FIXME: This is in plugins/common.c. Should be eventually moved to lib/
00017  * (although for this particular one a configure settings should be ideal)
00018  */
00019 #ifndef MAX_INPUT_BUFFER
00020 # define MAX_INPUT_BUFFER 8192
00021 #endif /* MAX_INPUT_BUFFER */
00022 
00023 /* Filenames (see below) */
00024 #ifndef NP_DEFAULT_INI_FILENAME1
00025 # define NP_DEFAULT_INI_FILENAME1 "plugins.ini"
00026 #endif /* NP_DEFAULT_INI_FILENAME1 */
00027 #ifndef NP_DEFAULT_INI_FILENAME2
00028 # define NP_DEFAULT_INI_FILENAME2 "nagios-plugins.ini"
00029 #endif /* NP_DEFAULT_INI_FILENAME2 */
00030 
00031 /* Config paths ending in nagios (search for NP_DEFAULT_INI_FILENAME1) */
00032 #ifndef NP_DEFAULT_INI_NAGIOS_PATH1
00033 # define NP_DEFAULT_INI_NAGIOS_PATH1 "/etc/nagios"
00034 #endif /* NP_DEFAULT_INI_NAGIOS_PATH1 */
00035 #ifndef NP_DEFAULT_INI_NAGIOS_PATH2
00036 # define NP_DEFAULT_INI_NAGIOS_PATH2 "/usr/local/nagios/etc"
00037 #endif /* NP_DEFAULT_INI_NAGIOS_PATH2 */
00038 #ifndef NP_DEFAULT_INI_NAGIOS_PATH3
00039 # define NP_DEFAULT_INI_NAGIOS_PATH3 "/usr/local/etc/nagios"
00040 #endif /* NP_DEFAULT_INI_NAGIOS_PATH3 */
00041 #ifndef NP_DEFAULT_INI_NAGIOS_PATH4
00042 # define NP_DEFAULT_INI_NAGIOS_PATH4 "/etc/opt/nagios"
00043 #endif /* NP_DEFAULT_INI_NAGIOS_PATH4 */
00044 
00045 /* Config paths not ending in nagios (search for NP_DEFAULT_INI_FILENAME2) */
00046 #ifndef NP_DEFAULT_INI_PATH1
00047 # define NP_DEFAULT_INI_PATH1 "/etc"
00048 #endif /* NP_DEFAULT_INI_PATH1 */
00049 #ifndef NP_DEFAULT_INI_PATH2
00050 # define NP_DEFAULT_INI_PATH2 "/usr/local/etc"
00051 #endif /* NP_DEFAULT_INI_PATH2 */
00052 #ifndef NP_DEFAULT_INI_PATH3
00053 # define NP_DEFAULT_INI_PATH3 "/etc/opt"
00054 #endif /* NP_DEFAULT_INI_PATH3 */
00055 
00056 /* np_load_defaults: load the default configuration (if present) for
00057  * a plugin from the ini file
00058  */
00059 np_arg_list* np_get_defaults(const char *locator, const char *default_section);
00060 
00061 #endif /* _PARSE_INI_H_ */
00062