common/objects.c File Reference

#include "../include/config.h"
#include "../include/common.h"
#include "../include/objects.h"
#include "../include/skiplist.h"
#include "../xdata/xodtemplate.h"

Functions

int read_object_config_data (char *main_config_file, int options, int cache, int precache)
int init_object_skiplists (void)
int free_object_skiplists (void)
int skiplist_compare_text (const char *val1a, const char *val1b, const char *val2a, const char *val2b)
int skiplist_compare_host (void *a, void *b)
int skiplist_compare_service (void *a, void *b)
int skiplist_compare_command (void *a, void *b)
int skiplist_compare_timeperiod (void *a, void *b)
int skiplist_compare_contact (void *a, void *b)
int skiplist_compare_contactgroup (void *a, void *b)
int skiplist_compare_hostgroup (void *a, void *b)
int skiplist_compare_servicegroup (void *a, void *b)
int skiplist_compare_hostescalation (void *a, void *b)
int skiplist_compare_serviceescalation (void *a, void *b)
int skiplist_compare_hostdependency (void *a, void *b)
int skiplist_compare_servicedependency (void *a, void *b)
int get_host_count (void)
int get_service_count (void)
timeperiodadd_timeperiod (char *name, char *alias)
timeperiodexclusionadd_exclusion_to_timeperiod (timeperiod *period, char *name)
timerangeadd_timerange_to_timeperiod (timeperiod *period, int day, unsigned long start_time, unsigned long end_time)
daterangeadd_exception_to_timeperiod (timeperiod *period, int type, int syear, int smon, int smday, int swday, int swday_offset, int eyear, int emon, int emday, int ewday, int ewday_offset, int skip_interval)
timerangeadd_timerange_to_daterange (daterange *drange, unsigned long start_time, unsigned long end_time)
hostadd_host (char *name, char *display_name, char *alias, char *address, char *address6, char *check_period, int initial_state, double check_interval, double retry_interval, int max_attempts, int notify_up, int notify_down, int notify_unreachable, int notify_flapping, int notify_downtime, double notification_interval, double first_notification_delay, char *notification_period, int notifications_enabled, char *check_command, int checks_enabled, int accept_passive_checks, char *event_handler, int event_handler_enabled, int flap_detection_enabled, double low_flap_threshold, double high_flap_threshold, int flap_detection_on_up, int flap_detection_on_down, int flap_detection_on_unreachable, int stalk_on_up, int stalk_on_down, int stalk_on_unreachable, int process_perfdata, int failure_prediction_enabled, char *failure_prediction_options, int check_freshness, int freshness_threshold, char *notes, char *notes_url, char *action_url, char *icon_image, char *icon_image_alt, char *vrml_image, char *statusmap_image, int x_2d, int y_2d, int have_2d_coords, double x_3d, double y_3d, double z_3d, int have_3d_coords, int should_be_drawn, int retain_status_information, int retain_nonstatus_information, int obsess_over_host)
hostsmemberadd_parent_host_to_host (host *hst, char *host_name)
hostsmemberadd_child_link_to_host (host *hst, host *child_ptr)
servicesmemberadd_service_link_to_host (host *hst, service *service_ptr)
contactgroupsmemberadd_contactgroup_to_host (host *hst, char *group_name)
contactsmemberadd_contact_to_host (host *hst, char *contact_name)
customvariablesmemberadd_custom_variable_to_host (host *hst, char *varname, char *varvalue)
hostgroupadd_hostgroup (char *name, char *alias, char *notes, char *notes_url, char *action_url)
hostsmemberadd_host_to_hostgroup (hostgroup *temp_hostgroup, char *host_name)
servicegroupadd_servicegroup (char *name, char *alias, char *notes, char *notes_url, char *action_url)
servicesmemberadd_service_to_servicegroup (servicegroup *temp_servicegroup, char *host_name, char *svc_description)
contactadd_contact (char *name, char *alias, char *email, char *pager, char **addresses, char *svc_notification_period, char *host_notification_period, int notify_service_ok, int notify_service_critical, int notify_service_warning, int notify_service_unknown, int notify_service_flapping, int notify_service_downtime, int notify_host_up, int notify_host_down, int notify_host_unreachable, int notify_host_flapping, int notify_host_downtime, int host_notifications_enabled, int service_notifications_enabled, int can_submit_commands, int retain_status_information, int retain_nonstatus_information)
commandsmemberadd_host_notification_command_to_contact (contact *cntct, char *command_name)
commandsmemberadd_service_notification_command_to_contact (contact *cntct, char *command_name)
customvariablesmemberadd_custom_variable_to_contact (contact *cntct, char *varname, char *varvalue)
contactgroupadd_contactgroup (char *name, char *alias)
contactsmemberadd_contact_to_contactgroup (contactgroup *grp, char *contact_name)
serviceadd_service (char *host_name, char *description, char *display_name, char *check_period, int initial_state, int max_attempts, int parallelize, int accept_passive_checks, double check_interval, double retry_interval, double notification_interval, double first_notification_delay, char *notification_period, int notify_recovery, int notify_unknown, int notify_warning, int notify_critical, int notify_flapping, int notify_downtime, int notifications_enabled, int is_volatile, char *event_handler, int event_handler_enabled, char *check_command, int checks_enabled, int flap_detection_enabled, double low_flap_threshold, double high_flap_threshold, int flap_detection_on_ok, int flap_detection_on_warning, int flap_detection_on_unknown, int flap_detection_on_critical, int stalk_on_ok, int stalk_on_warning, int stalk_on_unknown, int stalk_on_critical, int process_perfdata, int failure_prediction_enabled, char *failure_prediction_options, int check_freshness, int freshness_threshold, char *notes, char *notes_url, char *action_url, char *icon_image, char *icon_image_alt, int retain_status_information, int retain_nonstatus_information, int obsess_over_service)
contactgroupsmemberadd_contactgroup_to_service (service *svc, char *group_name)
contactsmemberadd_contact_to_service (service *svc, char *contact_name)
customvariablesmemberadd_custom_variable_to_service (service *svc, char *varname, char *varvalue)
commandadd_command (char *name, char *value)
serviceescalationadd_serviceescalation (char *host_name, char *description, int first_notification, int last_notification, double notification_interval, char *escalation_period, int escalate_on_warning, int escalate_on_unknown, int escalate_on_critical, int escalate_on_recovery)
contactgroupsmemberadd_contactgroup_to_serviceescalation (serviceescalation *se, char *group_name)
contactsmemberadd_contact_to_serviceescalation (serviceescalation *se, char *contact_name)
servicedependencyadd_service_dependency (char *dependent_host_name, char *dependent_service_description, char *host_name, char *service_description, int dependency_type, int inherits_parent, int fail_on_ok, int fail_on_warning, int fail_on_unknown, int fail_on_critical, int fail_on_pending, char *dependency_period)
hostdependencyadd_host_dependency (char *dependent_host_name, char *host_name, int dependency_type, int inherits_parent, int fail_on_up, int fail_on_down, int fail_on_unreachable, int fail_on_pending, char *dependency_period)
hostescalationadd_hostescalation (char *host_name, int first_notification, int last_notification, double notification_interval, char *escalation_period, int escalate_on_down, int escalate_on_unreachable, int escalate_on_recovery)
escalation_conditionadd_host_service_escalation_condition (hostescalation *my_hostescalation, serviceescalation *my_serviceescalation, escalation_condition *last_condition, char *host_name, char *service_description, int connector, int escalate_on_down, int escalate_on_unreachable, int escalate_on_warning, int escalate_on_unknown, int escalate_on_critical, int escalate_on_ok)
escalation_conditionadd_hostescalation_condition (hostescalation *my_hostescalation, escalation_condition *last_condition, char *host_name, char *service_description, int connector, int escalate_on_down, int escalate_on_unreachable, int escalate_on_warning, int escalate_on_unknown, int escalate_on_critical, int escalate_on_ok)
escalation_conditionadd_serviceescalation_condition (serviceescalation *my_serviceescalation, escalation_condition *last_condition, char *host_name, char *service_description, int connector, int escalate_on_down, int escalate_on_unreachable, int escalate_on_warning, int escalate_on_unknown, int escalate_on_critical, int escalate_on_ok)
contactgroupsmemberadd_contactgroup_to_hostescalation (hostescalation *he, char *group_name)
contactsmemberadd_contact_to_hostescalation (hostescalation *he, char *contact_name)
contactsmemberadd_contact_to_object (contactsmember **object_ptr, char *contactname)
customvariablesmemberadd_custom_variable_to_object (customvariablesmember **object_ptr, char *varname, char *varvalue)
timeperiodfind_timeperiod (char *name)
hostfind_host (char *name)
hostgroupfind_hostgroup (char *name)
servicegroupfind_servicegroup (char *name)
contactfind_contact (char *name)
contactgroupfind_contactgroup (char *name)
commandfind_command (char *name)
servicefind_service (char *host_name, char *svc_desc)
hostescalationget_first_hostescalation_by_host (char *host_name, void **ptr)
hostescalationget_next_hostescalation_by_host (char *host_name, void **ptr)
serviceescalationget_first_serviceescalation_by_service (char *host_name, char *svc_description, void **ptr)
serviceescalationget_next_serviceescalation_by_service (char *host_name, char *svc_description, void **ptr)
hostdependencyget_first_hostdependency_by_dependent_host (char *host_name, void **ptr)
hostdependencyget_next_hostdependency_by_dependent_host (char *host_name, void **ptr)
servicedependencyget_first_servicedependency_by_dependent_service (char *host_name, char *svc_description, void **ptr)
servicedependencyget_next_servicedependency_by_dependent_service (char *host_name, char *svc_description, void **ptr)
int is_host_immediate_child_of_host (host *parent_host, host *child_host)
int is_host_immediate_parent_of_host (host *child_host, host *parent_host)
int number_of_immediate_child_hosts (host *hst)
int number_of_total_child_hosts (host *hst)
int number_of_immediate_parent_hosts (host *hst)
int number_of_total_parent_hosts (host *hst)
int is_host_member_of_hostgroup (hostgroup *group, host *hst)
int is_host_member_of_servicegroup (servicegroup *group, host *hst)
int is_service_member_of_servicegroup (servicegroup *group, service *svc)
int is_contact_member_of_contactgroup (contactgroup *group, contact *cntct)
int is_contact_for_host (host *hst, contact *cntct)
int is_escalated_contact_for_host (host *hst, contact *cntct)
int is_contact_for_service (service *svc, contact *cntct)
int is_escalated_contact_for_service (service *svc, contact *cntct)
int free_object_data (void)

