Code
stringlengths
103
85.9k
Summary
listlengths
0
94
Please provide a description of the function:def disable_servicegroup_passive_host_checks(self, servicegroup): for service_id in servicegroup.get_services(): if service_id in self.daemon.services: host_id = self.daemon.services[service_id].host self.disable_p...
[ "Disable passive host checks for a servicegroup\n Format of the line that triggers function call::\n\n DISABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS;<servicegroup_name>\n\n :param servicegroup: servicegroup to disable\n :type servicegroup: alignak.objects.servicegroup.Servicegroup\n :r...
Please provide a description of the function:def disable_servicegroup_passive_svc_checks(self, servicegroup): for service_id in servicegroup.get_services(): self.disable_passive_svc_checks(self.daemon.services[service_id])
[ "Disable passive service checks for a servicegroup\n Format of the line that triggers function call::\n\n DISABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS;<servicegroup_name>\n\n :param servicegroup: servicegroup to disable\n :type servicegroup: alignak.objects.servicegroup.Servicegroup\n ...
Please provide a description of the function:def disable_servicegroup_svc_checks(self, servicegroup): for service_id in servicegroup.get_services(): self.disable_svc_check(self.daemon.services[service_id])
[ "Disable service checks for a servicegroup\n Format of the line that triggers function call::\n\n DISABLE_SERVICEGROUP_SVC_CHECKS;<servicegroup_name>\n\n :param servicegroup: servicegroup to disable\n :type servicegroup: alignak.objects.servicegroup.Servicegroup\n :return: None\n ...
Please provide a description of the function:def disable_servicegroup_svc_notifications(self, servicegroup): for service_id in servicegroup.get_services(): self.disable_svc_notifications(self.daemon.services[service_id])
[ "Disable service notifications for a servicegroup\n Format of the line that triggers function call::\n\n DISABLE_SERVICEGROUP_SVC_NOTIFICATIONS;<servicegroup_name>\n\n :param servicegroup: servicegroup to disable\n :type servicegroup: alignak.objects.servicegroup.Servicegroup\n :r...
Please provide a description of the function:def disable_service_flap_detection(self, service): if service.flap_detection_enabled: service.modified_attributes |= DICT_MODATTR["MODATTR_FLAP_DETECTION_ENABLED"].value service.flap_detection_enabled = False # Maybe the s...
[ "Disable flap detection for a service\n Format of the line that triggers function call::\n\n DISABLE_SERVICE_FLAP_DETECTION;<host_name>;<service_description>\n\n :param service: service to edit\n :type service: alignak.objects.service.Service\n :return: None\n " ]
Please provide a description of the function:def disable_svc_freshness_check(self, service): if service.check_freshness: service.modified_attributes |= DICT_MODATTR["MODATTR_FRESHNESS_CHECKS_ENABLED"].value service.check_freshness = False self.send_an_element(service...
[ "Disable freshness check for a service\n Format of the line that triggers function call::\n\n DISABLE_SERVICE_FRESHNESS_CHECK;<host_name>;<service_description>\n\n :param service: service to edit\n :type service: alignak.objects.service.Service\n :return: None\n " ]
Please provide a description of the function:def disable_service_freshness_checks(self): if self.my_conf.check_service_freshness: self.my_conf.modified_attributes |= \ DICT_MODATTR["MODATTR_FRESHNESS_CHECKS_ENABLED"].value self.my_conf.check_service_freshness = F...
[ "Disable service freshness checks (globally)\n Format of the line that triggers function call::\n\n DISABLE_SERVICE_FRESHNESS_CHECKS\n\n :return: None\n " ]
Please provide a description of the function:def disable_svc_check(self, service): if service.active_checks_enabled: service.disable_active_checks(self.daemon.checks) service.modified_attributes |= \ DICT_MODATTR["MODATTR_ACTIVE_CHECKS_ENABLED"].value ...
[ "Disable checks for a service\n Format of the line that triggers function call::\n\n DISABLE_SVC_CHECK;<host_name>;<service_description>\n\n :param service: service to edit\n :type service: alignak.objects.service.Service\n :return: None\n " ]
Please provide a description of the function:def disable_svc_event_handler(self, service): if service.event_handler_enabled: service.modified_attributes |= \ DICT_MODATTR["MODATTR_EVENT_HANDLER_ENABLED"].value service.event_handler_enabled = False sel...
[ "Disable event handlers for a service\n Format of the line that triggers function call::\n\n DISABLE_SVC_EVENT_HANDLER;<host_name>;<service_description>\n\n :param service: service to edit\n :type service: alignak.objects.service.Service\n :return: None\n " ]
Please provide a description of the function:def disable_svc_notifications(self, service): if service.notifications_enabled: service.modified_attributes |= \ DICT_MODATTR["MODATTR_NOTIFICATIONS_ENABLED"].value service.notifications_enabled = False sel...
[ "Disable notifications for a service\n Format of the line that triggers function call::\n\n DISABLE_SVC_NOTIFICATIONS;<host_name>;<service_description>\n\n :param service: service to edit\n :type service: alignak.objects.service.Service\n :return: None\n " ]
Please provide a description of the function:def enable_contactgroup_host_notifications(self, contactgroup): for contact_id in contactgroup.get_contacts(): self.enable_contact_host_notifications(self.daemon.contacts[contact_id])
[ "Enable host notifications for a contactgroup\n Format of the line that triggers function call::\n\n ENABLE_CONTACTGROUP_HOST_NOTIFICATIONS;<contactgroup_name>\n\n :param contactgroup: contactgroup to enable\n :type contactgroup: alignak.objects.contactgroup.Contactgroup\n :return...
Please provide a description of the function:def enable_contactgroup_svc_notifications(self, contactgroup): for contact_id in contactgroup.get_contacts(): self.enable_contact_svc_notifications(self.daemon.contacts[contact_id])
[ "Enable service notifications for a contactgroup\n Format of the line that triggers function call::\n\n ENABLE_CONTACTGROUP_SVC_NOTIFICATIONS;<contactgroup_name>\n\n :param contactgroup: contactgroup to enable\n :type contactgroup: alignak.objects.contactgroup.Contactgroup\n :retu...
Please provide a description of the function:def enable_contact_host_notifications(self, contact): if not contact.host_notifications_enabled: contact.modified_attributes |= \ DICT_MODATTR["MODATTR_NOTIFICATIONS_ENABLED"].value contact.host_notifications_enabled =...
[ "Enable host notifications for a contact\n Format of the line that triggers function call::\n\n ENABLE_CONTACT_HOST_NOTIFICATIONS;<contact_name>\n\n :param contact: contact to enable\n :type contact: alignak.objects.contact.Contact\n :return: None\n " ]
Please provide a description of the function:def enable_contact_svc_notifications(self, contact): if not contact.service_notifications_enabled: contact.modified_attributes |= \ DICT_MODATTR["MODATTR_NOTIFICATIONS_ENABLED"].value contact.service_notifications_enab...
[ "Enable service notifications for a contact\n Format of the line that triggers function call::\n\n DISABLE_CONTACT_SVC_NOTIFICATIONS;<contact_name>\n\n :param contact: contact to enable\n :type contact: alignak.objects.contact.Contact\n :return: None\n " ]
Please provide a description of the function:def enable_hostgroup_host_checks(self, hostgroup): for host_id in hostgroup.get_hosts(): if host_id in self.daemon.hosts: self.enable_host_check(self.daemon.hosts[host_id])
[ "Enable host checks for a hostgroup\n Format of the line that triggers function call::\n\n ENABLE_HOSTGROUP_HOST_CHECKS;<hostgroup_name>\n\n :param hostgroup: hostgroup to enable\n :type hostgroup: alignak.objects.hostgroup.Hostgroup\n :return: None\n " ]
Please provide a description of the function:def enable_hostgroup_host_notifications(self, hostgroup): for host_id in hostgroup.get_hosts(): if host_id in self.daemon.hosts: self.enable_host_notifications(self.daemon.hosts[host_id])
[ "Enable host notifications for a hostgroup\n Format of the line that triggers function call::\n\n ENABLE_HOSTGROUP_HOST_NOTIFICATIONS;<hostgroup_name>\n\n :param hostgroup: hostgroup to enable\n :type hostgroup: alignak.objects.hostgroup.Hostgroup\n :return: None\n " ]
Please provide a description of the function:def enable_hostgroup_passive_host_checks(self, hostgroup): for host_id in hostgroup.get_hosts(): if host_id in self.daemon.hosts: self.enable_passive_host_checks(self.daemon.hosts[host_id])
[ "Enable host passive checks for a hostgroup\n Format of the line that triggers function call::\n\n ENABLE_HOSTGROUP_PASSIVE_HOST_CHECKS;<hostgroup_name>\n\n :param hostgroup: hostgroup to enable\n :type hostgroup: alignak.objects.hostgroup.Hostgroup\n :return: None\n " ]
Please provide a description of the function:def enable_hostgroup_passive_svc_checks(self, hostgroup): for host_id in hostgroup.get_hosts(): if host_id in self.daemon.hosts: for service_id in self.daemon.hosts[host_id].services: if service_id in self.daem...
[ "Enable service passive checks for a hostgroup\n Format of the line that triggers function call::\n\n ENABLE_HOSTGROUP_PASSIVE_SVC_CHECKS;<hostgroup_name>\n\n :param hostgroup: hostgroup to enable\n :type hostgroup: alignak.objects.hostgroup.Hostgroup\n :return: None\n " ]
Please provide a description of the function:def enable_hostgroup_svc_checks(self, hostgroup): for host_id in hostgroup.get_hosts(): if host_id in self.daemon.hosts: for service_id in self.daemon.hosts[host_id].services: if service_id in self.daemon.servi...
[ "Enable service checks for a hostgroup\n Format of the line that triggers function call::\n\n ENABLE_HOSTGROUP_SVC_CHECKS;<hostgroup_name>\n\n :param hostgroup: hostgroup to enable\n :type hostgroup: alignak.objects.hostgroup.Hostgroup\n :return: None\n " ]
Please provide a description of the function:def enable_hostgroup_svc_notifications(self, hostgroup): for host_id in hostgroup.get_hosts(): if host_id in self.daemon.hosts: for service_id in self.daemon.hosts[host_id].services: if service_id in self.daemo...
[ "Enable service notifications for a hostgroup\n Format of the line that triggers function call::\n\n ENABLE_HOSTGROUP_SVC_NOTIFICATIONS;<hostgroup_name>\n\n :param hostgroup: hostgroup to enable\n :type hostgroup: alignak.objects.hostgroup.Hostgroup\n :return: None\n " ]
Please provide a description of the function:def enable_host_check(self, host): if not host.active_checks_enabled: host.active_checks_enabled = True host.modified_attributes |= \ DICT_MODATTR["MODATTR_ACTIVE_CHECKS_ENABLED"].value self.send_an_element...
[ "Enable checks for a host\n Format of the line that triggers function call::\n\n ENABLE_HOST_CHECK;<host_name>\n\n :param host: host to edit\n :type host: alignak.objects.host.Host\n :return: None\n " ]
Please provide a description of the function:def enable_host_event_handler(self, host): if not host.event_handler_enabled: host.modified_attributes |= \ DICT_MODATTR["MODATTR_EVENT_HANDLER_ENABLED"].value host.event_handler_enabled = True self.send_an...
[ "Enable event handlers for a host\n Format of the line that triggers function call::\n\n ENABLE_HOST_EVENT_HANDLER;<host_name>\n\n :param host: host to edit\n :type host: alignak.objects.host.Host\n :return: None\n " ]
Please provide a description of the function:def enable_host_flap_detection(self, host): if not host.flap_detection_enabled: host.modified_attributes |= \ DICT_MODATTR["MODATTR_FLAP_DETECTION_ENABLED"].value host.flap_detection_enabled = True self.sen...
[ "Enable flap detection for a host\n Format of the line that triggers function call::\n\n ENABLE_HOST_FLAP_DETECTION;<host_name>\n\n :param host: host to edit\n :type host: alignak.objects.host.Host\n :return: None\n " ]
Please provide a description of the function:def enable_host_freshness_check(self, host): if not host.check_freshness: host.modified_attributes |= DICT_MODATTR["MODATTR_FRESHNESS_CHECKS_ENABLED"].value host.check_freshness = True self.send_an_element(host.get_update_...
[ "Enable freshness check for a host\n Format of the line that triggers function call::\n\n ENABLE_HOST_FRESHNESS_CHECK;<host_name>\n\n :param host: host to edit\n :type host: alignak.objects.host.Host\n :return: None\n " ]
Please provide a description of the function:def enable_host_freshness_checks(self): if not self.my_conf.check_host_freshness: self.my_conf.modified_attributes |= \ DICT_MODATTR["MODATTR_FRESHNESS_CHECKS_ENABLED"].value self.my_conf.check_host_freshness = True ...
[ "Enable freshness checks (globally)\n Format of the line that triggers function call::\n\n ENABLE_HOST_FRESHNESS_CHECKS\n\n :return: None\n " ]
Please provide a description of the function:def enable_host_notifications(self, host): if not host.notifications_enabled: host.modified_attributes |= \ DICT_MODATTR["MODATTR_NOTIFICATIONS_ENABLED"].value host.notifications_enabled = True self.send_an...
[ "Enable notifications for a host\n Format of the line that triggers function call::\n\n ENABLE_HOST_NOTIFICATIONS;<host_name>\n\n :param host: host to edit\n :type host: alignak.objects.host.Host\n :return: None\n " ]
Please provide a description of the function:def enable_host_svc_checks(self, host): for service_id in host.services: if service_id in self.daemon.services: service = self.daemon.services[service_id] self.enable_svc_check(service) self.send_an...
[ "Enable service checks for a host\n Format of the line that triggers function call::\n\n ENABLE_HOST_SVC_CHECKS;<host_name>\n\n :param host: host to edit\n :type host: alignak.objects.host.Host\n :return: None\n " ]
Please provide a description of the function:def enable_host_svc_notifications(self, host): for service_id in host.services: if service_id in self.daemon.services: service = self.daemon.services[service_id] self.enable_svc_notifications(service) ...
[ "Enable services notifications for a host\n Format of the line that triggers function call::\n\n ENABLE_HOST_SVC_NOTIFICATIONS;<host_name>\n\n :param host: host to edit\n :type host: alignak.objects.host.Host\n :return: None\n " ]
Please provide a description of the function:def enable_notifications(self): # todo: #783 create a dedicated brok for global parameters if not self.my_conf.enable_notifications: self.my_conf.modified_attributes |= \ DICT_MODATTR["MODATTR_NOTIFICATIONS_ENABLED"].value...
[ "Enable notifications (globally)\n Format of the line that triggers function call::\n\n ENABLE_NOTIFICATIONS\n\n :return: None\n " ]
Please provide a description of the function:def enable_passive_host_checks(self, host): if not host.passive_checks_enabled: host.modified_attributes |= \ DICT_MODATTR["MODATTR_PASSIVE_CHECKS_ENABLED"].value host.passive_checks_enabled = True self.sen...
[ "Enable passive checks for a host\n Format of the line that triggers function call::\n\n ENABLE_PASSIVE_HOST_CHECKS;<host_name>\n\n :param host: host to edit\n :type host: alignak.objects.host.Host\n :return: None\n " ]
Please provide a description of the function:def enable_passive_svc_checks(self, service): if not service.passive_checks_enabled: service.modified_attributes |= \ DICT_MODATTR["MODATTR_PASSIVE_CHECKS_ENABLED"].value service.passive_checks_enabled = True ...
[ "Enable passive checks for a service\n Format of the line that triggers function call::\n\n ENABLE_PASSIVE_SVC_CHECKS;<host_name>;<service_description>\n\n :param service: service to edit\n :type service: alignak.objects.service.Service\n :return: None\n " ]
Please provide a description of the function:def enable_performance_data(self): if not self.my_conf.process_performance_data: self.my_conf.modified_attributes |= \ DICT_MODATTR["MODATTR_PERFORMANCE_DATA_ENABLED"].value self.my_conf.process_performance_data = True...
[ "Enable performance data processing (globally)\n Format of the line that triggers function call::\n\n ENABLE_PERFORMANCE_DATA\n\n :return: None\n " ]
Please provide a description of the function:def enable_servicegroup_host_checks(self, servicegroup): for service_id in servicegroup.get_services(): if service_id in self.daemon.services: host_id = self.daemon.services[service_id].host self.enable_host_check(...
[ "Enable host checks for a servicegroup\n Format of the line that triggers function call::\n\n ENABLE_SERVICEGROUP_HOST_CHECKS;<servicegroup_name>\n\n :param servicegroup: servicegroup to enable\n :type servicegroup: alignak.objects.servicegroup.Servicegroup\n :return: None\n ...
Please provide a description of the function:def enable_servicegroup_host_notifications(self, servicegroup): for service_id in servicegroup.get_services(): if service_id in self.daemon.services: host_id = self.daemon.services[service_id].host self.enable_host...
[ "Enable host notifications for a servicegroup\n Format of the line that triggers function call::\n\n ENABLE_SERVICEGROUP_HOST_NOTIFICATIONS;<servicegroup_name>\n\n :param servicegroup: servicegroup to enable\n :type servicegroup: alignak.objects.servicegroup.Servicegroup\n :return...
Please provide a description of the function:def enable_servicegroup_passive_host_checks(self, servicegroup): for service_id in servicegroup.get_services(): if service_id in self.daemon.services: host_id = self.daemon.services[service_id].host self.enable_pas...
[ "Enable passive host checks for a servicegroup\n Format of the line that triggers function call::\n\n ENABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS;<servicegroup_name>\n\n :param servicegroup: servicegroup to enable\n :type servicegroup: alignak.objects.servicegroup.Servicegroup\n :retu...
Please provide a description of the function:def enable_servicegroup_passive_svc_checks(self, servicegroup): for service_id in servicegroup.get_services(): self.enable_passive_svc_checks(self.daemon.services[service_id])
[ "Enable passive service checks for a servicegroup\n Format of the line that triggers function call::\n\n ENABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS;<servicegroup_name>\n\n :param servicegroup: servicegroup to enable\n :type servicegroup: alignak.objects.servicegroup.Servicegroup\n :re...
Please provide a description of the function:def enable_servicegroup_svc_checks(self, servicegroup): for service_id in servicegroup.get_services(): self.enable_svc_check(self.daemon.services[service_id])
[ "Enable service checks for a servicegroup\n Format of the line that triggers function call::\n\n ENABLE_SERVICEGROUP_SVC_CHECKS;<servicegroup_name>\n\n :param servicegroup: servicegroup to enable\n :type servicegroup: alignak.objects.servicegroup.Servicegroup\n :return: None\n ...
Please provide a description of the function:def enable_servicegroup_svc_notifications(self, servicegroup): for service_id in servicegroup.get_services(): self.enable_svc_notifications(self.daemon.services[service_id])
[ "Enable service notifications for a servicegroup\n Format of the line that triggers function call::\n\n ENABLE_SERVICEGROUP_SVC_NOTIFICATIONS;<servicegroup_name>\n\n :param servicegroup: servicegroup to enable\n :type servicegroup: alignak.objects.servicegroup.Servicegroup\n :retu...
Please provide a description of the function:def enable_service_freshness_checks(self): if not self.my_conf.check_service_freshness: self.my_conf.modified_attributes |= \ DICT_MODATTR["MODATTR_FRESHNESS_CHECKS_ENABLED"].value self.my_conf.check_service_freshness ...
[ "Enable service freshness checks (globally)\n Format of the line that triggers function call::\n\n ENABLE_SERVICE_FRESHNESS_CHECKS\n\n :return: None\n " ]
Please provide a description of the function:def enable_svc_check(self, service): if not service.active_checks_enabled: service.modified_attributes |= \ DICT_MODATTR["MODATTR_ACTIVE_CHECKS_ENABLED"].value service.active_checks_enabled = True self.send...
[ "Enable checks for a service\n Format of the line that triggers function call::\n\n ENABLE_SVC_CHECK;<host_name>;<service_description>\n\n :param service: service to edit\n :type service: alignak.objects.service.Service\n :return: None\n " ]
Please provide a description of the function:def enable_svc_event_handler(self, service): if not service.event_handler_enabled: service.modified_attributes |= \ DICT_MODATTR["MODATTR_EVENT_HANDLER_ENABLED"].value service.event_handler_enabled = True s...
[ "Enable event handlers for a service\n Format of the line that triggers function call::\n\n ENABLE_SVC_EVENT_HANDLER;<host_name>;<service_description>\n\n :param service: service to edit\n :type service: alignak.objects.service.Service\n :return: None\n " ]
Please provide a description of the function:def enable_svc_freshness_check(self, service): if not service.check_freshness: service.modified_attributes |= DICT_MODATTR["MODATTR_FRESHNESS_CHECKS_ENABLED"].value service.check_freshness = True self.send_an_element(servi...
[ "Enable freshness check for a service\n Format of the line that triggers function call::\n\n ENABLE_SERVICE_FRESHNESS_CHECK;<host_name>;<service_description>\n\n :param service: service to edit\n :type service: alignak.objects.service.Service\n :return: None\n " ]
Please provide a description of the function:def enable_svc_flap_detection(self, service): if not service.flap_detection_enabled: service.modified_attributes |= \ DICT_MODATTR["MODATTR_FLAP_DETECTION_ENABLED"].value service.flap_detection_enabled = True ...
[ "Enable flap detection for a service\n Format of the line that triggers function call::\n\n ENABLE_SVC_FLAP_DETECTION;<host_name>;<service_description>\n\n :param service: service to edit\n :type service: alignak.objects.service.Service\n :return: None\n " ]
Please provide a description of the function:def enable_svc_notifications(self, service): if not service.notifications_enabled: service.modified_attributes |= \ DICT_MODATTR["MODATTR_NOTIFICATIONS_ENABLED"].value service.notifications_enabled = True s...
[ "Enable notifications for a service\n Format of the line that triggers function call::\n\n ENABLE_SVC_NOTIFICATIONS;<host_name>;<service_description>\n\n :param service: service to edit\n :type service: alignak.objects.service.Service\n :return: None\n " ]
Please provide a description of the function:def process_host_check_result(self, host, status_code, plugin_output): now = time.time() cls = host.__class__ # If globally disabled OR host disabled, do not launch.. if not cls.accept_passive_checks or not host.passive_checks_enable...
[ "Process host check result\n Format of the line that triggers function call::\n\n PROCESS_HOST_CHECK_RESULT;<host_name>;<status_code>;<plugin_output>\n\n :param host: host to process check to\n :type host: alignak.objects.host.Host\n :param status_code: exit code of plugin\n ...
Please provide a description of the function:def process_host_output(self, host, plugin_output): self.process_host_check_result(host, host.state_id, plugin_output)
[ "Process host output\n Format of the line that triggers function call::\n\n PROCESS_HOST_OUTPUT;<host_name>;<plugin_output>\n\n :param host: host to process check to\n :type host: alignak.objects.host.Host\n :param plugin_output: plugin output\n :type plugin_output: str\n ...
Please provide a description of the function:def process_service_check_result(self, service, return_code, plugin_output): now = time.time() cls = service.__class__ # If globally disabled OR service disabled, do not launch.. if not cls.accept_passive_checks or not service.passiv...
[ "Process service check result\n Format of the line that triggers function call::\n\n PROCESS_SERVICE_CHECK_RESULT;<host_name>;<service_description>;<return_code>;<plugin_output>\n\n :param service: service to process check to\n :type service: alignak.objects.service.Service\n :par...
Please provide a description of the function:def process_service_output(self, service, plugin_output): self.process_service_check_result(service, service.state_id, plugin_output)
[ "Process service output\n Format of the line that triggers function call::\n\n PROCESS_SERVICE_OUTPUT;<host_name>;<service_description>;<plugin_output>\n\n :param service: service to process check to\n :type service: alignak.objects.service.Service\n :param plugin_output: plugin o...
Please provide a description of the function:def restart_program(self): restart_cmd = self.commands.find_by_name('restart-alignak') if not restart_cmd: logger.error("Cannot restart Alignak : missing command named" " 'restart-alignak'. Please add one") ...
[ "Restart Alignak\n Format of the line that triggers function call::\n\n RESTART_PROGRAM\n\n :return: None\n " ]
Please provide a description of the function:def reload_config(self): reload_cmd = self.commands.find_by_name('reload-alignak') if not reload_cmd: logger.error("Cannot restart Alignak : missing command" " named 'reload-alignak'. Please add one") ...
[ "Reload Alignak configuration\n Format of the line that triggers function call::\n\n RELOAD_CONFIG\n\n :return: None\n " ]
Please provide a description of the function:def schedule_and_propagate_host_downtime(self, host, start_time, end_time, fixed, trigger_id, duration, author, comment): logger.warning("The external command 'SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME' " ...
[ "DOES NOTHING (Should create host downtime and start it?)\n Format of the line that triggers function call::\n\n SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME;<host_name>;<start_time>;<end_time>;\n <fixed>;<trigger_id>;<duration>;<author>;<comment>\n\n :return: None\n " ]
Please provide a description of the function:def schedule_contact_downtime(self, contact, start_time, end_time, author, comment): data = {'ref': contact.uuid, 'start_time': start_time, 'end_time': end_time, 'author': author, 'comment': comment} cdt = ContactDowntime(data) ...
[ "Schedule contact downtime\n Format of the line that triggers function call::\n\n SCHEDULE_CONTACT_DOWNTIME;<contact_name>;<start_time>;<end_time>;<author>;<comment>\n\n :param contact: contact to put in downtime\n :type contact: alignak.objects.contact.Contact\n :param start_time...
Please provide a description of the function:def schedule_forced_host_check(self, host, check_time): host.schedule(self.daemon.hosts, self.daemon.services, self.daemon.timeperiods, self.daemon.macromodulations, self.daemon.checkmodulations, self.daemon.checks...
[ "Schedule a forced check on a host\n Format of the line that triggers function call::\n\n SCHEDULE_FORCED_HOST_CHECK;<host_name>;<check_time>\n\n :param host: host to check\n :type host: alignak.object.host.Host\n :param check_time: time to check\n :type check_time: int\n ...
Please provide a description of the function:def schedule_forced_host_svc_checks(self, host, check_time): for service_id in host.services: service = self.daemon.services[service_id] self.schedule_forced_svc_check(service, check_time) self.send_an_element(service.get_...
[ "Schedule a forced check on all services of a host\n Format of the line that triggers function call::\n\n SCHEDULE_FORCED_HOST_SVC_CHECKS;<host_name>;<check_time>\n\n :param host: host to check\n :type host: alignak.object.host.Host\n :param check_time: time to check\n :typ...
Please provide a description of the function:def schedule_forced_svc_check(self, service, check_time): service.schedule(self.daemon.hosts, self.daemon.services, self.daemon.timeperiods, self.daemon.macromodulations, self.daemon.checkmodulations, self.da...
[ "Schedule a forced check on a service\n Format of the line that triggers function call::\n\n SCHEDULE_FORCED_SVC_CHECK;<host_name>;<service_description>;<check_time>\n\n :param service: service to check\n :type service: alignak.object.service.Service\n :param check_time: time to c...
Please provide a description of the function:def schedule_hostgroup_host_downtime(self, hostgroup, start_time, end_time, fixed, trigger_id, duration, author, comment): for host_id in hostgroup.get_hosts(): if host_id in self.daemon.hosts: ...
[ "Schedule a downtime for each host of a hostgroup\n Format of the line that triggers function call::\n\n SCHEDULE_HOSTGROUP_HOST_DOWNTIME;<hostgroup_name>;<start_time>;<end_time>;\n <fixed>;<trigger_id>;<duration>;<author>;<comment>\n\n :param hostgroup: hostgroup to schedule\n :t...
Please provide a description of the function:def schedule_hostgroup_svc_downtime(self, hostgroup, start_time, end_time, fixed, trigger_id, duration, author, comment): for host_id in hostgroup.get_hosts(): if host_id in self.daemon.hosts: ...
[ "Schedule a downtime for each service of each host of a hostgroup\n Format of the line that triggers function call::\n\n SCHEDULE_HOSTGROUP_SVC_DOWNTIME;;<hostgroup_name>;<start_time>;<end_time>;<fixed>;\n <trigger_id>;<duration>;<author>;<comment>\n\n :param hostgroup: hostgroup to sche...
Please provide a description of the function:def schedule_host_check(self, host, check_time): host.schedule(self.daemon.hosts, self.daemon.services, self.daemon.timeperiods, self.daemon.macromodulations, self.daemon.checkmodulations, self.daemon.checks, ...
[ "Schedule a check on a host\n Format of the line that triggers function call::\n\n SCHEDULE_HOST_CHECK;<host_name>;<check_time>\n\n :param host: host to check\n :type host: alignak.object.host.Host\n :param check_time: time to check\n :type check_time:\n :return: Non...
Please provide a description of the function:def schedule_host_downtime(self, host, start_time, end_time, fixed, trigger_id, duration, author, comment): data = {'ref': host.uuid, 'ref_type': host.my_type, 'start_time': start_time, 'end_time': end_time, 'fi...
[ "Schedule a host downtime\n Format of the line that triggers function call::\n\n SCHEDULE_HOST_DOWNTIME;<host_name>;<start_time>;<end_time>;<fixed>;\n <trigger_id>;<duration>;<author>;<comment>\n\n :param host: host to schedule downtime\n :type host: alignak.object.host.Host\n ...
Please provide a description of the function:def schedule_host_svc_checks(self, host, check_time): for service_id in host.services: service = self.daemon.services[service_id] self.schedule_svc_check(service, check_time) self.send_an_element(service.get_update_status_...
[ "Schedule a check on all services of a host\n Format of the line that triggers function call::\n\n SCHEDULE_HOST_SVC_CHECKS;<host_name>;<check_time>\n\n :param host: host to check\n :type host: alignak.object.host.Host\n :param check_time: time to check\n :type check_time:\...
Please provide a description of the function:def schedule_host_svc_downtime(self, host, start_time, end_time, fixed, trigger_id, duration, author, comment): for serv in host.services: self.schedule_svc_downtime(serv, start_time, end_time, fixed, ...
[ "Schedule a service downtime for each service of an host\n Format of the line that triggers function call::\n\n SCHEDULE_HOST_SVC_DOWNTIME;<host_name>;<start_time>;<end_time>;\n <fixed>;<trigger_id>;<duration>;<author>;<comment>\n\n :param host: host to schedule downtime\n :type h...
Please provide a description of the function:def schedule_servicegroup_host_downtime(self, servicegroup, start_time, end_time, fixed, trigger_id, duration, author, comment): for host in [s.host for s in servicegroup.get_services()]: self.schedule_...
[ "Schedule a host downtime for each host of services in a servicegroup\n Format of the line that triggers function call::\n\n SCHEDULE_SERVICEGROUP_HOST_DOWNTIME;<servicegroup_name>;<start_time>;<end_time>;<fixed>;\n <trigger_id>;<duration>;<author>;<comment>\n\n :param servicegroup: serv...
Please provide a description of the function:def schedule_servicegroup_svc_downtime(self, servicegroup, start_time, end_time, fixed, trigger_id, duration, author, comment): for serv in servicegroup.get_services(): self.schedule_svc_downtime(serv, s...
[ "Schedule a service downtime for each service of a servicegroup\n Format of the line that triggers function call::\n\n SCHEDULE_SERVICEGROUP_SVC_DOWNTIME;<servicegroup_name>;<start_time>;<end_time>;\n <fixed>;<trigger_id>;<duration>;<author>;<comment>\n\n :param servicegroup: servicegrou...
Please provide a description of the function:def schedule_svc_check(self, service, check_time): service.schedule(self.daemon.hosts, self.daemon.services, self.daemon.timeperiods, self.daemon.macromodulations, self.daemon.checkmodulations, self.daemon.ch...
[ "Schedule a check on a service\n Format of the line that triggers function call::\n\n SCHEDULE_SVC_CHECK;<host_name>;<service_description>;<check_time>\n\n :param service: service to check\n :type service: alignak.object.service.Service\n :param check_time: time to check\n ...
Please provide a description of the function:def schedule_svc_downtime(self, service, start_time, end_time, fixed, trigger_id, duration, author, comment): data = {'ref': service.uuid, 'ref_type': service.my_type, 'start_time': start_time, 'end_time': end_ti...
[ "Schedule a service downtime\n Format of the line that triggers function call::\n\n SCHEDULE_SVC_DOWNTIME;<host_name>;<service_description><start_time>;<end_time>;\n <fixed>;<trigger_id>;<duration>;<author>;<comment>\n\n :param service: service to check\n :type service: alignak.ob...
Please provide a description of the function:def send_custom_host_notification(self, host, options, author, comment): logger.warning("The external command 'SEND_CUSTOM_HOST_NOTIFICATION' " "is not currently implemented in Alignak. If you really need it, " "...
[ "DOES NOTHING (Should send a custom notification)\n Format of the line that triggers function call::\n\n SEND_CUSTOM_HOST_NOTIFICATION;<host_name>;<options>;<author>;<comment>\n\n :param host: host to send notif for\n :type host: alignak.object.host.Host\n :param options: notifica...
Please provide a description of the function:def send_custom_svc_notification(self, service, options, author, comment): logger.warning("The external command 'SEND_CUSTOM_SVC_NOTIFICATION' " "is not currently implemented in Alignak. If you really need it, " ...
[ "DOES NOTHING (Should send a custom notification)\n Format of the line that triggers function call::\n\n SEND_CUSTOM_SVC_NOTIFICATION;<host_name>;<service_description>;<options>;<author>;<comment>>\n\n :param service: service to send notif for\n :type service: alignak.object.service.Serv...
Please provide a description of the function:def start_accepting_passive_host_checks(self): # todo: #783 create a dedicated brok for global parameters if not self.my_conf.accept_passive_host_checks: self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_PASSIVE_CHECKS_ENABLED"].v...
[ "Enable passive host check submission (globally)\n Format of the line that triggers function call::\n\n START_ACCEPTING_PASSIVE_HOST_CHECKS\n\n :return: None\n " ]
Please provide a description of the function:def start_accepting_passive_svc_checks(self): # todo: #783 create a dedicated brok for global parameters if not self.my_conf.accept_passive_service_checks: self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_PASSIVE_CHECKS_ENABLED"]...
[ "Enable passive service check submission (globally)\n Format of the line that triggers function call::\n\n START_ACCEPTING_PASSIVE_SVC_CHECKS\n\n :return: None\n " ]
Please provide a description of the function:def start_executing_host_checks(self): # todo: #783 create a dedicated brok for global parameters if not self.my_conf.execute_host_checks: self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_ACTIVE_CHECKS_ENABLED"].value ...
[ "Enable host check execution (globally)\n Format of the line that triggers function call::\n\n START_EXECUTING_HOST_CHECKS\n\n :return: None\n " ]
Please provide a description of the function:def start_executing_svc_checks(self): # todo: #783 create a dedicated brok for global parameters if not self.my_conf.execute_service_checks: self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_ACTIVE_CHECKS_ENABLED"].value ...
[ "Enable service check execution (globally)\n Format of the line that triggers function call::\n\n START_EXECUTING_SVC_CHECKS\n\n :return: None\n " ]
Please provide a description of the function:def stop_accepting_passive_host_checks(self): if self.my_conf.accept_passive_host_checks: self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_PASSIVE_CHECKS_ENABLED"].value self.my_conf.accept_passive_host_checks = False ...
[ "Disable passive host check submission (globally)\n Format of the line that triggers function call::\n\n STOP_ACCEPTING_PASSIVE_HOST_CHECKS\n\n :return: None\n " ]
Please provide a description of the function:def stop_accepting_passive_svc_checks(self): if self.my_conf.accept_passive_service_checks: self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_PASSIVE_CHECKS_ENABLED"].value self.my_conf.accept_passive_service_checks = False ...
[ "Disable passive service check submission (globally)\n Format of the line that triggers function call::\n\n STOP_ACCEPTING_PASSIVE_SVC_CHECKS\n\n :return: None\n " ]
Please provide a description of the function:def stop_executing_host_checks(self): if self.my_conf.execute_host_checks: self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_ACTIVE_CHECKS_ENABLED"].value self.my_conf.execute_host_checks = False self.my_conf.explo...
[ "Disable host check execution (globally)\n Format of the line that triggers function call::\n\n STOP_EXECUTING_HOST_CHECKS\n\n :return: None\n " ]
Please provide a description of the function:def stop_executing_svc_checks(self): if self.my_conf.execute_service_checks: self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_ACTIVE_CHECKS_ENABLED"].value self.my_conf.execute_service_checks = False self.my_conf....
[ "Disable service check execution (globally)\n Format of the line that triggers function call::\n\n STOP_EXECUTING_SVC_CHECKS\n\n :return: None\n " ]
Please provide a description of the function:def launch_svc_event_handler(self, service): service.get_event_handlers(self.hosts, self.daemon.macromodulations, self.daemon.timeperiods, ext_cmd=True)
[ "Launch event handler for a service\n Format of the line that triggers function call::\n\n LAUNCH_SVC_EVENT_HANDLER;<host_name>;<service_description>\n\n :param service: service to execute the event handler\n :type service: alignak.objects.service.Service\n :return: None\n ...
Please provide a description of the function:def launch_host_event_handler(self, host): host.get_event_handlers(self.hosts, self.daemon.macromodulations, self.daemon.timeperiods, ext_cmd=True)
[ "Launch event handler for a service\n Format of the line that triggers function call::\n\n LAUNCH_HOST_EVENT_HANDLER;<host_name>\n\n :param host: host to execute the event handler\n :type host: alignak.objects.host.Host\n :return: None\n " ]
Please provide a description of the function:def get_name(self): dependent_host_name = 'unknown' if getattr(self, 'dependent_host_name', None): dependent_host_name = getattr( getattr(self, 'dependent_host_name'), 'host_name', 'unknown' ) host_name...
[ "Get name based on dependent_host_name and host_name attributes\n Each attribute is substituted by 'unknown' if attribute does not exist\n\n :return: dependent_host_name/host_name\n :rtype: str\n " ]
Please provide a description of the function:def explode(self, hostgroups): # pylint: disable=too-many-locals # The "old" dependencies will be removed. All dependencies with # more than one host or a host group will be in it hstdep_to_remove = [] # Then for every host c...
[ "Explode all host dependency for each member of hostgroups\n Each member of dependent hostgroup or hostgroup in dependency have to get a copy of\n host dependencies (quite complex to parse)\n\n\n :param hostgroups: used to look for hostgroup\n :type hostgroups: alignak.objects.hostgroup....
Please provide a description of the function:def linkify(self, hosts, timeperiods): self.linkify_hd_by_h(hosts) self.linkify_hd_by_tp(timeperiods) self.linkify_h_by_hd(hosts)
[ "Create link between objects::\n\n * hostdependency -> host\n * hostdependency -> timeperiods\n\n :param hosts: hosts to link\n :type hosts: alignak.objects.host.Hosts\n :param timeperiods: timeperiods to link\n :type timeperiods: alignak.objects.timeperiod.Timeperiods\n ...
Please provide a description of the function:def linkify_hd_by_h(self, hosts): for hostdep in self: try: h_name = hostdep.host_name dh_name = hostdep.dependent_host_name host = hosts.find_by_name(h_name) if host is None: ...
[ "Replace dependent_host_name and host_name\n in host dependency by the real object\n\n :param hosts: host list, used to look for a specific one\n :type hosts: alignak.objects.host.Hosts\n :return: None\n " ]
Please provide a description of the function:def linkify_hd_by_tp(self, timeperiods): for hostdep in self: try: tp_name = hostdep.dependency_period timeperiod = timeperiods.find_by_name(tp_name) if timeperiod: hostdep.depen...
[ "Replace dependency_period by a real object in host dependency\n\n :param timeperiods: list of timeperiod, used to look for a specific one\n :type timeperiods: alignak.objects.timeperiod.Timeperiods\n :return: None\n " ]
Please provide a description of the function:def linkify_h_by_hd(self, hosts): for hostdep in self: # Only used for debugging purpose when loops are detected setattr(hostdep, "host_name_string", "undefined") setattr(hostdep, "dependent_host_name_string", "undefined")...
[ "Add dependency in host objects\n :param hosts: hosts list\n :type hosts: alignak.objects.host.Hosts\n\n :return: None\n " ]
Please provide a description of the function:def is_correct(self): state = True # Internal checks before executing inherited function... loop = self.no_loop_in_parents("host_name", "dependent_host_name") if loop: msg = "Loop detected while checking host dependencies...
[ "Check if this object configuration is correct ::\n\n * Check our own specific properties\n * Call our parent class is_correct checker\n\n :return: True if the configuration is correct, otherwise False\n :rtype: bool\n " ]
Please provide a description of the function:def merge(self, hosts): for extinfo in self: host_name = extinfo.get_name() host = hosts.find_by_name(host_name) if host is not None: # Fusion self.merge_extinfo(host, extinfo)
[ "Merge extended host information into services\n\n :param hosts: hosts list, to look for a specific one\n :type hosts: alignak.objects.host.Hosts\n :return: None\n " ]
Please provide a description of the function:def merge_extinfo(host, extinfo): # Note that 2d_coords and 3d_coords are never merged, so not usable ! properties = ['notes', 'notes_url', 'icon_image', 'icon_image_alt', 'vrml_image', 'statusmap_image'] # host properti...
[ "Merge extended host information into a host\n\n :param host: the host to edit\n :type host: alignak.objects.host.Host\n :param extinfo: the external info we get data from\n :type extinfo: alignak.objects.hostextinfo.HostExtInfo\n :return: None\n " ]
Please provide a description of the function:def set_proxy(self, proxy): # pragma: no cover, not with unit tests if proxy: logger.debug('PROXY SETTING PROXY %s', proxy) self._requests_con.proxies = { 'http': proxy, 'https': proxy, }
[ "Set HTTP proxy\n\n :param proxy: proxy url\n :type proxy: str\n :return: None\n " ]
Please provide a description of the function:def post(self, path, args, wait=False): uri = self.make_uri(path) timeout = self.make_timeout(wait) for (key, value) in list(args.items()): args[key] = serialize(value, True) try: logger.debug("post: %s, timeou...
[ "POST an HTTP request to a daemon\n\n :param path: path to do the request\n :type path: str\n :param args: args to add in the request\n :type args: dict\n :param wait: True for a long timeout\n :type wait: bool\n :return: Content of the HTTP response if server return...
Please provide a description of the function:def put(self, path, args, wait=False): # pragma: no cover, looks never used! # todo: remove this because it looks never used anywhere... uri = self.make_uri(path) timeout = self.make_timeout(wait) try: logger.debug("put: ...
[ "PUT and HTTP request to a daemon\n\n :param path: path to do the request\n :type path: str\n :param args: data to send in the request\n :type args:\n :return: Content of the HTTP response if server returned 200\n :rtype: str\n " ]
Please provide a description of the function:def explode(self, escalations): # Now we explode all escalations (host_name, hostgroup_name) to escalations for escalation in self: properties = escalation.__class__.properties name = getattr(escalation, 'host_name', getattr(e...
[ "Create instance of Escalation for each HostEscalation object\n\n :param escalations: list of escalation, used to add new ones\n :type escalations: alignak.objects.escalation.Escalations\n :return: None\n " ]
Please provide a description of the function:def serialize(self): return {'uuid': self.uuid, 'ref': self.ref, 'sticky': self.sticky, 'notify': self.notify, 'end_time': self.end_time, 'author': self.author, 'comment': self.comment}
[ "This function serialize into a simple dict object.\n It is used when transferring data to other daemons over the network (http)\n\n Here we directly return all attributes\n\n :return: json representation of a Acknowledge\n :rtype: dict\n " ]
Please provide a description of the function:def register(self, name, _type, statsd_host='localhost', statsd_port=8125, statsd_prefix='alignak', statsd_enabled=False, broks_enabled=False): self.name = name # This attribute is not used, but I keep ascending compatibility with fo...
[ "Init instance with real values\n\n :param name: daemon name\n :type name: str\n :param _type: daemon type\n :type _type:\n :param statsd_host: host to post data\n :type statsd_host: str\n :param statsd_port: port to post data\n :type statsd_port: int\n ...
Please provide a description of the function:def load_statsd(self): if not self.statsd_enabled: logger.info('Stats reporting is not enabled, connection is not allowed') return False if self.statsd_enabled and self.carbon: self.my_metrics.append(('.'.join([se...
[ "Create socket connection to statsd host\n\n Note that because of the UDP protocol used by StatsD, if no server is listening the\n socket connection will be accepted anyway :)\n\n :return: True if socket got created else False and an exception log is raised\n " ]
Please provide a description of the function:def connect(self, name, _type, host='localhost', port=2004, prefix='alignak', enabled=False, broks_enabled=False): self.name = name # This attribute is not used, but I keep ascending compatibility with former interface! self._...
[ "Init instance with real values for a graphite/carbon connection\n\n :param name: daemon name\n :type name: str\n :param _type: daemon type\n :type _type:\n :param host: host to post data\n :type host: str\n :param port: port to post data\n :type port: int\n ...
Please provide a description of the function:def flush(self, log=False): if not self.my_metrics: logger.debug("Flushing - no metrics to send") return True now = int(time.time()) if self.last_failure and self.last_failure + self.metrics_flush_pause > now: ...
[ "Send inner stored metrics to the defined Graphite\n\n Returns False if the sending failed with a warning log if log parameter is set\n\n :return: bool\n " ]
Please provide a description of the function:def send_to_graphite(self, metric, value, timestamp=None): # Manage Graphite part if not self.statsd_enabled or not self.carbon: return if timestamp is None: timestamp = int(time.time()) self.my_metrics.appen...
[ "\n Inner store a new metric and flush to Graphite if the flush threshold is reached.\n\n If no timestamp is provided, get the current time for the metric timestam.\n\n :param metric: metric name in dotted format\n :type metric: str\n :param value:\n :type value: float\n ...
Please provide a description of the function:def counter(self, key, value, timestamp=None): _min, _max, count, _sum = self.stats.get(key, (None, None, 0, 0)) count += 1 _sum += value if _min is None or value < _min: _min = value if _max is None or value > _ma...
[ "Set a counter value\n\n If the inner key does not exist is is created\n\n :param key: counter to update\n :type key: str\n :param value: counter value\n :type value: float\n :return: An alignak_stat brok if broks are enabled else None\n " ]
Please provide a description of the function:def get_managed_configurations(self): res = {} for scheduler_link in list(self.schedulers.values()): res[scheduler_link.instance_id] = { 'hash': scheduler_link.hash, 'push_flavor': scheduler_link.push_flavo...
[ "Get the configurations managed by this satellite\n\n The configurations managed by a satellite is a list of the configuration attached to\n the schedulers related to the satellites. A broker linked to several schedulers\n will return the list of the configuration parts of its scheduler links.\...
Please provide a description of the function:def get_scheduler_from_hostname(self, host_name): scheduler_uuid = self.hosts_schedulers.get(host_name, None) return self.schedulers.get(scheduler_uuid, None)
[ "Get scheduler linked to the given host_name\n\n :param host_name: host_name we want the scheduler from\n :type host_name: str\n :return: scheduler with id corresponding to the mapping table\n :rtype: dict\n " ]
Please provide a description of the function:def get_external_commands(self): res = self.external_commands logger.debug("Get and clear external commands list: %s", res) self.external_commands = [] return res
[ "Get the external commands\n\n :return: External commands list\n :rtype: list\n " ]