xdata/xodtemplate.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  * XODTEMPLATE.H - Template-based object configuration data header file
00004  *
00005  * Copyright (c) 1999-2009 Ethan Galstad (egalstad@nagios.org)
00006  * Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
00007  * Copyright (c) 2009-2011 Icinga Development Team (http://www.icinga.org)
00008  *
00009  * License:
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License version 2 as
00013  * published by the Free Software Foundation.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00023  *
00024  *****************************************************************************/
00025 
00026 
00027 #ifndef _XODTEMPLATE_H
00028 #define _XODTEMPLATE_H
00029 
00030 
00031 
00032 /*********** GENERAL DEFINITIONS ************/
00033 
00034 #define XODTEMPLATE_NULL                  "null"
00035 
00036 #define MAX_XODTEMPLATE_INPUT_BUFFER      1024
00037 
00038 #define MAX_XODTEMPLATE_CONTACT_ADDRESSES 6
00039 
00040 #define XODTEMPLATE_NONE                  0
00041 #define XODTEMPLATE_TIMEPERIOD            1
00042 #define XODTEMPLATE_COMMAND               2
00043 #define XODTEMPLATE_CONTACT               3
00044 #define XODTEMPLATE_CONTACTGROUP          4
00045 #define XODTEMPLATE_HOST                  5
00046 #define XODTEMPLATE_HOSTGROUP             6
00047 #define XODTEMPLATE_SERVICE               7
00048 #define XODTEMPLATE_SERVICEDEPENDENCY     8
00049 #define XODTEMPLATE_HOSTGROUPESCALATION   9      /* no longer implemented */
00050 #define XODTEMPLATE_SERVICEESCALATION     10
00051 #define XODTEMPLATE_HOSTESCALATION        11
00052 #define XODTEMPLATE_HOSTDEPENDENCY        12
00053 #define XODTEMPLATE_HOSTEXTINFO           13
00054 #define XODTEMPLATE_SERVICEEXTINFO        14
00055 #define XODTEMPLATE_SERVICEGROUP          15
00056 
00057 
00058 
00059 /***************** SKIP LISTS ****************/
00060 
00061 #define NUM_XOBJECT_SKIPLISTS                  15
00062 
00063 #define X_HOST_SKIPLIST                        1
00064 #define X_SERVICE_SKIPLIST                     2
00065 #define X_COMMAND_SKIPLIST                     3
00066 #define X_TIMEPERIOD_SKIPLIST                  4
00067 #define X_CONTACT_SKIPLIST                     5
00068 #define X_CONTACTGROUP_SKIPLIST                6
00069 #define X_HOSTGROUP_SKIPLIST                   7
00070 #define X_SERVICEGROUP_SKIPLIST                8
00071 #define X_HOSTDEPENDENCY_SKIPLIST              9
00072 #define X_SERVICEDEPENDENCY_SKIPLIST           10
00073 #define X_HOSTESCALATION_SKIPLIST              11
00074 #define X_SERVICEESCALATION_SKIPLIST           12
00075 #define X_HOSTEXTINFO_SKIPLIST                 13
00076 #define X_SERVICEEXTINFO_SKIPLIST              14
00077 
00078 
00079 /********** STRUCTURE DEFINITIONS **********/
00080 
00081 /* CUSTOMVARIABLESMEMBER structure */
00082 typedef struct xodtemplate_customvariablesmember_struct{
00083         char    *variable_name;
00084         char    *variable_value;
00085         struct xodtemplate_customvariablesmember_struct *next;
00086         }xodtemplate_customvariablesmember;
00087 
00088 
00089 /* DATERANGE structure */
00090 typedef struct xodtemplate_daterange_struct{
00091         int type;
00092         int syear;          /* start year */
00093         int smon;           /* start month */
00094         int smday;          /* start day of month (may 3rd, last day in feb) */
00095         int swday;          /* start day of week (thursday) */
00096         int swday_offset;   /* start weekday offset (3rd thursday, last monday in jan) */
00097         int eyear;
00098         int emon;
00099         int emday;
00100         int ewday;
00101         int ewday_offset;
00102         int skip_interval;
00103         char *timeranges;
00104         struct xodtemplate_daterange_struct *next;
00105         }xodtemplate_daterange;
00106 
00107 
00108 /* TIMEPERIOD TEMPLATE STRUCTURE */
00109 typedef struct xodtemplate_timeperiod_struct{
00110         char       *template;
00111         char       *name;
00112         int        _config_file;
00113         int        _start_line;
00114 
00115         char       *timeperiod_name;
00116         char       *alias;
00117         char       *timeranges[7];
00118         xodtemplate_daterange *exceptions[DATERANGE_TYPES];
00119         char       *exclusions;
00120 
00121         int        has_been_resolved;
00122         int        register_object;
00123         struct xodtemplate_timeperiod_struct *next;
00124         }xodtemplate_timeperiod;
00125 
00126 
00127 /* COMMAND TEMPLATE STRUCTURE */
00128 typedef struct xodtemplate_command_struct{
00129         char       *template;
00130         char       *name;
00131         int        _config_file;
00132         int        _start_line;
00133 
00134         char       *command_name;
00135         char       *command_line;
00136 
00137         int        has_been_resolved;
00138         int        register_object;
00139         struct xodtemplate_command_struct *next;
00140         }xodtemplate_command;
00141 
00142 
00143 /* CONTACT TEMPLATE STRUCTURE */
00144 typedef struct xodtemplate_contact_struct{
00145         char      *template;
00146         char      *name;
00147         int        _config_file;
00148         int        _start_line;
00149 
00150         char      *contact_name;
00151         char      *alias;
00152         char      *contact_groups;
00153         char      *email;
00154         char      *pager;
00155         char      *address[MAX_XODTEMPLATE_CONTACT_ADDRESSES];
00156         char      *host_notification_period;
00157         char      *host_notification_commands;
00158         int       notify_on_host_down;
00159         int       notify_on_host_unreachable;
00160         int       notify_on_host_recovery;
00161         int       notify_on_host_flapping;
00162         int       notify_on_host_downtime;
00163         char      *service_notification_period;
00164         char      *service_notification_commands;
00165         int       notify_on_service_unknown;
00166         int       notify_on_service_warning;
00167         int       notify_on_service_critical;
00168         int       notify_on_service_recovery;
00169         int       notify_on_service_flapping;
00170         int       notify_on_service_downtime;
00171         int       host_notifications_enabled;
00172         int       service_notifications_enabled;
00173         int       can_submit_commands;
00174         int       retain_status_information;
00175         int       retain_nonstatus_information;
00176         xodtemplate_customvariablesmember *custom_variables;
00177 
00178         int       have_contact_groups;
00179         int       have_email;
00180         int       have_pager;
00181         int       have_address[MAX_XODTEMPLATE_CONTACT_ADDRESSES];
00182         int       have_host_notification_period;
00183         int       have_host_notification_commands;
00184         int       have_service_notification_period;
00185         int       have_service_notification_commands;
00186 
00187         int       have_host_notification_options;
00188         int       have_service_notification_options;
00189         int       have_host_notifications_enabled;
00190         int       have_service_notifications_enabled;
00191         int       have_can_submit_commands;
00192         int       have_retain_status_information;
00193         int       have_retain_nonstatus_information;
00194 
00195         int       has_been_resolved;
00196         int       register_object;
00197         struct xodtemplate_contact_struct *next;
00198         }xodtemplate_contact;
00199 
00200 
00201 /* CONTACTGROUP TEMPLATE STRUCTURE */
00202 typedef struct xodtemplate_contactgroup_struct{
00203         char      *template;
00204         char      *name;
00205         int        _config_file;
00206         int        _start_line;
00207 
00208         char      *contactgroup_name;
00209         char      *alias;
00210         char      *members;
00211         char      *contactgroup_members;
00212 
00213         int       have_members;
00214         int       have_contactgroup_members;
00215 
00216         int       has_been_resolved;
00217         int       register_object;
00218         struct xodtemplate_contactgroup_struct *next;
00219         }xodtemplate_contactgroup;
00220 
00221 
00222 /* HOST TEMPLATE STRUCTURE */
00223 typedef struct xodtemplate_host_struct{
00224         char      *template;
00225         char      *name;
00226         int        _config_file;
00227         int        _start_line;
00228 
00229         char      *host_name;
00230         char      *display_name;
00231         char      *alias;
00232         char      *address;
00233         char      *parents;
00234         char      *host_groups;
00235         char      *check_command;
00236         char      *check_period;
00237         int       initial_state;
00238         double    check_interval;
00239         double    retry_interval;
00240         int       max_check_attempts;
00241         int       active_checks_enabled;
00242         int       passive_checks_enabled;
00243         int       obsess_over_host;
00244         char      *event_handler;
00245         int       event_handler_enabled;
00246         int       check_freshness;
00247         int       freshness_threshold;
00248         float     low_flap_threshold;
00249         float     high_flap_threshold;
00250         int       flap_detection_enabled;
00251         int       flap_detection_on_up;
00252         int       flap_detection_on_down;
00253         int       flap_detection_on_unreachable;
00254         char      *contact_groups;
00255         char      *contacts;
00256         int       notify_on_down;
00257         int       notify_on_unreachable;
00258         int       notify_on_recovery;
00259         int       notify_on_flapping;
00260         int       notify_on_downtime;
00261         int       notifications_enabled;
00262         char      *notification_period;
00263         double    notification_interval;
00264         double    first_notification_delay;
00265         int       stalk_on_up;
00266         int       stalk_on_down;
00267         int       stalk_on_unreachable;
00268         int       process_perf_data;
00269         int       failure_prediction_enabled;
00270         char      *failure_prediction_options;
00271         char      *notes;
00272         char      *notes_url;
00273         char      *action_url;
00274         char      *icon_image;
00275         char      *icon_image_alt;
00276         char      *vrml_image;
00277         char      *statusmap_image;
00278         int       x_2d;
00279         int       y_2d;
00280         double    x_3d;
00281         double    y_3d;
00282         double    z_3d;
00283         int       retain_status_information;
00284         int       retain_nonstatus_information;
00285         xodtemplate_customvariablesmember *custom_variables;
00286 
00287         int       have_display_name;
00288         int       have_parents;
00289         int       have_host_groups;
00290         int       have_check_command;
00291         int       have_check_period;
00292         int       have_event_handler;
00293         int       have_contact_groups;
00294         int       have_contacts;
00295         int       have_notification_period;
00296         int       have_failure_prediction_options;
00297         int       have_notes;
00298         int       have_notes_url;
00299         int       have_action_url;
00300         int       have_icon_image;
00301         int       have_icon_image_alt;
00302         int       have_vrml_image;
00303         int       have_statusmap_image;
00304 
00305         int       have_initial_state;
00306         int       have_check_interval;
00307         int       have_retry_interval;
00308         int       have_max_check_attempts;
00309         int       have_active_checks_enabled;
00310         int       have_passive_checks_enabled;
00311         int       have_obsess_over_host;
00312         int       have_event_handler_enabled;
00313         int       have_check_freshness;
00314         int       have_freshness_threshold;
00315         int       have_low_flap_threshold;
00316         int       have_high_flap_threshold;
00317         int       have_flap_detection_enabled;
00318         int       have_flap_detection_options;
00319         int       have_notification_options;
00320         int       have_notifications_enabled;
00321         int       have_notification_interval;
00322         int       have_first_notification_delay;
00323         int       have_stalking_options;
00324         int       have_process_perf_data;
00325         int       have_failure_prediction_enabled;
00326         int       have_2d_coords;
00327         int       have_3d_coords;
00328         int       have_retain_status_information;
00329         int       have_retain_nonstatus_information;
00330 
00331         int       has_been_resolved;
00332         int       register_object;
00333         struct xodtemplate_host_struct *next;
00334         /* 2011-02-07 MF: added for dualstack IPv6 support as
00335            $HOSTADDRESS6$ macro  */
00336         char    *address6;
00337         }xodtemplate_host;
00338 
00339 
00340 /* HOSTGROUP TEMPLATE STRUCTURE */
00341 typedef struct xodtemplate_hostgroup_struct{
00342         char      *template;
00343         char      *name;
00344         int        _config_file;
00345         int        _start_line;
00346 
00347         char      *hostgroup_name;
00348         char      *alias;
00349         char      *members;
00350         char      *hostgroup_members;
00351         char      *notes;
00352         char      *notes_url;
00353         char      *action_url;
00354 
00355         int       have_members;
00356         int       have_hostgroup_members;
00357         int       have_notes;
00358         int       have_notes_url;
00359         int       have_action_url;
00360 
00361         int       has_been_resolved;
00362         int       register_object;
00363         struct xodtemplate_hostgroup_struct *next;
00364         }xodtemplate_hostgroup;
00365 
00366 
00367 /* SERVICE TEMPLATE STRUCTURE */
00368 typedef struct xodtemplate_service_struct{
00369         char       *template;
00370         char       *name;
00371         int        _config_file;
00372         int        _start_line;
00373 
00374         char       *host_name;
00375         char       *service_description;
00376         char       *display_name;
00377         char       *hostgroup_name;
00378         char       *service_groups;
00379         char       *check_command;
00380         int        initial_state;
00381         int        max_check_attempts;
00382         double     check_interval;
00383         double     retry_interval;
00384         char       *check_period;
00385         int        active_checks_enabled;
00386         int        passive_checks_enabled;
00387         int        parallelize_check;
00388         int        is_volatile;
00389         int        obsess_over_service;
00390         char       *event_handler;
00391         int        event_handler_enabled;
00392         int        check_freshness;
00393         int        freshness_threshold;
00394         double     low_flap_threshold;
00395         double     high_flap_threshold;
00396         int        flap_detection_enabled;
00397         int        flap_detection_on_ok;
00398         int        flap_detection_on_warning;
00399         int        flap_detection_on_unknown;
00400         int        flap_detection_on_critical;
00401         int        notify_on_unknown;
00402         int        notify_on_warning;
00403         int        notify_on_critical;
00404         int        notify_on_recovery;
00405         int        notify_on_flapping;
00406         int        notify_on_downtime;
00407         int        notifications_enabled;
00408         char       *notification_period;
00409         double     notification_interval;
00410         double     first_notification_delay;
00411         char       *contact_groups;
00412         char       *contacts;
00413         int        stalk_on_ok;
00414         int        stalk_on_unknown;
00415         int        stalk_on_warning;
00416         int        stalk_on_critical;
00417         int        process_perf_data;
00418         int        failure_prediction_enabled;
00419         char       *failure_prediction_options;
00420         char       *notes;
00421         char       *notes_url;
00422         char       *action_url;
00423         char       *icon_image;
00424         char       *icon_image_alt;
00425         int        retain_status_information;
00426         int        retain_nonstatus_information;
00427         xodtemplate_customvariablesmember *custom_variables;
00428 
00429         int        have_host_name;
00430         int        have_service_description;
00431         int        have_display_name;
00432         int        have_hostgroup_name;
00433         int        have_service_groups;
00434         int        have_check_command;
00435         int        have_important_check_command;
00436         int        have_check_period;
00437         int        have_event_handler;
00438         int        have_notification_period;
00439         int        have_contact_groups;
00440         int        have_contacts;
00441         int        have_failure_prediction_options;
00442         int        have_notes;
00443         int        have_notes_url;
00444         int        have_action_url;
00445         int        have_icon_image;
00446         int        have_icon_image_alt;
00447 
00448         int        have_initial_state;
00449         int        have_max_check_attempts;
00450         int        have_check_interval;
00451         int        have_retry_interval;
00452         int        have_active_checks_enabled;
00453         int        have_passive_checks_enabled;
00454         int        have_parallelize_check;
00455         int        have_is_volatile;
00456         int        have_obsess_over_service;
00457         int        have_event_handler_enabled;
00458         int        have_check_freshness;
00459         int        have_freshness_threshold;
00460         int        have_low_flap_threshold;
00461         int        have_high_flap_threshold;
00462         int        have_flap_detection_enabled;
00463         int        have_flap_detection_options;
00464         int        have_notification_options;
00465         int        have_notifications_enabled;
00466         int        have_notification_dependencies;
00467         int        have_notification_interval;
00468         int        have_first_notification_delay;
00469         int        have_stalking_options;
00470         int        have_process_perf_data;
00471         int        have_failure_prediction_enabled;
00472         int        have_retain_status_information;
00473         int        have_retain_nonstatus_information;
00474         
00475         int        has_been_resolved;
00476         int        register_object;
00477         struct xodtemplate_service_struct *next;
00478         }xodtemplate_service;
00479 
00480 
00481 /* SERVICEGROUP TEMPLATE STRUCTURE */
00482 typedef struct xodtemplate_servicegroup_struct{
00483         char      *template;
00484         char      *name;
00485         int        _config_file;
00486         int        _start_line;
00487 
00488         char      *servicegroup_name;
00489         char      *alias;
00490         char      *members;
00491         char      *servicegroup_members;
00492         char      *notes;
00493         char      *notes_url;
00494         char      *action_url;
00495 
00496         int       have_members;
00497         int       have_servicegroup_members;
00498         int       have_notes;
00499         int       have_notes_url;
00500         int       have_action_url;
00501 
00502         int       has_been_resolved;
00503         int       register_object;
00504         struct xodtemplate_servicegroup_struct *next;
00505         }xodtemplate_servicegroup;
00506 
00507  /* ESCALATION CONDITION STRUCTURE 
00508   * Vitali Voroth, 09.10.2009
00509   * A condition is written this way:
00510   * escalation_condition        host linux01 = c
00511   * More than one condition are connected via & OR | :
00512   * escalation_condition        host linux01 = c | service linux01.SSH = c,w
00513   * where & is an AND connection and | is and OR connection.
00514  */
00515  typedef struct xodtemplate_escalation_condition_struct{
00516         char      *host_name;
00517         char      *service_description;
00518         /*
00519         int       have_host_name;
00520         int       have_service_description;
00521         */
00522         /* Connects this and the next condition either with an AND or with an OR.
00523          * (constants defined in objects.h)
00524          *      0: EC_CONNECTOR_NO
00525          *  1: EC_CONNECTOR_AND
00526          *  2: EC_CONNECTOR_OR
00527         */
00528         int       connector;
00529         
00530         int       escalate_on_down;
00531         int       escalate_on_unreachable;
00532         int       escalate_on_warning;
00533         int       escalate_on_unknown;
00534         int       escalate_on_critical;
00535         int       escalate_on_ok;
00536         
00537         struct xodtemplate_escalation_condition_struct *next;
00538         }xodtemplate_escalation_condition;
00539 
00540 /* SERVICEDEPENDENCY TEMPLATE STRUCTURE */
00541 typedef struct xodtemplate_servicedependency_struct{
00542         char       *template;
00543         char       *name;
00544         int        _config_file;
00545         int        _start_line;
00546 
00547         char       *host_name;
00548         char       *service_description;
00549         char       *dependent_host_name;
00550         char       *dependent_service_description;
00551         char       *servicegroup_name;
00552         char       *hostgroup_name;
00553         char       *dependent_servicegroup_name;
00554         char       *dependent_hostgroup_name;
00555         char       *dependency_period;
00556         int        inherits_parent;
00557         int        fail_notify_on_ok;
00558         int        fail_notify_on_unknown;
00559         int        fail_notify_on_warning;
00560         int        fail_notify_on_critical;
00561         int        fail_notify_on_pending;
00562         int        fail_execute_on_ok;
00563         int        fail_execute_on_unknown;
00564         int        fail_execute_on_warning;
00565         int        fail_execute_on_critical;
00566         int        fail_execute_on_pending;
00567 
00568         int        have_host_name;
00569         int        have_service_description;
00570         int        have_dependent_host_name;
00571         int        have_dependent_service_description;
00572         int        have_servicegroup_name;
00573         int        have_hostgroup_name;
00574         int        have_dependent_servicegroup_name;
00575         int        have_dependent_hostgroup_name;
00576         int        have_dependency_period;
00577 
00578         int        have_inherits_parent;
00579         int        have_notification_dependency_options;
00580         int        have_execution_dependency_options;
00581 
00582         int        has_been_resolved;
00583         int        register_object;
00584 
00585         struct xodtemplate_servicedependency_struct *next;
00586         }xodtemplate_servicedependency;
00587 
00588 
00589 /* SERVICEESCALATION TEMPLATE STRUCTURE */
00590 typedef struct xodtemplate_serviceescalation_struct{
00591         char      *template;
00592         char      *name;
00593         int        _config_file;
00594         int        _start_line;
00595 
00596         char      *host_name;
00597         char      *service_description;
00598         char      *servicegroup_name;
00599         char      *hostgroup_name;
00600         int       first_notification;
00601         int       last_notification;
00602 #ifdef USE_ST_BASED_ESCAL_RANGES
00603         int       first_warning_notification;
00604         int       last_warning_notification;
00605         int       first_critical_notification;
00606         int       last_critical_notification;
00607         int       first_unknown_notification;
00608         int       last_unknown_notification;
00609 #endif
00610         double    notification_interval;
00611         char      *escalation_period;
00612         int       escalate_on_warning;
00613         int       escalate_on_unknown;
00614         int       escalate_on_critical;
00615         int       escalate_on_recovery;
00616         char      *contact_groups;
00617         char      *contacts;
00618 
00619         int       have_host_name;
00620         int       have_service_description;
00621         int       have_servicegroup_name;
00622         int       have_hostgroup_name;
00623         int       have_escalation_period;
00624         int       have_contact_groups;
00625         int       have_contacts;
00626 
00627         int       have_first_notification;
00628         int       have_last_notification;
00629 #ifdef USE_ST_BASED_ESCAL_RANGES
00630         int       have_first_warning_notification;
00631         int       have_last_warning_notification;
00632         int       have_first_critical_notification;
00633         int       have_last_critical_notification;
00634         int       have_first_unknown_notification;
00635         int       have_last_unknown_notification;
00636 #endif
00637         int       have_notification_interval;
00638         int       have_escalation_options;
00639 
00640         int       has_been_resolved;
00641         int       register_object;
00642 
00643         xodtemplate_escalation_condition *condition;
00644         struct xodtemplate_serviceescalation_struct *next;
00645         }xodtemplate_serviceescalation;
00646 
00647 
00648 /* HOSTDEPENDENCY TEMPLATE STRUCTURE */
00649 typedef struct xodtemplate_hostdependency_struct{
00650         char      *template;
00651         char      *name;
00652         int        _config_file;
00653         int        _start_line;
00654 
00655         char      *host_name;
00656         char      *dependent_host_name;
00657         char      *hostgroup_name;
00658         char      *dependent_hostgroup_name;
00659         char      *dependency_period;
00660         int       inherits_parent;
00661         int       fail_notify_on_up;
00662         int       fail_notify_on_down;
00663         int       fail_notify_on_unreachable;
00664         int       fail_notify_on_pending;
00665         int       fail_execute_on_up;
00666         int       fail_execute_on_down;
00667         int       fail_execute_on_unreachable;
00668         int       fail_execute_on_pending;
00669 
00670         int       have_host_name;
00671         int       have_dependent_host_name;
00672         int       have_hostgroup_name;
00673         int       have_dependent_hostgroup_name;
00674         int       have_dependency_period;
00675 
00676         int       have_inherits_parent;
00677         int       have_notification_dependency_options;
00678         int       have_execution_dependency_options;
00679 
00680         int       has_been_resolved;
00681         int       register_object;
00682         struct xodtemplate_hostdependency_struct *next;
00683         }xodtemplate_hostdependency;
00684 
00685 
00686 /* HOSTESCALATION TEMPLATE STRUCTURE */
00687 typedef struct xodtemplate_hostescalation_struct{
00688         char      *template;
00689         char      *name;
00690         int        _config_file;
00691         int        _start_line;
00692 
00693         char      *host_name;
00694         char      *hostgroup_name;
00695         int       first_notification;
00696         int       last_notification;
00697 #ifdef USE_ST_BASED_ESCAL_RANGES
00698         int       first_down_notification;
00699         int       last_down_notification;
00700         int       first_unreachable_notification;
00701         int       last_unreachable_notification;
00702 #endif
00703         double    notification_interval;
00704         char      *escalation_period;
00705         int       escalate_on_down;
00706         int       escalate_on_unreachable;
00707         int       escalate_on_recovery;
00708         char      *contact_groups;
00709         char      *contacts;
00710 
00711         int       have_host_name;
00712         int       have_hostgroup_name;
00713         int       have_escalation_period;
00714         int       have_contact_groups;
00715         int       have_contacts;
00716 
00717         int       have_first_notification;
00718         int       have_last_notification;
00719 #ifdef USE_ST_BASED_ESCAL_RANGES
00720         int       have_first_down_notification;
00721         int       have_last_down_notification;
00722         int       have_first_unreachable_notification;
00723         int       have_last_unreachable_notification;
00724 #endif
00725         int       have_notification_interval;
00726         int       have_escalation_options;
00727 
00728         int       has_been_resolved;
00729         int       register_object;
00730 
00731         xodtemplate_escalation_condition *condition;
00732         struct xodtemplate_hostescalation_struct *next;
00733         }xodtemplate_hostescalation;
00734 
00735 
00736 /* HOSTEXTINFO TEMPLATE STRUCTURE */
00737 typedef struct xodtemplate_hostextinfo_struct{
00738         char       *template;
00739         char       *name;
00740         int        _config_file;
00741         int        _start_line;
00742 
00743         char       *host_name;
00744         char       *hostgroup_name;
00745         char       *notes;
00746         char       *notes_url;
00747         char       *action_url;
00748         char       *icon_image;
00749         char       *icon_image_alt;
00750         char       *vrml_image;
00751         char       *statusmap_image;
00752         int        x_2d;
00753         int        y_2d;
00754         double     x_3d;
00755         double     y_3d;
00756         double     z_3d;
00757 
00758         int        have_host_name;
00759         int        have_hostgroup_name;
00760         int        have_notes;
00761         int        have_notes_url;
00762         int        have_action_url;
00763         int        have_icon_image;
00764         int        have_icon_image_alt;
00765         int        have_vrml_image;
00766         int        have_statusmap_image;
00767         
00768         int        have_2d_coords;
00769         int        have_3d_coords;
00770 
00771         int        has_been_resolved;
00772         int        register_object;
00773         struct xodtemplate_hostextinfo_struct *next;
00774         }xodtemplate_hostextinfo;
00775 
00776 
00777 /* SERVICEEXTINFO TEMPLATE STRUCTURE */
00778 typedef struct xodtemplate_serviceextinfo_struct{
00779         char       *template;
00780         char       *name;
00781         int        _config_file;
00782         int        _start_line;
00783 
00784         char       *host_name;
00785         char       *hostgroup_name;
00786         char       *service_description;
00787         char       *notes;
00788         char       *notes_url;
00789         char       *action_url;
00790         char       *icon_image;
00791         char       *icon_image_alt;
00792 
00793         int        have_host_name;
00794         int        have_hostgroup_name;
00795         int        have_service_description;
00796         int        have_notes;
00797         int        have_notes_url;
00798         int        have_action_url;
00799         int        have_icon_image;
00800         int        have_icon_image_alt;
00801 
00802         int        has_been_resolved;
00803         int        register_object;
00804         struct xodtemplate_serviceextinfo_struct *next;
00805         }xodtemplate_serviceextinfo;
00806 
00807 
00808 /* CONTACT LIST STRUCTURE */
00809 typedef struct xodtemplate_contactlist_struct{
00810         char      *contact_name;
00811         struct xodtemplate_contactlist_struct *next;
00812         }xodtemplate_contactlist;
00813 
00814 
00815 /* HOST LIST STRUCTURE */
00816 typedef struct xodtemplate_hostlist_struct{
00817         char      *host_name;
00818         struct xodtemplate_hostlist_struct *next;
00819         }xodtemplate_hostlist;
00820 
00821 
00822 /* SERVICE LIST STRUCTURE */
00823 typedef struct xodtemplate_servicelist_struct{
00824         char      *host_name;
00825         char      *service_description;
00826         struct xodtemplate_servicelist_struct *next;
00827         }xodtemplate_servicelist;
00828 
00829 
00830 /* MEMBER LIST STRUCTURE */
00831 typedef struct xodtemplate_memberlist_struct{
00832         char      *name1;
00833         char      *name2;
00834         struct xodtemplate_memberlist_struct *next;
00835         }xodtemplate_memberlist;
00836 
00837 
00838 /***** CHAINED HASH DATA STRUCTURES ******/
00839 
00840 typedef struct xodtemplate_service_cursor_struct{
00841         int xodtemplate_service_iterator;
00842         xodtemplate_service *current_xodtemplate_service;
00843         }xodtemplate_service_cursor;
00844 
00845 
00846 
00847 /********* FUNCTION DEFINITIONS **********/
00848 
00849 int xodtemplate_read_config_data(char *,int,int,int);       /* top-level routine processes all config files */
00850 int xodtemplate_grab_config_info(char *);                   /* grabs variables from main config file */
00851 int xodtemplate_process_config_file(char *,int);            /* process data in a specific config file */
00852 int xodtemplate_process_config_dir(char *,int);             /* process all files in a specific config directory */
00853 
00854 #ifdef NSCORE
00855 xodtemplate_memberlist *xodtemplate_expand_contactgroups_and_contacts(char *,char *,int,int);
00856 int xodtemplate_expand_contactgroups(xodtemplate_memberlist **,xodtemplate_memberlist **,char *,int,int);
00857 int xodtemplate_expand_contacts(xodtemplate_memberlist **,xodtemplate_memberlist **,char *,int,int);
00858 int xodtemplate_add_contactgroup_members_to_memberlist(xodtemplate_memberlist **,xodtemplate_contactgroup *,int,int);
00859 
00860 xodtemplate_memberlist *xodtemplate_expand_hostgroups_and_hosts(char *,char *,int,int);
00861 int xodtemplate_expand_hostgroups(xodtemplate_memberlist **,xodtemplate_memberlist **,char *,int,int);
00862 int xodtemplate_expand_hosts(xodtemplate_memberlist **,xodtemplate_memberlist **,char *,int,int);
00863 int xodtemplate_add_hostgroup_members_to_memberlist(xodtemplate_memberlist **,xodtemplate_hostgroup *,int,int);
00864 
00865 xodtemplate_memberlist *xodtemplate_expand_servicegroups_and_services(char *,char *,char *,int,int);
00866 int xodtemplate_expand_servicegroups(xodtemplate_memberlist **,xodtemplate_memberlist **,char *,int,int);
00867 int xodtemplate_expand_services(xodtemplate_memberlist **,xodtemplate_memberlist **,char *,char *,int,int);
00868 int xodtemplate_add_servicegroup_members_to_memberlist(xodtemplate_memberlist **,xodtemplate_servicegroup *,int,int);
00869 
00870 char *xodtemplate_process_contactgroup_names(char *,int,int);
00871 int xodtemplate_get_contactgroup_names(xodtemplate_memberlist **,xodtemplate_memberlist **,char *,int,int);
00872 
00873 char *xodtemplate_process_hostgroup_names(char *,int,int);
00874 int xodtemplate_get_hostgroup_names(xodtemplate_memberlist **,xodtemplate_memberlist **,char *,int,int);
00875 
00876 char *xodtemplate_process_servicegroup_names(char *,int,int);
00877 int xodtemplate_get_servicegroup_names(xodtemplate_memberlist **,xodtemplate_memberlist **,char *,int,int);
00878 
00879 int xodtemplate_add_member_to_memberlist(xodtemplate_memberlist **,char *,char *);
00880 int xodtemplate_free_memberlist(xodtemplate_memberlist **);
00881 void xodtemplate_remove_memberlist_item(xodtemplate_memberlist *,xodtemplate_memberlist **);
00882 #endif
00883 
00884 
00885 int xodtemplate_begin_object_definition(char *,int,int,int);
00886 int xodtemplate_add_object_property(char *,int);
00887 int xodtemplate_end_object_definition(int);
00888 
00889 int xodtemplate_parse_timeperiod_directive(xodtemplate_timeperiod *,char *,char *);
00890 xodtemplate_daterange *xodtemplate_add_exception_to_timeperiod(xodtemplate_timeperiod *,int,int,int,int,int,int,int,int,int,int,int,int,char *);
00891 int xodtemplate_get_month_from_string(char *,int *);
00892 int xodtemplate_get_weekday_from_string(char *,int *);
00893 
00894 xodtemplate_customvariablesmember *xodtemplate_add_custom_variable_to_host(xodtemplate_host *,char *,char *);
00895 xodtemplate_customvariablesmember *xodtemplate_add_custom_variable_to_service(xodtemplate_service *,char *,char *);
00896 xodtemplate_customvariablesmember *xodtemplate_add_custom_variable_to_contact(xodtemplate_contact *,char *,char *);
00897 xodtemplate_customvariablesmember *xodtemplate_add_custom_variable_to_object(xodtemplate_customvariablesmember **,char *,char *);
00898 
00899 
00900 int xodtemplate_register_objects(void);
00901 int xodtemplate_free_memory(void);
00902 
00903 #ifdef NSCORE
00904 int xodtemplate_duplicate_objects(void);
00905 int xodtemplate_duplicate_services(void);
00906 
00907 int xodtemplate_inherit_object_properties(void);
00908 
00909 int xodtemplate_resolve_objects(void);
00910 
00911 int xodtemplate_sort_objects(void);
00912 int xodtemplate_compare_strings1(char *,char *);
00913 int xodtemplate_compare_strings2(char *,char *,char *,char *);
00914 
00915 int xodtemplate_cache_objects(char *);
00916 
00917 int xodtemplate_duplicate_service(xodtemplate_service *,char *);
00918 int xodtemplate_duplicate_hostescalation(xodtemplate_hostescalation *,char *);
00919 int xodtemplate_duplicate_serviceescalation(xodtemplate_serviceescalation *,char *,char *);
00920 int xodtemplate_duplicate_hostdependency(xodtemplate_hostdependency *,char *,char *);
00921 int xodtemplate_duplicate_servicedependency(xodtemplate_servicedependency *,char *,char *,char *, char *,char *,char *,char *,char *);
00922 int xodtemplate_duplicate_hostextinfo(xodtemplate_hostextinfo *,char *);
00923 int xodtemplate_duplicate_serviceextinfo(xodtemplate_serviceextinfo *,char *);
00924 
00925 int xodtemplate_recombobulate_contactgroups(void);
00926 int xodtemplate_recombobulate_contactgroup_subgroups(xodtemplate_contactgroup *,char **);
00927 int xodtemplate_recombobulate_object_contacts(void);
00928 int xodtemplate_recombobulate_hostgroups(void);
00929 int xodtemplate_recombobulate_hostgroup_subgroups(xodtemplate_hostgroup *, char **);
00930 int xodtemplate_recombobulate_servicegroups(void);
00931 int xodtemplate_recombobulate_servicegroup_subgroups(xodtemplate_servicegroup *,char **);
00932 
00933 int xodtemplate_resolve_timeperiod(xodtemplate_timeperiod *);
00934 int xodtemplate_resolve_command(xodtemplate_command *);
00935 int xodtemplate_resolve_contactgroup(xodtemplate_contactgroup *);
00936 int xodtemplate_resolve_hostgroup(xodtemplate_hostgroup *);
00937 int xodtemplate_resolve_servicegroup(xodtemplate_servicegroup *);
00938 int xodtemplate_resolve_servicedependency(xodtemplate_servicedependency *);
00939 int xodtemplate_resolve_serviceescalation(xodtemplate_serviceescalation *);
00940 int xodtemplate_resolve_contact(xodtemplate_contact *);
00941 int xodtemplate_resolve_host(xodtemplate_host *);
00942 int xodtemplate_resolve_service(xodtemplate_service *);
00943 int xodtemplate_resolve_hostdependency(xodtemplate_hostdependency *);
00944 int xodtemplate_resolve_hostescalation(xodtemplate_hostescalation *);
00945 int xodtemplate_resolve_hostextinfo(xodtemplate_hostextinfo *);
00946 int xodtemplate_resolve_serviceextinfo(xodtemplate_serviceextinfo *);
00947 
00948 int xodtemplate_sort_timeperiods(void);
00949 int xodtemplate_sort_commands(void);
00950 int xodtemplate_sort_contactgroups(void);
00951 int xodtemplate_sort_hostgroups(void);
00952 int xodtemplate_sort_servicegroups(void);
00953 int xodtemplate_sort_contacts(void);
00954 int xodtemplate_sort_hosts(void);
00955 int xodtemplate_sort_services(void);
00956 int xodtemplate_sort_servicedependencies(void);
00957 int xodtemplate_sort_serviceescalations(void);
00958 int xodtemplate_sort_hostdependencies(void);
00959 int xodtemplate_sort_hostescalations(void);
00960 
00961 int xodtemplate_merge_extinfo_ojects(void);
00962 int xodtemplate_merge_host_extinfo_object(xodtemplate_host *,xodtemplate_hostextinfo *);
00963 int xodtemplate_merge_service_extinfo_object(xodtemplate_service *,xodtemplate_serviceextinfo *);
00964 
00965 xodtemplate_timeperiod *xodtemplate_find_timeperiod(char *);
00966 xodtemplate_command *xodtemplate_find_command(char *);
00967 xodtemplate_contactgroup *xodtemplate_find_contactgroup(char *);
00968 xodtemplate_contactgroup *xodtemplate_find_real_contactgroup(char *);
00969 xodtemplate_hostgroup *xodtemplate_find_hostgroup(char *);
00970 xodtemplate_hostgroup *xodtemplate_find_real_hostgroup(char *);
00971 xodtemplate_servicegroup *xodtemplate_find_servicegroup(char *);
00972 xodtemplate_servicegroup *xodtemplate_find_real_servicegroup(char *);
00973 xodtemplate_servicedependency *xodtemplate_find_servicedependency(char *);
00974 xodtemplate_serviceescalation *xodtemplate_find_serviceescalation(char *);
00975 xodtemplate_contact *xodtemplate_find_contact(char *);
00976 xodtemplate_contact *xodtemplate_find_real_contact(char *);
00977 xodtemplate_host *xodtemplate_find_host(char *);
00978 xodtemplate_host *xodtemplate_find_real_host(char *);
00979 xodtemplate_service *xodtemplate_find_service(char *);
00980 xodtemplate_service *xodtemplate_find_real_service(char *,char *);
00981 xodtemplate_hostdependency *xodtemplate_find_hostdependency(char *);
00982 xodtemplate_hostescalation *xodtemplate_find_hostescalation(char *);
00983 xodtemplate_hostextinfo *xodtemplate_find_hostextinfo(char *);
00984 xodtemplate_serviceextinfo *xodtemplate_find_serviceextinfo(char *);
00985 
00986 int xodtemplate_get_inherited_string(int *,char **,int *,char **);
00987 int xodtemplate_clean_additive_string(char **);
00988 int xodtemplate_clean_additive_strings(void);
00989 #endif
00990 
00991 int xodtemplate_register_timeperiod(xodtemplate_timeperiod *);
00992 int xodtemplate_get_time_ranges(char *,unsigned long *,unsigned long *);
00993 int xodtemplate_register_command(xodtemplate_command *);
00994 int xodtemplate_register_contactgroup(xodtemplate_contactgroup *);
00995 int xodtemplate_register_hostgroup(xodtemplate_hostgroup *);
00996 int xodtemplate_register_servicegroup(xodtemplate_servicegroup *);
00997 int xodtemplate_register_servicedependency(xodtemplate_servicedependency *);
00998 int xodtemplate_register_serviceescalation(xodtemplate_serviceescalation *);
00999 int xodtemplate_register_contact(xodtemplate_contact *);
01000 int xodtemplate_register_host(xodtemplate_host *);
01001 int xodtemplate_register_service(xodtemplate_service *);
01002 int xodtemplate_register_hostdependency(xodtemplate_hostdependency *);
01003 int xodtemplate_register_hostescalation(xodtemplate_hostescalation *);
01004 
01005 
01006 int xodtemplate_init_xobject_skiplists(void);
01007 int xodtemplate_free_xobject_skiplists(void);
01008 
01009 int xodtemplate_skiplist_compare_text(const char *val1a, const char *val1b, const char *val2a, const char *val2b);
01010 int xodtemplate_skiplist_compare_host_template(void *a, void *b);
01011 int xodtemplate_skiplist_compare_service_template(void *a, void *b);
01012 int xodtemplate_skiplist_compare_command_template(void *a, void *b);
01013 int xodtemplate_skiplist_compare_timeperiod_template(void *a, void *b);
01014 int xodtemplate_skiplist_compare_contact_template(void *a, void *b);
01015 int xodtemplate_skiplist_compare_contactgroup_template(void *a, void *b);
01016 int xodtemplate_skiplist_compare_hostgroup_template(void *a, void *b);
01017 int xodtemplate_skiplist_compare_servicegroup_template(void *a, void *b);
01018 int xodtemplate_skiplist_compare_hostdependency_template(void *a, void *b);
01019 int xodtemplate_skiplist_compare_servicedependency_template(void *a, void *b);
01020 int xodtemplate_skiplist_compare_hostescalation_template(void *a, void *b);
01021 int xodtemplate_skiplist_compare_serviceescalation_template(void *a, void *b);
01022 int xodtemplate_skiplist_compare_hostextinfo_template(void *a, void *b);
01023 int xodtemplate_skiplist_compare_serviceextinfo_template(void *a, void *b);
01024 
01025 int xodtemplate_skiplist_compare_host(void *a, void *b);
01026 int xodtemplate_skiplist_compare_service(void *a, void *b);
01027 int xodtemplate_skiplist_compare_contact(void *a, void *b);
01028 int xodtemplate_skiplist_compare_contactgroup(void *a, void *b);
01029 int xodtemplate_skiplist_compare_hostgroup(void *a, void *b);
01030 int xodtemplate_skiplist_compare_servicegroup(void *a, void *b);
01031 int xodtemplate_skiplist_compare_command(void *a, void *b);
01032 int xodtemplate_skiplist_compare_timeperiod(void *a, void *b);
01033 int xodtemplate_skiplist_compare_hostdependency(void *a, void *b);
01034 int xodtemplate_skiplist_compare_servicedependency(void *a, void *b);
01035 int xodtemplate_skiplist_compare_hostescalation(void *a, void *b);
01036 int xodtemplate_skiplist_compare_serviceescalation(void *a, void *b);
01037 
01038 
01039 #endif
01040 
01041 

Generated on Wed Mar 30 17:22:22 2011 for icinga-core by  doxygen 1.4.7