Variables

hosthost_list = NULL
hosthost_list_tail = NULL
serviceservice_list = NULL
serviceservice_list_tail = NULL
contactcontact_list = NULL
contactcontact_list_tail = NULL
contactgroupcontactgroup_list = NULL
contactgroupcontactgroup_list_tail = NULL
hostgrouphostgroup_list = NULL
hostgrouphostgroup_list_tail = NULL
servicegroupservicegroup_list = NULL
servicegroupservicegroup_list_tail = NULL
commandcommand_list = NULL
commandcommand_list_tail = NULL
timeperiodtimeperiod_list = NULL
timeperiodtimeperiod_list_tail = NULL
serviceescalationserviceescalation_list = NULL
serviceescalationserviceescalation_list_tail = NULL
servicedependencyservicedependency_list = NULL
servicedependencyservicedependency_list_tail = NULL
hostdependencyhostdependency_list = NULL
hostdependencyhostdependency_list_tail = NULL
hostescalationhostescalation_list = NULL
hostescalationhostescalation_list_tail = NULL
skiplistobject_skiplists [NUM_OBJECT_SKIPLISTS]

Function Documentation

hostsmember* add_child_link_to_host ( host hst,
host child_ptr 
)

command* add_command ( char *  name,
char *  value 
)

contact* add_contact ( char *  name,
char *  alias,
char *  email,
char *  pager,
char **  addresses,
char *  svc_notification_period,
char *  host_notification_period,
int  notify_service_ok,
int  notify_service_critical,
int  notify_service_warning,
int  notify_service_unknown,
int  notify_service_flapping,
int  notify_service_downtime,
int  notify_host_up,
int  notify_host_down,
int  notify_host_unreachable,
int  notify_host_flapping,
int  notify_host_downtime,
int  host_notifications_enabled,
int  service_notifications_enabled,
int  can_submit_commands,
int  retain_status_information,
int  retain_nonstatus_information 
)

