Back to index

nagios-plugins  1.4.16
Classes | Defines | Typedefs | Functions
parse_ini.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  np_arg_el


#define MAX_INPUT_BUFFER   8192
#define NP_DEFAULT_INI_FILENAME1   "plugins.ini"
#define NP_DEFAULT_INI_FILENAME2   "nagios-plugins.ini"
#define NP_DEFAULT_INI_NAGIOS_PATH1   "/etc/nagios"
#define NP_DEFAULT_INI_NAGIOS_PATH2   "/usr/local/nagios/etc"
#define NP_DEFAULT_INI_NAGIOS_PATH3   "/usr/local/etc/nagios"
#define NP_DEFAULT_INI_NAGIOS_PATH4   "/etc/opt/nagios"
#define NP_DEFAULT_INI_PATH1   "/etc"
#define NP_DEFAULT_INI_PATH2   "/usr/local/etc"
#define NP_DEFAULT_INI_PATH3   "/etc/opt"


typedef struct np_arg_el np_arg_list


np_arg_listnp_get_defaults (const char *locator, const char *default_section)

Class Documentation

struct np_arg_el

Definition at line 11 of file parse_ini.h.

Collaboration diagram for np_arg_el:
Class Members
char * arg
struct np_arg_el * next

Define Documentation

#define MAX_INPUT_BUFFER   8192

Definition at line 20 of file parse_ini.h.

#define NP_DEFAULT_INI_FILENAME1   "plugins.ini"

Definition at line 25 of file parse_ini.h.

#define NP_DEFAULT_INI_FILENAME2   "nagios-plugins.ini"

Definition at line 28 of file parse_ini.h.

#define NP_DEFAULT_INI_NAGIOS_PATH1   "/etc/nagios"

Definition at line 33 of file parse_ini.h.

#define NP_DEFAULT_INI_NAGIOS_PATH2   "/usr/local/nagios/etc"

Definition at line 36 of file parse_ini.h.

#define NP_DEFAULT_INI_NAGIOS_PATH3   "/usr/local/etc/nagios"

Definition at line 39 of file parse_ini.h.

#define NP_DEFAULT_INI_NAGIOS_PATH4   "/etc/opt/nagios"

Definition at line 42 of file parse_ini.h.

#define NP_DEFAULT_INI_PATH1   "/etc"

Definition at line 47 of file parse_ini.h.

#define NP_DEFAULT_INI_PATH2   "/usr/local/etc"

Definition at line 50 of file parse_ini.h.

#define NP_DEFAULT_INI_PATH3   "/etc/opt"

Definition at line 53 of file parse_ini.h.

Typedef Documentation

typedef struct np_arg_el np_arg_list

Function Documentation

np_arg_list* np_get_defaults ( const char *  locator,
const char *  default_section 

Definition at line 91 of file parse_ini.c.

       FILE *inifile=NULL;
       np_arg_list *defaults=NULL;
       np_ini_info i;

       parse_locator(locator, default_section, &i);
       /* if a file was specified or if we're using the default file */
       if(i.file != NULL && strlen(i.file) > 0){
              if(strcmp(i.file, "-")==0){
              } else {
                     inifile=fopen(i.file, "r");
              if(inifile==NULL) die(STATE_UNKNOWN, _("Can't read config file"));
              if(read_defaults(inifile, i.stanza, &defaults)==FALSE)
                     die(STATE_UNKNOWN, _("Invalid section '%s' in config file '%s'\n"), i.stanza, i.file);

              if(inifile!=stdin) fclose(inifile);
       return defaults;

Here is the call graph for this function:

Here is the caller graph for this function: