objects.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  * OBJECTS.H - Header file for object addition/search functions
00004  *
00005  * Copyright (c) 1999-2006 Ethan Galstad (nagios@nagios.org)
00006  * Last Modified: 03-21-2006
00007  *
00008  * License:
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License version 2 as
00012  * published by the Free Software Foundation.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00022  *
00023  *****************************************************************************/
00024 
00025 
00026 #ifndef _OBJECTS_H
00027 #define _OBJECTS_H
00028 
00029 #include "config.h"
00030 #include "common.h"
00031 
00032 #ifdef __cplusplus
00033   extern "C" {
00034 #endif
00035 
00036 
00037 
00038 /*************** CURRENT OBJECT REVISION **************/
00039 
00040 #define CURRENT_OBJECT_STRUCTURE_VERSION        2
00041 
00042 
00043 
00044 /***************** OBJECT SIZE LIMITS *****************/
00045 
00046 #define MAX_HOSTNAME_LENGTH                  64 /* max. host name length */
00047 #define MAX_SERVICEDESC_LENGTH         64 /* max. service description length */
00048 #define MAX_PLUGINOUTPUT_LENGTH        332   /* max. length of plugin output */
00049 
00050 #define MAX_STATE_HISTORY_ENTRIES      21 /* max number of old states to keep track of for flap detection */
00051 
00052 #define MAX_CONTACT_ADDRESSES                   6       /* max number of custom addresses a contact can have */
00053 
00054 
00055 
00056 /***************** CHAINED HASH LIMITS ****************/
00057 
00058 #define SERVICE_HASHSLOTS                      1024
00059 #define HOST_HASHSLOTS                         1024
00060 #define COMMAND_HASHSLOTS                      256
00061 #define TIMEPERIOD_HASHSLOTS                   64
00062 #define CONTACT_HASHSLOTS                      128
00063 #define CONTACTGROUP_HASHSLOTS                 64
00064 #define HOSTGROUP_HASHSLOTS                    128
00065 #define SERVICEGROUP_HASHSLOTS                 128
00066 #define HOSTEXTINFO_HASHSLOTS                  1024
00067 #define SERVICEEXTINFO_HASHSLOTS               1024
00068 
00069 #define HOSTDEPENDENCY_HASHSLOTS               1024
00070 #define SERVICEDEPENDENCY_HASHSLOTS            1024
00071 #define HOSTESCALATION_HASHSLOTS               1024
00072 #define SERVICEESCALATION_HASHSLOTS            1024
00073 
00074 
00075 
00076 /****************** DATA STRUCTURES *******************/
00077 
00078 /* TIMERANGE structure */
00079 typedef struct timerange_struct{
00080    unsigned long range_start;
00081    unsigned long range_end;
00082    struct timerange_struct *next;
00083         }timerange;
00084 
00085 
00086 /* TIMEPERIOD structure */
00087 typedef struct timeperiod_struct{
00088    char    *name;
00089    char    *alias;
00090    timerange *days[7];
00091    struct   timeperiod_struct *next;
00092    struct   timeperiod_struct *nexthash;
00093    }timeperiod;
00094 
00095 
00096 /* CONTACTGROUPMEMBER structure */
00097 typedef struct contactgroupmember_struct{
00098    char    *contact_name;
00099    struct  contactgroupmember_struct *next;
00100         }contactgroupmember;
00101 
00102 
00103 /* CONTACTGROUP structure */
00104 typedef struct contactgroup_struct{
00105    char  *group_name;
00106    char    *alias;
00107    contactgroupmember *members;
00108    struct   contactgroup_struct *next;
00109    struct   contactgroup_struct *nexthash;
00110    }contactgroup;
00111 
00112 
00113 /* CONTACTGROUPSMEMBER structure */
00114 typedef struct contactgroupsmember_struct{
00115    char *group_name;
00116    struct contactgroupsmember_struct *next;
00117         }contactgroupsmember;
00118 
00119 
00120 /* HOSTSMEMBER structure */
00121 typedef struct hostsmember_struct{
00122    char *host_name;
00123    struct hostsmember_struct *next;
00124         }hostsmember;
00125 
00126 
00127 /* HOST structure */
00128 typedef struct host_struct{
00129    char    *name;
00130    char  *alias;
00131    char    *address;
00132         hostsmember *parent_hosts;
00133    char    *host_check_command;
00134    int     check_interval;
00135    int     max_attempts;
00136    char    *event_handler;
00137    contactgroupsmember *contact_groups;
00138    int     notification_interval;
00139    int   notify_on_down;
00140    int   notify_on_unreachable;
00141    int     notify_on_recovery;
00142    int     notify_on_flapping;
00143    char  *notification_period;
00144    char    *check_period;
00145    int     flap_detection_enabled;
00146    double  low_flap_threshold;
00147    double  high_flap_threshold;
00148    int     stalk_on_up;
00149    int     stalk_on_down;
00150    int     stalk_on_unreachable;
00151    int     check_freshness;
00152    int     freshness_threshold;
00153    int     process_performance_data;
00154    int     checks_enabled;
00155    int     accept_passive_host_checks;
00156    int     event_handler_enabled;
00157    int     retain_status_information;
00158    int     retain_nonstatus_information;
00159    int     failure_prediction_enabled;
00160    char    *failure_prediction_options;
00161    int     obsess_over_host;
00162 #ifdef NSCORE
00163    int     problem_has_been_acknowledged;
00164    int     acknowledgement_type;
00165    int     check_type;
00166    int     current_state;
00167    int     last_state;
00168    int     last_hard_state;
00169    char  *plugin_output;
00170    char    *perf_data;
00171         int     state_type;
00172    int     current_attempt;
00173    double  latency;
00174    double  execution_time;
00175    int     check_options;
00176    int     notifications_enabled;
00177    time_t  last_host_notification;
00178    time_t  next_host_notification;
00179    time_t  next_check;
00180    int     should_be_scheduled;
00181    time_t  last_check;
00182    time_t   last_state_change;
00183    time_t   last_hard_state_change;
00184    time_t  last_time_up;
00185    time_t  last_time_down;
00186    time_t  last_time_unreachable;
00187    int     has_been_checked;
00188    int     is_being_freshened;
00189    int     notified_on_down;
00190    int     notified_on_unreachable;
00191    int     current_notification_number;
00192    int     no_more_notifications;
00193    int     check_flapping_recovery_notification;
00194    int     scheduled_downtime_depth;
00195    int     pending_flex_downtime;
00196    int     state_history[MAX_STATE_HISTORY_ENTRIES];    /* flap detection */
00197    int     state_history_index;
00198    time_t  last_state_history_update;
00199    int     is_flapping;
00200    unsigned long flapping_comment_id;
00201    double  percent_state_change;
00202    int     total_services;
00203    unsigned long total_service_check_interval;
00204    unsigned long modified_attributes;
00205    int     circular_path_checked;
00206    int     contains_circular_path;
00207 #endif
00208    struct  host_struct *next;
00209    struct  host_struct *nexthash;
00210         }host;
00211 
00212 
00213 /* HOSTGROUPMEMBER structure */
00214 typedef struct hostgroupmember_struct{
00215    char    *host_name;
00216    struct  hostgroupmember_struct *next;
00217         }hostgroupmember;
00218 
00219 
00220 /* HOSTGROUP structure */
00221 typedef struct hostgroup_struct{
00222    char  *group_name;
00223    char    *alias;
00224    hostgroupmember *members;
00225    struct   hostgroup_struct *next;
00226    struct   hostgroup_struct *nexthash;
00227    }hostgroup;
00228 
00229 
00230 /* SERVICEGROUPMEMBER structure */
00231 typedef struct servicegroupmember_struct{
00232    char    *host_name;
00233    char    *service_description;
00234    struct  servicegroupmember_struct *next;
00235         }servicegroupmember;
00236 
00237 
00238 /* SERVICEGROUP structure */
00239 typedef struct servicegroup_struct{
00240    char  *group_name;
00241    char    *alias;
00242    double  sla_target;
00243    servicegroupmember *members;
00244    struct   servicegroup_struct *next;
00245    struct   servicegroup_struct *nexthash;
00246    }servicegroup;
00247 
00248 
00249 /* COMMANDSMEMBER structure */
00250 typedef struct commandsmember_struct{
00251    char  *command;
00252    struct   commandsmember_struct *next;
00253    }commandsmember;
00254 
00255 
00256 /* CONTACT structure */
00257 typedef struct contact_struct{
00258    char  *name;
00259    char  *alias;
00260    char  *email;
00261    char  *pager;
00262    char    *address[MAX_CONTACT_ADDRESSES];
00263    commandsmember *host_notification_commands;
00264    commandsmember *service_notification_commands;  
00265    int     notify_on_service_unknown;
00266    int     notify_on_service_warning;
00267    int     notify_on_service_critical;
00268    int     notify_on_service_recovery;
00269    int     notify_on_service_flapping;
00270    int   notify_on_host_down;
00271    int   notify_on_host_unreachable;
00272    int   notify_on_host_recovery;
00273    int     notify_on_host_flapping;
00274    char  *host_notification_period;
00275    char  *service_notification_period;
00276    struct   contact_struct *next;
00277    struct   contact_struct *nexthash;
00278    }contact;
00279 
00280 
00281 
00282 /* SERVICE structure */
00283 typedef struct service_struct{
00284    char  *host_name;
00285    char  *description;
00286         char    *service_check_command;
00287    char    *event_handler;
00288    int   check_interval;
00289    int     retry_interval;
00290    int   max_attempts;
00291    int     parallelize;
00292    contactgroupsmember *contact_groups;
00293    int   notification_interval;
00294    int     notify_on_unknown;
00295    int   notify_on_warning;
00296    int   notify_on_critical;
00297    int   notify_on_recovery;
00298    int     notify_on_flapping;
00299    int     stalk_on_ok;
00300    int     stalk_on_warning;
00301    int     stalk_on_unknown;
00302    int     stalk_on_critical;
00303    int     is_volatile;
00304    char  *notification_period;
00305    char  *check_period;
00306    int     flap_detection_enabled;
00307    double  low_flap_threshold;
00308    double  high_flap_threshold;
00309    int     process_performance_data;
00310    int     check_freshness;
00311    int     freshness_threshold;
00312    int     accept_passive_service_checks;
00313    int     event_handler_enabled;
00314    int   checks_enabled;
00315    int     retain_status_information;
00316    int     retain_nonstatus_information;
00317    int     notifications_enabled;
00318    int     obsess_over_service;
00319    int     failure_prediction_enabled;
00320    char    *failure_prediction_options;
00321 #ifdef NSCORE
00322    int     problem_has_been_acknowledged;
00323    int     acknowledgement_type;
00324    int     host_problem_at_last_check;
00325 #ifdef REMOVED_041403
00326    int     no_recovery_notification;
00327 #endif
00328    int     check_type;
00329    int   current_state;
00330    int   last_state;
00331    int   last_hard_state;
00332    char  *plugin_output;
00333    char    *perf_data;
00334         int     state_type;
00335    time_t   next_check;
00336    int     should_be_scheduled;
00337    time_t   last_check;
00338    int   current_attempt;
00339    time_t   last_notification;
00340    time_t  next_notification;
00341    int     no_more_notifications;
00342    int     check_flapping_recovery_notification;
00343    time_t   last_state_change;
00344    time_t   last_hard_state_change;
00345    time_t  last_time_ok;
00346    time_t  last_time_warning;
00347    time_t  last_time_unknown;
00348    time_t  last_time_critical;
00349    int     has_been_checked;
00350    int     is_being_freshened;
00351    int     notified_on_unknown;
00352    int     notified_on_warning;
00353    int     notified_on_critical;
00354    int     current_notification_number;
00355    double  latency;
00356    double  execution_time;
00357    int     is_executing;
00358    int     check_options;
00359    int     scheduled_downtime_depth;
00360    int     pending_flex_downtime;
00361    int     state_history[MAX_STATE_HISTORY_ENTRIES];    /* flap detection */
00362    int     state_history_index;
00363    int     is_flapping;
00364    unsigned long flapping_comment_id;
00365    double  percent_state_change;
00366    unsigned long modified_attributes;
00367 #endif
00368    struct service_struct *next;
00369    struct service_struct *nexthash;
00370    }service;
00371 
00372 
00373 /* COMMAND structure */
00374 typedef struct command_struct{
00375    char    *name;
00376    char    *command_line;
00377    struct command_struct *next;
00378    struct command_struct *nexthash;
00379         }command;
00380 
00381 
00382 /* SERVICE ESCALATION structure */
00383 typedef struct serviceescalation_struct{
00384    char    *host_name;
00385    char    *description;
00386    int     first_notification;
00387    int     last_notification;
00388    int     notification_interval;
00389    char    *escalation_period;
00390    int     escalate_on_recovery;
00391    int     escalate_on_warning;
00392    int     escalate_on_unknown;
00393    int     escalate_on_critical;
00394    contactgroupsmember *contact_groups;
00395    struct  serviceescalation_struct *next;
00396    struct  serviceescalation_struct *nexthash;
00397         }serviceescalation;
00398 
00399 
00400 /* SERVICE DEPENDENCY structure */
00401 typedef struct servicedependency_struct{
00402    int     dependency_type;
00403    char    *dependent_host_name;
00404    char    *dependent_service_description;
00405    char    *host_name;
00406    char    *service_description;
00407    int     inherits_parent;
00408    int     fail_on_ok;
00409    int     fail_on_warning;
00410    int     fail_on_unknown;
00411    int     fail_on_critical;
00412    int     fail_on_pending;
00413 #ifdef NSCORE
00414    int     circular_path_checked;
00415    int     contains_circular_path;
00416 #endif
00417    struct servicedependency_struct *next;
00418    struct servicedependency_struct *nexthash;
00419         }servicedependency;
00420 
00421 
00422 /* HOST ESCALATION structure */
00423 typedef struct hostescalation_struct{
00424    char    *host_name;
00425    int     first_notification;
00426    int     last_notification;
00427    int     notification_interval;
00428    char    *escalation_period;
00429    int     escalate_on_recovery;
00430    int     escalate_on_down;
00431    int     escalate_on_unreachable;
00432    contactgroupsmember *contact_groups;
00433    struct  hostescalation_struct *next;
00434    struct  hostescalation_struct *nexthash;
00435         }hostescalation;
00436 
00437 
00438 /* HOST DEPENDENCY structure */
00439 typedef struct hostdependency_struct{
00440    int     dependency_type;
00441    char    *dependent_host_name;
00442    char    *host_name;
00443    int     inherits_parent;
00444    int     fail_on_up;
00445    int     fail_on_down;
00446    int     fail_on_unreachable;
00447    int     fail_on_pending;
00448 #ifdef NSCORE
00449    int     circular_path_checked;
00450    int     contains_circular_path;
00451 #endif
00452    struct hostdependency_struct *next;
00453    struct hostdependency_struct *nexthash;
00454         }hostdependency;
00455 
00456 
00457 /* EXTENDED HOST INFO structure */
00458 typedef struct hostextinfo_struct{
00459    char *host_name;
00460    char *notes;
00461    char *notes_url;
00462    char *action_url;
00463    char *icon_image;
00464    char *vrml_image;
00465    char *statusmap_image;
00466    char *icon_image_alt;
00467    int have_2d_coords;
00468    int x_2d;
00469    int y_2d;
00470    int have_3d_coords;
00471    double x_3d;
00472    double y_3d;
00473    double z_3d;
00474    int should_be_drawn;
00475    struct hostextinfo_struct *next;
00476    struct hostextinfo_struct *nexthash;
00477         }hostextinfo;
00478 
00479 
00480 /* EXTENDED SERVICE INFO structure */
00481 typedef struct serviceextinfo_struct{
00482    char *host_name;
00483    char *description;
00484    char *notes;
00485    char *notes_url;
00486    char *action_url;
00487    char *icon_image;
00488    char *icon_image_alt;
00489    struct serviceextinfo_struct *next;
00490    struct serviceextinfo_struct *nexthash;
00491         }serviceextinfo;
00492 
00493 
00494 
00495 /****************** HASH STRUCTURES ********************/
00496 
00497 typedef struct host_cursor_struct{
00498    int     host_hashchain_iterator;
00499    host    *current_host_pointer;
00500         }host_cursor;
00501 
00502 
00503 
00504 
00505 
00506 /********************* FUNCTIONS **********************/
00507 
00508 /**** DEBUG functions ****/
00509 /* RMO: 9/25/01
00510    Send debug output to stdout. Does nothing if 'level' is
00511    not enabled by a corresponding 'DEBUGn' define.
00512    Accepts format string (fmt) and variable-length arg list
00513    (as printf does). Prints to stdout and, if NSCGI environment,
00514    surrounded with HTML comment delimiters to be viewed through
00515    browser's 'view source' option.
00516 
00517    Use as: dbg_print((level,fmt,...)); [NOTE double parens]
00518  
00519    The macro def below causes dbg_print(()) calls to vaporize
00520    if none of the DEBUGn levels are defined.
00521 */
00522 #if defined(DEBUG0) || defined(DEBUG1) || defined(DEBUG2) || defined(DEBUG3) || defined(DEBUG4) || defined(DEBUG5) || defined(DEBUG6) || defined(DEBUG7) || defined(DEBUG8) || defined(DEBUG9) || defined(DEBUG10) || defined(DEBUG11)
00523 #define dbg_print(args) dbg_print_x args
00524 #else
00525 #define dbg_print(args)
00526 #endif
00527 
00528 
00529 /**** Top-level input functions ****/
00530 int read_object_config_data(char *,int,int);        /* reads all external configuration data of specific types */
00531 
00532 /**** Object Creation Functions ****/
00533 contact *add_contact(char *,char *,char *,char *,char **,char *,char *,int,int,int,int,int,int,int,int,int);   /* adds a contact definition */
00534 commandsmember *add_service_notification_command_to_contact(contact *,char *);            /* adds a service notification command to a contact definition */
00535 commandsmember *add_host_notification_command_to_contact(contact *,char *);            /* adds a host notification command to a contact definition */
00536 host *add_host(char *,char *,char *,char *,int,int,int,int,int,int,int,char *,int,char *,int,int,char *,int,int,double,double,int,int,int,int,int,char *,int,int,int,int,int);   /* adds a host definition */
00537 hostsmember *add_parent_host_to_host(host *,char *);                    /* adds a parent host to a host definition */
00538 contactgroupsmember *add_contactgroup_to_host(host *,char *);                      /* adds a contactgroup to a host definition */
00539 timeperiod *add_timeperiod(char *,char *);                        /* adds a timeperiod definition */
00540 timerange *add_timerange_to_timeperiod(timeperiod *,int,unsigned long,unsigned long);        /* adds a timerange to a timeperiod definition */
00541 hostgroup *add_hostgroup(char *,char *);                       /* adds a hostgroup definition */
00542 hostgroupmember *add_host_to_hostgroup(hostgroup *, char *);                  /* adds a host to a hostgroup definition */
00543 servicegroup *add_servicegroup(char *,char *,double);                                                   /* adds a servicegroup definition */
00544 servicegroupmember *add_service_to_servicegroup(servicegroup *,char *,char *);                          /* adds a service to a servicegroup definition */
00545 contactgroup *add_contactgroup(char *,char *);                       /* adds a contactgroup definition */
00546 contactgroupmember *add_contact_to_contactgroup(contactgroup *,char *);             /* adds a contact to a contact group definition */
00547 command *add_command(char *,char *);                           /* adds a command definition */
00548 service *add_service(char *,char *,char *,int,int,int,int,int,int,char *,int,int,int,int,int,int,int,char *,int,char *,int,int,double,double,int,int,int,int,int,int,char *,int,int,int,int,int);  /* adds a service definition */
00549 contactgroupsmember *add_contactgroup_to_service(service *,char *);              /* adds a contact group to a service definition */
00550 serviceescalation *add_serviceescalation(char *,char *,int,int,int,char *,int,int,int,int);             /* adds a service escalation definition */
00551 contactgroupsmember *add_contactgroup_to_serviceescalation(serviceescalation *,char *);                 /* adds a contact group to a service escalation definition */
00552 servicedependency *add_service_dependency(char *,char *,char *,char *,int,int,int,int,int,int,int);     /* adds a service dependency definition */
00553 hostdependency *add_host_dependency(char *,char *,int,int,int,int,int,int);                             /* adds a host dependency definition */
00554 hostescalation *add_hostescalation(char *,int,int,int,char *,int,int,int);                              /* adds a host escalation definition */
00555 contactgroupsmember *add_contactgroup_to_hostescalation(hostescalation *,char *);                       /* adds a contact group to a host escalation definition */
00556 hostextinfo *add_hostextinfo(char *,char *,char *,char *,char *,char *,char *,char *,int,int,double,double,double,int,int); /* adds an extended host info definition */
00557 serviceextinfo *add_serviceextinfo(char *,char *,char *,char *,char *,char *,char *);                          /* add an extended service info definition */
00558 
00559 
00560 /**** Object Hash Functions ****/
00561 int add_host_to_hashlist(host *);
00562 int add_service_to_hashlist(service *);
00563 int add_command_to_hashlist(command *);
00564 int add_timeperiod_to_hashlist(timeperiod *);
00565 int add_contact_to_hashlist(contact *);
00566 int add_contactgroup_to_hashlist(contactgroup *);
00567 int add_hostgroup_to_hashlist(hostgroup *);
00568 int add_servicegroup_to_hashlist(servicegroup *);
00569 int add_hostdependency_to_hashlist(hostdependency *);
00570 int add_servicedependency_to_hashlist(servicedependency *);
00571 int add_hostescalation_to_hashlist(hostescalation *);
00572 int add_serviceescalation_to_hashlist(serviceescalation *);
00573 int add_hostextinfo_to_hashlist(hostextinfo *);
00574 int add_serviceextinfo_to_hashlist(serviceextinfo *);
00575 
00576 
00577 /**** Object Search Functions ****/
00578 timeperiod * find_timeperiod(char *);                                 /* finds a timeperiod object */
00579 host * find_host(char *);                          /* finds a host object */
00580 hostgroup * find_hostgroup(char *);                                /* finds a hostgroup object */
00581 servicegroup * find_servicegroup(char *);                             /* finds a servicegroup object */
00582 contact * find_contact(char *);                                    /* finds a contact object */
00583 contactgroup * find_contactgroup(char *);                             /* finds a contactgroup object */
00584 contactgroupmember *find_contactgroupmember(char *,contactgroup *);                          /* finds a contactgroup member object */
00585 command * find_command(char *);                                    /* finds a command object */
00586 service * find_service(char *,char *);                      /* finds a service object */
00587 service * enum_services(char *,service *);                                                      /* enumerates all service objects for a host */
00588 hostextinfo *find_hostextinfo(char *);                                          /* find an extended host info object */
00589 serviceextinfo *find_serviceextinfo(char *,char *);                                             /* find an extended service info object */
00590 
00591 
00592 /**** Object Traversal Functions ****/
00593 void move_first_service(void);                           /* sets up the static memory area for get_next_service */
00594 service *get_next_service(void);                      /* returns the next service, NULL at the end of the list */
00595 int find_all_services_by_host(char *);                           /* sets up the static memory area for get_next_service_by_host */
00596 service *get_next_service_by_host(void);                    /* returns the next service for the host, NULL at the end of the list */
00597 void move_first_host(void);                           /* sets up the static memory area for get_next_host */
00598 host *get_next_host(void);                         /* returns the next host, NULL at the end of the list */
00599 void *get_host_cursor(void);                                              /* allocate memory for the host cursor */
00600 host *get_next_host_cursor(void *v_cursor);                    /* return the next host, NULL at the end of the list */
00601 void free_host_cursor(void *cursor);                        /* free allocated cursor memory */
00602 void *get_next_N(void **hashchain, int hashslots, int *iterator, void *current, void *next);
00603 
00604 hostescalation *get_first_hostescalation_by_host(char *);
00605 hostescalation *get_next_hostescalation_by_host(char *,hostescalation *);
00606 serviceescalation *get_first_serviceescalation_by_service(char *,char *);
00607 serviceescalation *get_next_serviceescalation_by_service(char *,char *,serviceescalation *);
00608 hostdependency *get_first_hostdependency_by_dependent_host(char *);
00609 hostdependency *get_next_hostdependency_by_dependent_host(char *,hostdependency *);
00610 servicedependency *get_first_servicedependency_by_dependent_service(char *,char *);
00611 servicedependency *get_next_servicedependency_by_dependent_service(char *,char *,servicedependency *);
00612 
00613 
00614 
00615 /**** Object Query Functions ****/
00616 int is_host_immediate_child_of_host(host *,host *);                   /* checks if a host is an immediate child of another host */  
00617 int is_host_primary_immediate_child_of_host(host *,host *);             /* checks if a host is an immediate child (and primary child) of another host */
00618 int is_host_immediate_parent_of_host(host *,host *);                  /* checks if a host is an immediate child of another host */  
00619 int is_host_member_of_hostgroup(hostgroup *,host *);             /* tests whether or not a host is a member of a specific hostgroup */
00620 int is_host_member_of_servicegroup(servicegroup *,host *);          /* tests whether or not a service is a member of a specific servicegroup */
00621 int is_service_member_of_servicegroup(servicegroup *,service *);  /* tests whether or not a service is a member of a specific servicegroup */
00622 int is_contact_member_of_contactgroup(contactgroup *, contact *); /* tests whether or not a contact is a member of a specific contact group */
00623 int is_contact_for_hostgroup(hostgroup *,contact *);                  /* tests whether or not a contact is a member of a specific hostgroup */
00624 int is_contact_for_servicegroup(servicegroup *,contact *);          /* tests whether or not a contact is a member of a specific servicegroup */
00625 int is_contact_for_host(host *,contact *);                 /* tests whether or not a contact is a contact member for a specific host */
00626 int is_escalated_contact_for_host(host *,contact *);                    /* checks whether or not a contact is an escalated contact for a specific host */
00627 int is_contact_for_service(service *,contact *);              /* tests whether or not a contact is a contact member for a specific service */
00628 int is_escalated_contact_for_service(service *,contact *);              /* checks whether or not a contact is an escalated contact for a specific service */
00629 int is_host_immediate_parent_of_host(host *,host *);             /* tests whether or not a host is an immediate parent of another host */
00630 
00631 int number_of_immediate_child_hosts(host *);                    /* counts the number of immediate child hosts for a particular host */
00632 int number_of_total_child_hosts(host *);           /* counts the number of total child hosts for a particular host */
00633 int number_of_immediate_parent_hosts(host *);            /* counts the number of immediate parents hosts for a particular host */
00634 int number_of_total_parent_hosts(host *);          /* counts the number of total parents hosts for a particular host */
00635 
00636 #ifdef NSCORE
00637 int check_for_circular_path(host *,host *);                             /* checks if a circular path exists for a given host */
00638 int check_for_circular_servicedependency(servicedependency *,servicedependency *,int);   /* checks if a circular dependency exists for a given service */
00639 int check_for_circular_hostdependency(hostdependency *,hostdependency *,int);   /* checks if a circular dependency exists for a given host */
00640 #endif
00641 
00642 
00643 /**** Object Cleanup Functions ****/
00644 int free_object_data(void);                             /* frees all allocated memory for the object definitions */
00645 int free_extended_data(void);                           /* frees memory allocated to the extended host/service information */
00646 
00647 #ifdef __cplusplus
00648   }
00649 #endif
00650 
00651 #endif

Generated on Tue Apr 13 15:15:28 2010 for DNX by  doxygen 1.5.6