contactsmember* add_contact_to_contactgroup ( contactgroup grp,
char *  contact_name 
)

contactsmember* add_contact_to_host ( host hst,
char *  contact_name 
)

contactsmember* add_contact_to_hostescalation ( hostescalation he,
char *  contact_name 
)

contactsmember* add_contact_to_object ( contactsmember **  object_ptr,
char *  contactname 
)

contactsmember* add_contact_to_service ( service svc,
char *  contact_name 
)

contactsmember* add_contact_to_serviceescalation ( serviceescalation se,
char *  contact_name 
)

contactgroup* add_contactgroup ( char *  name,
char *  alias 
)

contactgroupsmember* add_contactgroup_to_host ( host hst,
char *  group_name 
)

contactgroupsmember* add_contactgroup_to_hostescalation ( hostescalation he,
char *  group_name 
)

contactgroupsmember* add_contactgroup_to_service ( service svc,
char *  group_name 
)

contactgroupsmember* add_contactgroup_to_serviceescalation ( serviceescalation se,
char *  group_name 
)

customvariablesmember* add_custom_variable_to_contact ( contact cntct,
char *  varname,
char *  varvalue 
)

customvariablesmember* add_custom_variable_to_host ( host hst,
char *  varname,
char *  varvalue 
)

customvariablesmember* add_custom_variable_to_object ( customvariablesmember **  object_ptr,
char *  varname,
char *  varvalue 
)

