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