customvariablesmember* add_custom_variable_to_service ( service svc,
char *  varname,
char *  varvalue 
)

daterange* add_exception_to_timeperiod ( timeperiod period,
int  type,
int  syear,
int  smon,
int  smday,
int  swday,
int  swday_offset,
int  eyear,
int  emon,
int  emday,
int  ewday,
int  ewday_offset,
int  skip_interval 
)

timeperiodexclusion* add_exclusion_to_timeperiod ( timeperiod period,
char *  name 
)

host* add_host ( char *  name,
char *  display_name,
char *  alias,
char *  address,
char *  address6,
char *  check_period,
int  initial_state,
double  check_interval,
double  retry_interval,
int  max_attempts,
int  notify_up,
int  notify_down,
int  notify_unreachable,
int  notify_flapping,
int  notify_downtime,
double  notification_interval,
double  first_notification_delay,
char *  notification_period,
int  notifications_enabled,
char *  check_command,
int  checks_enabled,
int  accept_passive_checks,
char *  event_handler,
int  event_handler_enabled,
int  flap_detection_enabled,
double  low_flap_threshold,
double  high_flap_threshold,
int  flap_detection_on_up,
int  flap_detection_on_down,
int  flap_detection_on_unreachable,
int  stalk_on_up,
int  stalk_on_down,
int  stalk_on_unreachable,
int  process_perfdata,
int  failure_prediction_enabled,
char *  failure_prediction_options,
int  check_freshness,
int  freshness_threshold,
char *  notes,
char *  notes_url,
char *  action_url,
char *  icon_image,
char *  icon_image_alt,
char *  vrml_image,
char *  statusmap_image,
int  x_2d,
int  y_2d,
int  have_2d_coords,
double  x_3d,
double  y_3d,
double  z_3d,
int  have_3d_coords,
int  should_be_drawn,
int  retain_status_information,
int  retain_nonstatus_information,
int  obsess_over_host 
)

hostdependency* add_host_dependency ( char *  dependent_host_name,
char *  host_name,
int  dependency_type,
int  inherits_parent,
int  fail_on_up,
int  fail_on_down,
int  fail_on_unreachable,
int  fail_on_pending,
char *  dependency_period 
)

commandsmember* add_host_notification_command_to_contact ( contact cntct,
char *  command_name 
)

escalation_condition* add_host_service_escalation_condition ( hostescalation my_hostescalation,
serviceescalation my_serviceescalation,
escalation_condition last_condition,
char *  host_name,
char *  service_description,
int  connector,
int  escalate_on_down,
int  escalate_on_unreachable,
int  escalate_on_warning,
int  escalate_on_unknown,
int  escalate_on_critical,
int  escalate_on_ok 
)

hostsmember* add_host_to_hostgroup ( hostgroup temp_hostgroup,
char *  host_name 
)

hostescalation* add_hostescalation ( char *  host_name,
int  first_notification,
int  last_notification,
double  notification_interval,
char *  escalation_period,
int  escalate_on_down,
int  escalate_on_unreachable,
int  escalate_on_recovery 
)

escalation_condition* add_hostescalation_condition ( hostescalation my_hostescalation,
escalation_condition last_condition,
char *  host_name,
char *  service_description,
int  connector,
int  escalate_on_down,
int  escalate_on_unreachable,
int  escalate_on_warning,
int  escalate_on_unknown,
int  escalate_on_critical,
int  escalate_on_ok 
)

hostgroup* add_hostgroup ( char *  name,
char *  alias,
char *  notes,
char *  notes_url,
char *  action_url 
)

hostsmember* add_parent_host_to_host ( host hst,
char *  host_name 
)

service* add_service ( char *  host_name,
char *  description,
char *  display_name,
char *  check_period,
int  initial_state,
int  max_attempts,
int  parallelize,
int  accept_passive_checks,
double  check_interval,
double  retry_interval,
double  notification_interval,
double  first_notification_delay,
char *  notification_period,
int  notify_recovery,
int  notify_unknown,
int  notify_warning,
int  notify_critical,
int  notify_flapping,
int  notify_downtime,
int  notifications_enabled,
int  is_volatile,
char *  event_handler,
int  event_handler_enabled,
char *  check_command,
int  checks_enabled,
int  flap_detection_enabled,
double  low_flap_threshold,
double  high_flap_threshold,
int  flap_detection_on_ok,
int  flap_detection_on_warning,
int  flap_detection_on_unknown,
int  flap_detection_on_critical,
int  stalk_on_ok,
int  stalk_on_warning,
int  stalk_on_unknown,
int  stalk_on_critical,
int  process_perfdata,
int  failure_prediction_enabled,
char *  failure_prediction_options,
int  check_freshness,
int  freshness_threshold,
char *  notes,
char *  notes_url,
char *  action_url,
char *  icon_image,
char *  icon_image_alt,
int  retain_status_information,
int  retain_nonstatus_information,
int  obsess_over_service 
)

servicedependency* add_service_dependency ( char *  dependent_host_name,
char *  dependent_service_description,
char *  host_name,
char *  service_description,
int  dependency_type,
int  inherits_parent,
int  fail_on_ok,
int  fail_on_warning,
int  fail_on_unknown,
int  fail_on_critical,
int  fail_on_pending,
char *  dependency_period 
)

servicesmember* add_service_link_to_host ( host hst,
service service_ptr 
)

commandsmember* add_service_notification_command_to_contact ( contact cntct,
char *  command_name 
)

servicesmember* add_service_to_servicegroup ( servicegroup temp_servicegroup,
char *  host_name,
char *  svc_description 
)

serviceescalation* add_serviceescalation ( char *  host_name,
char *  description,
int  first_notification,
int  last_notification,
double  notification_interval,
char *  escalation_period,
int  escalate_on_warning,
int  escalate_on_unknown,
int  escalate_on_critical,
int  escalate_on_recovery 
)

escalation_condition* add_serviceescalation_condition ( serviceescalation my_serviceescalation,
escalation_condition last_condition,
char *  host_name,
char *  service_description,
int  connector,
int  escalate_on_down,
int  escalate_on_unreachable,
int  escalate_on_warning,
int  escalate_on_unknown,
int  escalate_on_critical,
int  escalate_on_ok 
)

servicegroup* add_servicegroup ( char *  name,
char *  alias,
char *  notes,
char *  notes_url,
char *  action_url 
)

timeperiod* add_timeperiod ( char *  name,
char *  alias 
)

timerange* add_timerange_to_daterange ( daterange drange,
unsigned long  start_time,
unsigned long  end_time 
)

timerange* add_timerange_to_timeperiod ( timeperiod period,
int  day,
unsigned long  start_time,
unsigned long  end_time 
)

command* find_command ( char *  name  ) 

contact* find_contact ( char *  name  ) 

contactgroup* find_contactgroup ( char *  name  ) 

host* find_host ( char *  name  ) 

hostgroup* find_hostgroup ( char *  name  ) 

service* find_service ( char *  host_name,
char *  svc_desc 
)

servicegroup* find_servicegroup ( char *  name  ) 

timeperiod* find_timeperiod ( char *  name  ) 

int free_object_data ( void   ) 

int free_object_skiplists ( void   ) 

hostdependency* get_first_hostdependency_by_dependent_host ( char *  host_name,
void **  ptr 
)

hostescalation* get_first_hostescalation_by_host ( char *  host_name,
void **  ptr 
)

servicedependency* get_first_servicedependency_by_dependent_service ( char *  host_name,
char *  svc_description,
void **  ptr 
)

serviceescalation* get_first_serviceescalation_by_service ( char *  host_name,
char *  svc_description,
void **  ptr 
)

int get_host_count ( void   ) 

hostdependency* get_next_hostdependency_by_dependent_host ( char *  host_name,
void **  ptr 
)

hostescalation* get_next_hostescalation_by_host ( char *  host_name,
void **  ptr 
)

servicedependency* get_next_servicedependency_by_dependent_service ( char *  host_name,
char *  svc_description,
void **  ptr 
)

serviceescalation* get_next_serviceescalation_by_service ( char *  host_name,
char *  svc_description,
void **  ptr 
)

int get_service_count ( void   ) 

int init_object_skiplists ( void   ) 

int is_contact_for_host ( host hst,
contact cntct 
)

int is_contact_for_service ( service svc,
contact cntct 
)

int is_contact_member_of_contactgroup ( contactgroup group,
contact cntct 
)

int is_escalated_contact_for_host ( host hst,
contact cntct 
)

int is_escalated_contact_for_service ( service svc,
contact cntct 
)

int is_host_immediate_child_of_host ( host parent_host,
host child_host 
)

int is_host_immediate_parent_of_host ( host child_host,
host parent_host 
)

int is_host_member_of_hostgroup ( hostgroup group,
host hst 
)

int is_host_member_of_servicegroup ( servicegroup group,
host hst 
)

int is_service_member_of_servicegroup ( servicegroup group,
service svc 
)

int number_of_immediate_child_hosts ( host hst  ) 

int number_of_immediate_parent_hosts ( host hst  ) 

int number_of_total_child_hosts ( host hst  ) 

int number_of_total_parent_hosts ( host hst  ) 

int read_object_config_data ( char *  main_config_file,
int  options,
int  cache,
int  precache 
)

int skiplist_compare_command ( void *  a,
void *  b 
)

int skiplist_compare_contact ( void *  a,
void *  b 
)

int skiplist_compare_contactgroup ( void *  a,
void *  b 
)

int skiplist_compare_host ( void *  a,
void *  b 
)

int skiplist_compare_hostdependency ( void *  a,
void *  b 
)

int skiplist_compare_hostescalation ( void *  a,
void *  b 
)

int skiplist_compare_hostgroup ( void *  a,
void *  b 
)

int skiplist_compare_service ( void *  a,
void *  b 
)

int skiplist_compare_servicedependency ( void *  a,
void *  b 
)

int skiplist_compare_serviceescalation ( void *  a,
void *  b 
)

int skiplist_compare_servicegroup ( void *  a,
void *  b 
)

int skiplist_compare_text ( const char *  val1a,
const char *  val1b,
const char *  val2a,
const char *  val2b 
)

int skiplist_compare_timeperiod ( void *  a,
void *  b 
)


Variable Documentation

command* command_list = NULL

command * command_list_tail = NULL

contact* contact_list = NULL

contact * contact_list_tail = NULL

contactgroup* contactgroup_list = NULL

contactgroup * contactgroup_list_tail = NULL

host* host_list = NULL

host * host_list_tail = NULL

hostdependency* hostdependency_list = NULL

hostdependency * hostdependency_list_tail = NULL

hostescalation* hostescalation_list = NULL

hostescalation * hostescalation_list_tail = NULL

hostgroup* hostgroup_list = NULL

hostgroup * hostgroup_list_tail = NULL

skiplist* object_skiplists[NUM_OBJECT_SKIPLISTS]

service* service_list = NULL

service * service_list_tail = NULL

servicedependency* servicedependency_list = NULL

servicedependency * servicedependency_list_tail = NULL

serviceescalation* serviceescalation_list = NULL

serviceescalation * serviceescalation_list_tail = NULL

servicegroup* servicegroup_list = NULL

servicegroup * servicegroup_list_tail = NULL

timeperiod* timeperiod_list = NULL

timeperiod * timeperiod_list_tail = NULL


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