repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.enable_svc_notifications
def enable_svc_notifications(self, service): """Enable notifications for a service Format of the line that triggers function call:: ENABLE_SVC_NOTIFICATIONS;<host_name>;<service_description> :param service: service to edit :type service: alignak.objects.service.Service ...
python
def enable_svc_notifications(self, service): """Enable notifications for a service Format of the line that triggers function call:: ENABLE_SVC_NOTIFICATIONS;<host_name>;<service_description> :param service: service to edit :type service: alignak.objects.service.Service ...
[ "def", "enable_svc_notifications", "(", "self", ",", "service", ")", ":", "if", "not", "service", ".", "notifications_enabled", ":", "service", ".", "modified_attributes", "|=", "DICT_MODATTR", "[", "\"MODATTR_NOTIFICATIONS_ENABLED\"", "]", ".", "value", "service", ...
Enable notifications for a service Format of the line that triggers function call:: ENABLE_SVC_NOTIFICATIONS;<host_name>;<service_description> :param service: service to edit :type service: alignak.objects.service.Service :return: None
[ "Enable", "notifications", "for", "a", "service", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3062-L3076
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.process_host_check_result
def process_host_check_result(self, host, status_code, plugin_output): """Process host check result Format of the line that triggers function call:: PROCESS_HOST_CHECK_RESULT;<host_name>;<status_code>;<plugin_output> :param host: host to process check to :type host: alignak.obj...
python
def process_host_check_result(self, host, status_code, plugin_output): """Process host check result Format of the line that triggers function call:: PROCESS_HOST_CHECK_RESULT;<host_name>;<status_code>;<plugin_output> :param host: host to process check to :type host: alignak.obj...
[ "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", "no...
Process host check result Format of the line that triggers function call:: PROCESS_HOST_CHECK_RESULT;<host_name>;<status_code>;<plugin_output> :param host: host to process check to :type host: alignak.objects.host.Host :param status_code: exit code of plugin :type statu...
[ "Process", "host", "check", "result", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3097-L3165
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.process_host_output
def process_host_output(self, host, plugin_output): """Process host output Format of the line that triggers function call:: PROCESS_HOST_OUTPUT;<host_name>;<plugin_output> :param host: host to process check to :type host: alignak.objects.host.Host :param plugin_output: ...
python
def process_host_output(self, host, plugin_output): """Process host output Format of the line that triggers function call:: PROCESS_HOST_OUTPUT;<host_name>;<plugin_output> :param host: host to process check to :type host: alignak.objects.host.Host :param plugin_output: ...
[ "def", "process_host_output", "(", "self", ",", "host", ",", "plugin_output", ")", ":", "self", ".", "process_host_check_result", "(", "host", ",", "host", ".", "state_id", ",", "plugin_output", ")" ]
Process host output Format of the line that triggers function call:: PROCESS_HOST_OUTPUT;<host_name>;<plugin_output> :param host: host to process check to :type host: alignak.objects.host.Host :param plugin_output: plugin output :type plugin_output: str :return:...
[ "Process", "host", "output", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3167-L3179
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.process_service_check_result
def process_service_check_result(self, service, return_code, plugin_output): """Process service check result Format of the line that triggers function call:: PROCESS_SERVICE_CHECK_RESULT;<host_name>;<service_description>;<return_code>;<plugin_output> :param service: service to process ...
python
def process_service_check_result(self, service, return_code, plugin_output): """Process service check result Format of the line that triggers function call:: PROCESS_SERVICE_CHECK_RESULT;<host_name>;<service_description>;<return_code>;<plugin_output> :param service: service to process ...
[ "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..", ...
Process service check result Format of the line that triggers function call:: PROCESS_SERVICE_CHECK_RESULT;<host_name>;<service_description>;<return_code>;<plugin_output> :param service: service to process check to :type service: alignak.objects.service.Service :param return_co...
[ "Process", "service", "check", "result", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3181-L3256
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.process_service_output
def process_service_output(self, service, plugin_output): """Process service output Format of the line that triggers function call:: PROCESS_SERVICE_OUTPUT;<host_name>;<service_description>;<plugin_output> :param service: service to process check to :type service: alignak.objec...
python
def process_service_output(self, service, plugin_output): """Process service output Format of the line that triggers function call:: PROCESS_SERVICE_OUTPUT;<host_name>;<service_description>;<plugin_output> :param service: service to process check to :type service: alignak.objec...
[ "def", "process_service_output", "(", "self", ",", "service", ",", "plugin_output", ")", ":", "self", ".", "process_service_check_result", "(", "service", ",", "service", ".", "state_id", ",", "plugin_output", ")" ]
Process service output Format of the line that triggers function call:: PROCESS_SERVICE_OUTPUT;<host_name>;<service_description>;<plugin_output> :param service: service to process check to :type service: alignak.objects.service.Service :param plugin_output: plugin output ...
[ "Process", "service", "output", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3258-L3270
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.restart_program
def restart_program(self): """Restart Alignak Format of the line that triggers function call:: RESTART_PROGRAM :return: None """ restart_cmd = self.commands.find_by_name('restart-alignak') if not restart_cmd: logger.error("Cannot restart Alignak : mi...
python
def restart_program(self): """Restart Alignak Format of the line that triggers function call:: RESTART_PROGRAM :return: None """ restart_cmd = self.commands.find_by_name('restart-alignak') if not restart_cmd: logger.error("Cannot restart Alignak : mi...
[ "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 Format of the line that triggers function call:: RESTART_PROGRAM :return: None
[ "Restart", "Alignak", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3313-L3344
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.reload_config
def reload_config(self): """Reload Alignak configuration Format of the line that triggers function call:: RELOAD_CONFIG :return: None """ reload_cmd = self.commands.find_by_name('reload-alignak') if not reload_cmd: logger.error("Cannot restart Aligna...
python
def reload_config(self): """Reload Alignak configuration Format of the line that triggers function call:: RELOAD_CONFIG :return: None """ reload_cmd = self.commands.find_by_name('reload-alignak') if not reload_cmd: logger.error("Cannot restart Aligna...
[ "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 'relo...
Reload Alignak configuration Format of the line that triggers function call:: RELOAD_CONFIG :return: None
[ "Reload", "Alignak", "configuration", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3346-L3378
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.schedule_and_propagate_host_downtime
def schedule_and_propagate_host_downtime(self, host, start_time, end_time, fixed, trigger_id, duration, author, comment): """DOES NOTHING (Should create host downtime and start it?) Format of the line that triggers function call:: SCHEDULE_AND_PROPAG...
python
def schedule_and_propagate_host_downtime(self, host, start_time, end_time, fixed, trigger_id, duration, author, comment): """DOES NOTHING (Should create host downtime and start it?) Format of the line that triggers function call:: SCHEDULE_AND_PROPAG...
[ "def", "schedule_and_propagate_host_downtime", "(", "self", ",", "host", ",", "start_time", ",", "end_time", ",", "fixed", ",", "trigger_id", ",", "duration", ",", "author", ",", "comment", ")", ":", "logger", ".", "warning", "(", "\"The external command 'SCHEDULE...
DOES NOTHING (Should create host downtime and start it?) Format of the line that triggers function call:: SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME;<host_name>;<start_time>;<end_time>; <fixed>;<trigger_id>;<duration>;<author>;<comment> :return: None
[ "DOES", "NOTHING", "(", "Should", "create", "host", "downtime", "and", "start", "it?", ")", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3395-L3410
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.schedule_contact_downtime
def schedule_contact_downtime(self, contact, start_time, end_time, author, comment): """Schedule contact downtime Format of the line that triggers function call:: SCHEDULE_CONTACT_DOWNTIME;<contact_name>;<start_time>;<end_time>;<author>;<comment> :param contact: contact to put in downt...
python
def schedule_contact_downtime(self, contact, start_time, end_time, author, comment): """Schedule contact downtime Format of the line that triggers function call:: SCHEDULE_CONTACT_DOWNTIME;<contact_name>;<start_time>;<end_time>;<author>;<comment> :param contact: contact to put in downt...
[ "def", "schedule_contact_downtime", "(", "self", ",", "contact", ",", "start_time", ",", "end_time", ",", "author", ",", "comment", ")", ":", "data", "=", "{", "'ref'", ":", "contact", ".", "uuid", ",", "'start_time'", ":", "start_time", ",", "'end_time'", ...
Schedule contact downtime Format of the line that triggers function call:: SCHEDULE_CONTACT_DOWNTIME;<contact_name>;<start_time>;<end_time>;<author>;<comment> :param contact: contact to put in downtime :type contact: alignak.objects.contact.Contact :param start_time: downtime s...
[ "Schedule", "contact", "downtime", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3430-L3452
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.schedule_forced_host_check
def schedule_forced_host_check(self, host, check_time): """Schedule a forced check on a host Format of the line that triggers function call:: SCHEDULE_FORCED_HOST_CHECK;<host_name>;<check_time> :param host: host to check :type host: alignak.object.host.Host :param check...
python
def schedule_forced_host_check(self, host, check_time): """Schedule a forced check on a host Format of the line that triggers function call:: SCHEDULE_FORCED_HOST_CHECK;<host_name>;<check_time> :param host: host to check :type host: alignak.object.host.Host :param check...
[ "def", "schedule_forced_host_check", "(", "self", ",", "host", ",", "check_time", ")", ":", "host", ".", "schedule", "(", "self", ".", "daemon", ".", "hosts", ",", "self", ".", "daemon", ".", "services", ",", "self", ".", "daemon", ".", "timeperiods", ",...
Schedule a forced check on a host Format of the line that triggers function call:: SCHEDULE_FORCED_HOST_CHECK;<host_name>;<check_time> :param host: host to check :type host: alignak.object.host.Host :param check_time: time to check :type check_time: int :return:...
[ "Schedule", "a", "forced", "check", "on", "a", "host", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3454-L3470
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.schedule_forced_host_svc_checks
def schedule_forced_host_svc_checks(self, host, check_time): """Schedule a forced check on all services of a host Format of the line that triggers function call:: SCHEDULE_FORCED_HOST_SVC_CHECKS;<host_name>;<check_time> :param host: host to check :type host: alignak.object.host...
python
def schedule_forced_host_svc_checks(self, host, check_time): """Schedule a forced check on all services of a host Format of the line that triggers function call:: SCHEDULE_FORCED_HOST_SVC_CHECKS;<host_name>;<check_time> :param host: host to check :type host: alignak.object.host...
[ "def", "schedule_forced_host_svc_checks", "(", "self", ",", "host", ",", "check_time", ")", ":", "for", "service_id", "in", "host", ".", "services", ":", "service", "=", "self", ".", "daemon", ".", "services", "[", "service_id", "]", "self", ".", "schedule_f...
Schedule a forced check on all services of a host Format of the line that triggers function call:: SCHEDULE_FORCED_HOST_SVC_CHECKS;<host_name>;<check_time> :param host: host to check :type host: alignak.object.host.Host :param check_time: time to check :type check_time:...
[ "Schedule", "a", "forced", "check", "on", "all", "services", "of", "a", "host", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3472-L3487
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.schedule_forced_svc_check
def schedule_forced_svc_check(self, service, check_time): """Schedule a forced check on a service Format of the line that triggers function call:: SCHEDULE_FORCED_SVC_CHECK;<host_name>;<service_description>;<check_time> :param service: service to check :type service: alignak.ob...
python
def schedule_forced_svc_check(self, service, check_time): """Schedule a forced check on a service Format of the line that triggers function call:: SCHEDULE_FORCED_SVC_CHECK;<host_name>;<service_description>;<check_time> :param service: service to check :type service: alignak.ob...
[ "def", "schedule_forced_svc_check", "(", "self", ",", "service", ",", "check_time", ")", ":", "service", ".", "schedule", "(", "self", ".", "daemon", ".", "hosts", ",", "self", ".", "daemon", ".", "services", ",", "self", ".", "daemon", ".", "timeperiods",...
Schedule a forced check on a service Format of the line that triggers function call:: SCHEDULE_FORCED_SVC_CHECK;<host_name>;<service_description>;<check_time> :param service: service to check :type service: alignak.object.service.Service :param check_time: time to check ...
[ "Schedule", "a", "forced", "check", "on", "a", "service", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3489-L3505
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.schedule_hostgroup_host_downtime
def schedule_hostgroup_host_downtime(self, hostgroup, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a downtime for each host of a hostgroup Format of the line that triggers function call:: SCHEDULE_HOSTGROUP_HOST_DOWNTI...
python
def schedule_hostgroup_host_downtime(self, hostgroup, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a downtime for each host of a hostgroup Format of the line that triggers function call:: SCHEDULE_HOSTGROUP_HOST_DOWNTI...
[ "def", "schedule_hostgroup_host_downtime", "(", "self", ",", "hostgroup", ",", "start_time", ",", "end_time", ",", "fixed", ",", "trigger_id", ",", "duration", ",", "author", ",", "comment", ")", ":", "for", "host_id", "in", "hostgroup", ".", "get_hosts", "(",...
Schedule a downtime for each host of a hostgroup Format of the line that triggers function call:: SCHEDULE_HOSTGROUP_HOST_DOWNTIME;<hostgroup_name>;<start_time>;<end_time>; <fixed>;<trigger_id>;<duration>;<author>;<comment> :param hostgroup: hostgroup to schedule :type hostgrou...
[ "Schedule", "a", "downtime", "for", "each", "host", "of", "a", "hostgroup", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3507-L3537
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.schedule_hostgroup_svc_downtime
def schedule_hostgroup_svc_downtime(self, hostgroup, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a downtime for each service of each host of a hostgroup Format of the line that triggers function call:: SCHEDULE_HOSTGRO...
python
def schedule_hostgroup_svc_downtime(self, hostgroup, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a downtime for each service of each host of a hostgroup Format of the line that triggers function call:: SCHEDULE_HOSTGRO...
[ "def", "schedule_hostgroup_svc_downtime", "(", "self", ",", "hostgroup", ",", "start_time", ",", "end_time", ",", "fixed", ",", "trigger_id", ",", "duration", ",", "author", ",", "comment", ")", ":", "for", "host_id", "in", "hostgroup", ".", "get_hosts", "(", ...
Schedule a downtime for each service of each host of a hostgroup Format of the line that triggers function call:: SCHEDULE_HOSTGROUP_SVC_DOWNTIME;;<hostgroup_name>;<start_time>;<end_time>;<fixed>; <trigger_id>;<duration>;<author>;<comment> :param hostgroup: hostgroup to schedule ...
[ "Schedule", "a", "downtime", "for", "each", "service", "of", "each", "host", "of", "a", "hostgroup", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3539-L3571
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.schedule_host_check
def schedule_host_check(self, host, check_time): """Schedule a check on a host Format of the line that triggers function call:: SCHEDULE_HOST_CHECK;<host_name>;<check_time> :param host: host to check :type host: alignak.object.host.Host :param check_time: time to check ...
python
def schedule_host_check(self, host, check_time): """Schedule a check on a host Format of the line that triggers function call:: SCHEDULE_HOST_CHECK;<host_name>;<check_time> :param host: host to check :type host: alignak.object.host.Host :param check_time: time to check ...
[ "def", "schedule_host_check", "(", "self", ",", "host", ",", "check_time", ")", ":", "host", ".", "schedule", "(", "self", ".", "daemon", ".", "hosts", ",", "self", ".", "daemon", ".", "services", ",", "self", ".", "daemon", ".", "timeperiods", ",", "s...
Schedule a check on a host Format of the line that triggers function call:: SCHEDULE_HOST_CHECK;<host_name>;<check_time> :param host: host to check :type host: alignak.object.host.Host :param check_time: time to check :type check_time: :return: None
[ "Schedule", "a", "check", "on", "a", "host", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3573-L3589
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.schedule_host_downtime
def schedule_host_downtime(self, host, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a host downtime Format of the line that triggers function call:: SCHEDULE_HOST_DOWNTIME;<host_name>;<start_time>;<end_time>;<fixed>; <tr...
python
def schedule_host_downtime(self, host, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a host downtime Format of the line that triggers function call:: SCHEDULE_HOST_DOWNTIME;<host_name>;<start_time>;<end_time>;<fixed>; <tr...
[ "def", "schedule_host_downtime", "(", "self", ",", "host", ",", "start_time", ",", "end_time", ",", "fixed", ",", "trigger_id", ",", "duration", ",", "author", ",", "comment", ")", ":", "data", "=", "{", "'ref'", ":", "host", ".", "uuid", ",", "'ref_type...
Schedule a host downtime Format of the line that triggers function call:: SCHEDULE_HOST_DOWNTIME;<host_name>;<start_time>;<end_time>;<fixed>; <trigger_id>;<duration>;<author>;<comment> :param host: host to schedule downtime :type host: alignak.object.host.Host :param st...
[ "Schedule", "a", "host", "downtime", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3591-L3628
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.schedule_host_svc_checks
def schedule_host_svc_checks(self, host, check_time): """Schedule a check on all services of a host Format of the line that triggers function call:: SCHEDULE_HOST_SVC_CHECKS;<host_name>;<check_time> :param host: host to check :type host: alignak.object.host.Host :param ...
python
def schedule_host_svc_checks(self, host, check_time): """Schedule a check on all services of a host Format of the line that triggers function call:: SCHEDULE_HOST_SVC_CHECKS;<host_name>;<check_time> :param host: host to check :type host: alignak.object.host.Host :param ...
[ "def", "schedule_host_svc_checks", "(", "self", ",", "host", ",", "check_time", ")", ":", "for", "service_id", "in", "host", ".", "services", ":", "service", "=", "self", ".", "daemon", ".", "services", "[", "service_id", "]", "self", ".", "schedule_svc_chec...
Schedule a check on all services of a host Format of the line that triggers function call:: SCHEDULE_HOST_SVC_CHECKS;<host_name>;<check_time> :param host: host to check :type host: alignak.object.host.Host :param check_time: time to check :type check_time: :retu...
[ "Schedule", "a", "check", "on", "all", "services", "of", "a", "host", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3630-L3645
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.schedule_host_svc_downtime
def schedule_host_svc_downtime(self, host, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a service downtime for each service of an host Format of the line that triggers function call:: SCHEDULE_HOST_SVC_DOWNTIME;<host_name>;<...
python
def schedule_host_svc_downtime(self, host, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a service downtime for each service of an host Format of the line that triggers function call:: SCHEDULE_HOST_SVC_DOWNTIME;<host_name>;<...
[ "def", "schedule_host_svc_downtime", "(", "self", ",", "host", ",", "start_time", ",", "end_time", ",", "fixed", ",", "trigger_id", ",", "duration", ",", "author", ",", "comment", ")", ":", "for", "serv", "in", "host", ".", "services", ":", "self", ".", ...
Schedule a service downtime for each service of an host Format of the line that triggers function call:: SCHEDULE_HOST_SVC_DOWNTIME;<host_name>;<start_time>;<end_time>; <fixed>;<trigger_id>;<duration>;<author>;<comment> :param host: host to schedule downtime :type host: alignak...
[ "Schedule", "a", "service", "downtime", "for", "each", "service", "of", "an", "host", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3647-L3675
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.schedule_servicegroup_host_downtime
def schedule_servicegroup_host_downtime(self, servicegroup, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a host downtime for each host of services in a servicegroup Format of the line that triggers function call:: S...
python
def schedule_servicegroup_host_downtime(self, servicegroup, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a host downtime for each host of services in a servicegroup Format of the line that triggers function call:: S...
[ "def", "schedule_servicegroup_host_downtime", "(", "self", ",", "servicegroup", ",", "start_time", ",", "end_time", ",", "fixed", ",", "trigger_id", ",", "duration", ",", "author", ",", "comment", ")", ":", "for", "host", "in", "[", "s", ".", "host", "for", ...
Schedule a host downtime for each host of services in a servicegroup Format of the line that triggers function call:: SCHEDULE_SERVICEGROUP_HOST_DOWNTIME;<servicegroup_name>;<start_time>;<end_time>;<fixed>; <trigger_id>;<duration>;<author>;<comment> :param servicegroup: servicegroup to...
[ "Schedule", "a", "host", "downtime", "for", "each", "host", "of", "services", "in", "a", "servicegroup", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3677-L3705
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.schedule_servicegroup_svc_downtime
def schedule_servicegroup_svc_downtime(self, servicegroup, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a service downtime for each service of a servicegroup Format of the line that triggers function call:: SCHEDULE_...
python
def schedule_servicegroup_svc_downtime(self, servicegroup, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a service downtime for each service of a servicegroup Format of the line that triggers function call:: SCHEDULE_...
[ "def", "schedule_servicegroup_svc_downtime", "(", "self", ",", "servicegroup", ",", "start_time", ",", "end_time", ",", "fixed", ",", "trigger_id", ",", "duration", ",", "author", ",", "comment", ")", ":", "for", "serv", "in", "servicegroup", ".", "get_services"...
Schedule a service downtime for each service of a servicegroup Format of the line that triggers function call:: SCHEDULE_SERVICEGROUP_SVC_DOWNTIME;<servicegroup_name>;<start_time>;<end_time>; <fixed>;<trigger_id>;<duration>;<author>;<comment> :param servicegroup: servicegroup to schedu...
[ "Schedule", "a", "service", "downtime", "for", "each", "service", "of", "a", "servicegroup", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3707-L3735
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.schedule_svc_check
def schedule_svc_check(self, service, check_time): """Schedule a check on a service Format of the line that triggers function call:: SCHEDULE_SVC_CHECK;<host_name>;<service_description>;<check_time> :param service: service to check :type service: alignak.object.service.Service ...
python
def schedule_svc_check(self, service, check_time): """Schedule a check on a service Format of the line that triggers function call:: SCHEDULE_SVC_CHECK;<host_name>;<service_description>;<check_time> :param service: service to check :type service: alignak.object.service.Service ...
[ "def", "schedule_svc_check", "(", "self", ",", "service", ",", "check_time", ")", ":", "service", ".", "schedule", "(", "self", ".", "daemon", ".", "hosts", ",", "self", ".", "daemon", ".", "services", ",", "self", ".", "daemon", ".", "timeperiods", ",",...
Schedule a check on a service Format of the line that triggers function call:: SCHEDULE_SVC_CHECK;<host_name>;<service_description>;<check_time> :param service: service to check :type service: alignak.object.service.Service :param check_time: time to check :type check_t...
[ "Schedule", "a", "check", "on", "a", "service", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3737-L3753
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.schedule_svc_downtime
def schedule_svc_downtime(self, service, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a service downtime Format of the line that triggers function call:: SCHEDULE_SVC_DOWNTIME;<host_name>;<service_description><start_time>;<end_ti...
python
def schedule_svc_downtime(self, service, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a service downtime Format of the line that triggers function call:: SCHEDULE_SVC_DOWNTIME;<host_name>;<service_description><start_time>;<end_ti...
[ "def", "schedule_svc_downtime", "(", "self", ",", "service", ",", "start_time", ",", "end_time", ",", "fixed", ",", "trigger_id", ",", "duration", ",", "author", ",", "comment", ")", ":", "data", "=", "{", "'ref'", ":", "service", ".", "uuid", ",", "'ref...
Schedule a service downtime Format of the line that triggers function call:: SCHEDULE_SVC_DOWNTIME;<host_name>;<service_description><start_time>;<end_time>; <fixed>;<trigger_id>;<duration>;<author>;<comment> :param service: service to check :type service: alignak.object.service...
[ "Schedule", "a", "service", "downtime", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3755-L3791
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.send_custom_host_notification
def send_custom_host_notification(self, host, options, author, comment): """DOES NOTHING (Should send a custom notification) Format of the line that triggers function call:: SEND_CUSTOM_HOST_NOTIFICATION;<host_name>;<options>;<author>;<comment> :param host: host to send notif for ...
python
def send_custom_host_notification(self, host, options, author, comment): """DOES NOTHING (Should send a custom notification) Format of the line that triggers function call:: SEND_CUSTOM_HOST_NOTIFICATION;<host_name>;<options>;<author>;<comment> :param host: host to send notif for ...
[ "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 ...
DOES NOTHING (Should send a custom notification) Format of the line that triggers function call:: SEND_CUSTOM_HOST_NOTIFICATION;<host_name>;<options>;<author>;<comment> :param host: host to send notif for :type host: alignak.object.host.Host :param options: notification options...
[ "DOES", "NOTHING", "(", "Should", "send", "a", "custom", "notification", ")", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3793-L3814
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.send_custom_svc_notification
def send_custom_svc_notification(self, service, options, author, comment): """DOES NOTHING (Should send a custom notification) Format of the line that triggers function call:: SEND_CUSTOM_SVC_NOTIFICATION;<host_name>;<service_description>;<options>;<author>;<comment>> :param service: s...
python
def send_custom_svc_notification(self, service, options, author, comment): """DOES NOTHING (Should send a custom notification) Format of the line that triggers function call:: SEND_CUSTOM_SVC_NOTIFICATION;<host_name>;<service_description>;<options>;<author>;<comment>> :param service: s...
[ "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...
DOES NOTHING (Should send a custom notification) Format of the line that triggers function call:: SEND_CUSTOM_SVC_NOTIFICATION;<host_name>;<service_description>;<options>;<author>;<comment>> :param service: service to send notif for :type service: alignak.object.service.Service ...
[ "DOES", "NOTHING", "(", "Should", "send", "a", "custom", "notification", ")", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3816-L3837
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.start_accepting_passive_host_checks
def start_accepting_passive_host_checks(self): """Enable passive host check submission (globally) Format of the line that triggers function call:: START_ACCEPTING_PASSIVE_HOST_CHECKS :return: None """ # todo: #783 create a dedicated brok for global parameters if...
python
def start_accepting_passive_host_checks(self): """Enable passive host check submission (globally) Format of the line that triggers function call:: START_ACCEPTING_PASSIVE_HOST_CHECKS :return: None """ # todo: #783 create a dedicated brok for global parameters if...
[ "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_MO...
Enable passive host check submission (globally) Format of the line that triggers function call:: START_ACCEPTING_PASSIVE_HOST_CHECKS :return: None
[ "Enable", "passive", "host", "check", "submission", "(", "globally", ")", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3892-L3905
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.start_accepting_passive_svc_checks
def start_accepting_passive_svc_checks(self): """Enable passive service check submission (globally) Format of the line that triggers function call:: START_ACCEPTING_PASSIVE_SVC_CHECKS :return: None """ # todo: #783 create a dedicated brok for global parameters i...
python
def start_accepting_passive_svc_checks(self): """Enable passive service check submission (globally) Format of the line that triggers function call:: START_ACCEPTING_PASSIVE_SVC_CHECKS :return: None """ # todo: #783 create a dedicated brok for global parameters i...
[ "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_...
Enable passive service check submission (globally) Format of the line that triggers function call:: START_ACCEPTING_PASSIVE_SVC_CHECKS :return: None
[ "Enable", "passive", "service", "check", "submission", "(", "globally", ")", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3907-L3920
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.start_executing_host_checks
def start_executing_host_checks(self): """Enable host check execution (globally) Format of the line that triggers function call:: START_EXECUTING_HOST_CHECKS :return: None """ # todo: #783 create a dedicated brok for global parameters if not self.my_conf.execute...
python
def start_executing_host_checks(self): """Enable host check execution (globally) Format of the line that triggers function call:: START_EXECUTING_HOST_CHECKS :return: None """ # todo: #783 create a dedicated brok for global parameters if not self.my_conf.execute...
[ "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", "[", ...
Enable host check execution (globally) Format of the line that triggers function call:: START_EXECUTING_HOST_CHECKS :return: None
[ "Enable", "host", "check", "execution", "(", "globally", ")", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3922-L3935
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.start_executing_svc_checks
def start_executing_svc_checks(self): """Enable service check execution (globally) Format of the line that triggers function call:: START_EXECUTING_SVC_CHECKS :return: None """ # todo: #783 create a dedicated brok for global parameters if not self.my_conf.execut...
python
def start_executing_svc_checks(self): """Enable service check execution (globally) Format of the line that triggers function call:: START_EXECUTING_SVC_CHECKS :return: None """ # todo: #783 create a dedicated brok for global parameters if not self.my_conf.execut...
[ "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", "["...
Enable service check execution (globally) Format of the line that triggers function call:: START_EXECUTING_SVC_CHECKS :return: None
[ "Enable", "service", "check", "execution", "(", "globally", ")", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3937-L3950
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.stop_accepting_passive_host_checks
def stop_accepting_passive_host_checks(self): """Disable passive host check submission (globally) Format of the line that triggers function call:: STOP_ACCEPTING_PASSIVE_HOST_CHECKS :return: None """ if self.my_conf.accept_passive_host_checks: self.my_conf.m...
python
def stop_accepting_passive_host_checks(self): """Disable passive host check submission (globally) Format of the line that triggers function call:: STOP_ACCEPTING_PASSIVE_HOST_CHECKS :return: None """ if self.my_conf.accept_passive_host_checks: self.my_conf.m...
[ "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\"", "]", ".", "va...
Disable passive host check submission (globally) Format of the line that triggers function call:: STOP_ACCEPTING_PASSIVE_HOST_CHECKS :return: None
[ "Disable", "passive", "host", "check", "submission", "(", "globally", ")", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3952-L3964
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.stop_accepting_passive_svc_checks
def stop_accepting_passive_svc_checks(self): """Disable passive service check submission (globally) Format of the line that triggers function call:: STOP_ACCEPTING_PASSIVE_SVC_CHECKS :return: None """ if self.my_conf.accept_passive_service_checks: self.my_co...
python
def stop_accepting_passive_svc_checks(self): """Disable passive service check submission (globally) Format of the line that triggers function call:: STOP_ACCEPTING_PASSIVE_SVC_CHECKS :return: None """ if self.my_conf.accept_passive_service_checks: self.my_co...
[ "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\"", "]", ".", "...
Disable passive service check submission (globally) Format of the line that triggers function call:: STOP_ACCEPTING_PASSIVE_SVC_CHECKS :return: None
[ "Disable", "passive", "service", "check", "submission", "(", "globally", ")", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3966-L3978
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.stop_executing_host_checks
def stop_executing_host_checks(self): """Disable host check execution (globally) Format of the line that triggers function call:: STOP_EXECUTING_HOST_CHECKS :return: None """ if self.my_conf.execute_host_checks: self.my_conf.modified_attributes |= DICT_MODAT...
python
def stop_executing_host_checks(self): """Disable host check execution (globally) Format of the line that triggers function call:: STOP_EXECUTING_HOST_CHECKS :return: None """ if self.my_conf.execute_host_checks: self.my_conf.modified_attributes |= DICT_MODAT...
[ "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", ...
Disable host check execution (globally) Format of the line that triggers function call:: STOP_EXECUTING_HOST_CHECKS :return: None
[ "Disable", "host", "check", "execution", "(", "globally", ")", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3980-L3992
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.stop_executing_svc_checks
def stop_executing_svc_checks(self): """Disable service check execution (globally) Format of the line that triggers function call:: STOP_EXECUTING_SVC_CHECKS :return: None """ if self.my_conf.execute_service_checks: self.my_conf.modified_attributes |= DICT_M...
python
def stop_executing_svc_checks(self): """Disable service check execution (globally) Format of the line that triggers function call:: STOP_EXECUTING_SVC_CHECKS :return: None """ if self.my_conf.execute_service_checks: self.my_conf.modified_attributes |= DICT_M...
[ "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"...
Disable service check execution (globally) Format of the line that triggers function call:: STOP_EXECUTING_SVC_CHECKS :return: None
[ "Disable", "service", "check", "execution", "(", "globally", ")", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L3994-L4006
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.launch_svc_event_handler
def launch_svc_event_handler(self, service): """Launch event handler for a service Format of the line that triggers function call:: LAUNCH_SVC_EVENT_HANDLER;<host_name>;<service_description> :param service: service to execute the event handler :type service: alignak.objects.ser...
python
def launch_svc_event_handler(self, service): """Launch event handler for a service Format of the line that triggers function call:: LAUNCH_SVC_EVENT_HANDLER;<host_name>;<service_description> :param service: service to execute the event handler :type service: alignak.objects.ser...
[ "def", "launch_svc_event_handler", "(", "self", ",", "service", ")", ":", "service", ".", "get_event_handlers", "(", "self", ".", "hosts", ",", "self", ".", "daemon", ".", "macromodulations", ",", "self", ".", "daemon", ".", "timeperiods", ",", "ext_cmd", "=...
Launch event handler for a service Format of the line that triggers function call:: LAUNCH_SVC_EVENT_HANDLER;<host_name>;<service_description> :param service: service to execute the event handler :type service: alignak.objects.service.Service :return: None
[ "Launch", "event", "handler", "for", "a", "service", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L4008-L4019
Alignak-monitoring/alignak
alignak/external_command.py
ExternalCommandManager.launch_host_event_handler
def launch_host_event_handler(self, host): """Launch event handler for a service Format of the line that triggers function call:: LAUNCH_HOST_EVENT_HANDLER;<host_name> :param host: host to execute the event handler :type host: alignak.objects.host.Host :return: None ...
python
def launch_host_event_handler(self, host): """Launch event handler for a service Format of the line that triggers function call:: LAUNCH_HOST_EVENT_HANDLER;<host_name> :param host: host to execute the event handler :type host: alignak.objects.host.Host :return: None ...
[ "def", "launch_host_event_handler", "(", "self", ",", "host", ")", ":", "host", ".", "get_event_handlers", "(", "self", ".", "hosts", ",", "self", ".", "daemon", ".", "macromodulations", ",", "self", ".", "daemon", ".", "timeperiods", ",", "ext_cmd", "=", ...
Launch event handler for a service Format of the line that triggers function call:: LAUNCH_HOST_EVENT_HANDLER;<host_name> :param host: host to execute the event handler :type host: alignak.objects.host.Host :return: None
[ "Launch", "event", "handler", "for", "a", "service", "Format", "of", "the", "line", "that", "triggers", "function", "call", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L4021-L4032
Alignak-monitoring/alignak
alignak/objects/hostdependency.py
Hostdependency.get_name
def get_name(self): """Get name based on dependent_host_name and host_name attributes Each attribute is substituted by 'unknown' if attribute does not exist :return: dependent_host_name/host_name :rtype: str """ dependent_host_name = 'unknown' if getattr(self, 'd...
python
def get_name(self): """Get name based on dependent_host_name and host_name attributes Each attribute is substituted by 'unknown' if attribute does not exist :return: dependent_host_name/host_name :rtype: str """ dependent_host_name = 'unknown' if getattr(self, 'd...
[ "def", "get_name", "(", "self", ")", ":", "dependent_host_name", "=", "'unknown'", "if", "getattr", "(", "self", ",", "'dependent_host_name'", ",", "None", ")", ":", "dependent_host_name", "=", "getattr", "(", "getattr", "(", "self", ",", "'dependent_host_name'"...
Get name based on dependent_host_name and host_name attributes Each attribute is substituted by 'unknown' if attribute does not exist :return: dependent_host_name/host_name :rtype: str
[ "Get", "name", "based", "on", "dependent_host_name", "and", "host_name", "attributes", "Each", "attribute", "is", "substituted", "by", "unknown", "if", "attribute", "does", "not", "exist" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostdependency.py#L110-L125
Alignak-monitoring/alignak
alignak/objects/hostdependency.py
Hostdependencies.explode
def explode(self, hostgroups): # pylint: disable=too-many-locals """Explode all host dependency for each member of hostgroups Each member of dependent hostgroup or hostgroup in dependency have to get a copy of host dependencies (quite complex to parse) :param hostgroups: used t...
python
def explode(self, hostgroups): # pylint: disable=too-many-locals """Explode all host dependency for each member of hostgroups Each member of dependent hostgroup or hostgroup in dependency have to get a copy of host dependencies (quite complex to parse) :param hostgroups: used t...
[ "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 create a...
Explode all host dependency for each member of hostgroups Each member of dependent hostgroup or hostgroup in dependency have to get a copy of host dependencies (quite complex to parse) :param hostgroups: used to look for hostgroup :type hostgroups: alignak.objects.hostgroup.Hostgroups ...
[ "Explode", "all", "host", "dependency", "for", "each", "member", "of", "hostgroups", "Each", "member", "of", "dependent", "hostgroup", "or", "hostgroup", "in", "dependency", "have", "to", "get", "a", "copy", "of", "host", "dependencies", "(", "quite", "complex...
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostdependency.py#L144-L206
Alignak-monitoring/alignak
alignak/objects/hostdependency.py
Hostdependencies.linkify
def linkify(self, hosts, timeperiods): """Create link between objects:: * hostdependency -> host * hostdependency -> timeperiods :param hosts: hosts to link :type hosts: alignak.objects.host.Hosts :param timeperiods: timeperiods to link :type timeperiods: alig...
python
def linkify(self, hosts, timeperiods): """Create link between objects:: * hostdependency -> host * hostdependency -> timeperiods :param hosts: hosts to link :type hosts: alignak.objects.host.Hosts :param timeperiods: timeperiods to link :type timeperiods: alig...
[ "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:: * hostdependency -> host * hostdependency -> timeperiods :param hosts: hosts to link :type hosts: alignak.objects.host.Hosts :param timeperiods: timeperiods to link :type timeperiods: alignak.objects.timeperiod.Timeperiods :return...
[ "Create", "link", "between", "objects", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostdependency.py#L208-L222
Alignak-monitoring/alignak
alignak/objects/hostdependency.py
Hostdependencies.linkify_hd_by_h
def linkify_hd_by_h(self, hosts): """Replace dependent_host_name and host_name in host dependency by the real object :param hosts: host list, used to look for a specific one :type hosts: alignak.objects.host.Hosts :return: None """ for hostdep in self: ...
python
def linkify_hd_by_h(self, hosts): """Replace dependent_host_name and host_name in host dependency by the real object :param hosts: host list, used to look for a specific one :type hosts: alignak.objects.host.Hosts :return: None """ for hostdep in self: ...
[ "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", "(...
Replace dependent_host_name and host_name in host dependency by the real object :param hosts: host list, used to look for a specific one :type hosts: alignak.objects.host.Hosts :return: None
[ "Replace", "dependent_host_name", "and", "host_name", "in", "host", "dependency", "by", "the", "real", "object" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostdependency.py#L224-L251
Alignak-monitoring/alignak
alignak/objects/hostdependency.py
Hostdependencies.linkify_hd_by_tp
def linkify_hd_by_tp(self, timeperiods): """Replace dependency_period by a real object in host dependency :param timeperiods: list of timeperiod, used to look for a specific one :type timeperiods: alignak.objects.timeperiod.Timeperiods :return: None """ for hostdep in se...
python
def linkify_hd_by_tp(self, timeperiods): """Replace dependency_period by a real object in host dependency :param timeperiods: list of timeperiod, used to look for a specific one :type timeperiods: alignak.objects.timeperiod.Timeperiods :return: None """ for hostdep in se...
[ "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", "tim...
Replace dependency_period by a real object in host dependency :param timeperiods: list of timeperiod, used to look for a specific one :type timeperiods: alignak.objects.timeperiod.Timeperiods :return: None
[ "Replace", "dependency_period", "by", "a", "real", "object", "in", "host", "dependency" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostdependency.py#L253-L269
Alignak-monitoring/alignak
alignak/objects/hostdependency.py
Hostdependencies.linkify_h_by_hd
def linkify_h_by_hd(self, hosts): """Add dependency in host objects :param hosts: hosts list :type hosts: alignak.objects.host.Hosts :return: None """ for hostdep in self: # Only used for debugging purpose when loops are detected setattr(hostdep, ...
python
def linkify_h_by_hd(self, hosts): """Add dependency in host objects :param hosts: hosts list :type hosts: alignak.objects.host.Hosts :return: None """ for hostdep in self: # Only used for debugging purpose when loops are detected setattr(hostdep, ...
[ "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...
Add dependency in host objects :param hosts: hosts list :type hosts: alignak.objects.host.Hosts :return: None
[ "Add", "dependency", "in", "host", "objects", ":", "param", "hosts", ":", "hosts", "list", ":", "type", "hosts", ":", "alignak", ".", "objects", ".", "host", ".", "Hosts" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostdependency.py#L271-L304
Alignak-monitoring/alignak
alignak/objects/hostdependency.py
Hostdependencies.is_correct
def is_correct(self): """Check if this object configuration is correct :: * Check our own specific properties * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False :rtype: bool """ state = True # Inter...
python
def is_correct(self): """Check if this object configuration is correct :: * Check our own specific properties * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False :rtype: bool """ state = True # Inter...
[ "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", "=", "\...
Check if this object configuration is correct :: * Check our own specific properties * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False :rtype: bool
[ "Check", "if", "this", "object", "configuration", "is", "correct", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostdependency.py#L306-L336
Alignak-monitoring/alignak
alignak/objects/hostextinfo.py
HostsExtInfo.merge
def merge(self, hosts): """Merge extended host information into services :param hosts: hosts list, to look for a specific one :type hosts: alignak.objects.host.Hosts :return: None """ for extinfo in self: host_name = extinfo.get_name() host = host...
python
def merge(self, hosts): """Merge extended host information into services :param hosts: hosts list, to look for a specific one :type hosts: alignak.objects.host.Hosts :return: None """ for extinfo in self: host_name = extinfo.get_name() host = host...
[ "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", ":"...
Merge extended host information into services :param hosts: hosts list, to look for a specific one :type hosts: alignak.objects.host.Hosts :return: None
[ "Merge", "extended", "host", "information", "into", "services" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostextinfo.py#L121-L133
Alignak-monitoring/alignak
alignak/objects/hostextinfo.py
HostsExtInfo.merge_extinfo
def merge_extinfo(host, extinfo): """Merge extended host information into a host :param host: the host to edit :type host: alignak.objects.host.Host :param extinfo: the external info we get data from :type extinfo: alignak.objects.hostextinfo.HostExtInfo :return: None ...
python
def merge_extinfo(host, extinfo): """Merge extended host information into a host :param host: the host to edit :type host: alignak.objects.host.Host :param extinfo: the external info we get data from :type extinfo: alignak.objects.hostextinfo.HostExtInfo :return: None ...
[ "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'", ",", "'statusm...
Merge extended host information into a host :param host: the host to edit :type host: alignak.objects.host.Host :param extinfo: the external info we get data from :type extinfo: alignak.objects.hostextinfo.HostExtInfo :return: None
[ "Merge", "extended", "host", "information", "into", "a", "host" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostextinfo.py#L136-L151
Alignak-monitoring/alignak
alignak/http/client.py
HTTPClient.set_proxy
def set_proxy(self, proxy): # pragma: no cover, not with unit tests """Set HTTP proxy :param proxy: proxy url :type proxy: str :return: None """ if proxy: logger.debug('PROXY SETTING PROXY %s', proxy) self._requests_con.proxies = { ...
python
def set_proxy(self, proxy): # pragma: no cover, not with unit tests """Set HTTP proxy :param proxy: proxy url :type proxy: str :return: None """ if proxy: logger.debug('PROXY SETTING PROXY %s', proxy) self._requests_con.proxies = { ...
[ "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'", ...
Set HTTP proxy :param proxy: proxy url :type proxy: str :return: None
[ "Set", "HTTP", "proxy" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/client.py#L176-L188
Alignak-monitoring/alignak
alignak/http/client.py
HTTPClient.post
def post(self, path, args, wait=False): """POST an HTTP request to a daemon :param path: path to do the request :type path: str :param args: args to add in the request :type args: dict :param wait: True for a long timeout :type wait: bool :return: Content...
python
def post(self, path, args, wait=False): """POST an HTTP request to a daemon :param path: path to do the request :type path: str :param args: args to add in the request :type args: dict :param wait: True for a long timeout :type wait: bool :return: Content...
[ "def", "post", "(", "self", ",", "path", ",", "args", ",", "wait", "=", "False", ")", ":", "uri", "=", "self", ".", "make_uri", "(", "path", ")", "timeout", "=", "self", ".", "make_timeout", "(", "wait", ")", "for", "(", "key", ",", "value", ")",...
POST an HTTP request to a daemon :param path: path to do the request :type path: str :param args: args to add in the request :type args: dict :param wait: True for a long timeout :type wait: bool :return: Content of the HTTP response if server returned 200 ...
[ "POST", "an", "HTTP", "request", "to", "a", "daemon" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/client.py#L219-L247
Alignak-monitoring/alignak
alignak/http/client.py
HTTPClient.put
def put(self, path, args, wait=False): # pragma: no cover, looks never used! # todo: remove this because it looks never used anywhere... """PUT and HTTP request to a daemon :param path: path to do the request :type path: str :param args: data to send in the request :typ...
python
def put(self, path, args, wait=False): # pragma: no cover, looks never used! # todo: remove this because it looks never used anywhere... """PUT and HTTP request to a daemon :param path: path to do the request :type path: str :param args: data to send in the request :typ...
[ "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", "=", ...
PUT and HTTP request to a daemon :param path: path to do the request :type path: str :param args: data to send in the request :type args: :return: Content of the HTTP response if server returned 200 :rtype: str
[ "PUT", "and", "HTTP", "request", "to", "a", "daemon" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/client.py#L249-L274
Alignak-monitoring/alignak
alignak/objects/hostescalation.py
Hostescalations.explode
def explode(self, escalations): """Create instance of Escalation for each HostEscalation object :param escalations: list of escalation, used to add new ones :type escalations: alignak.objects.escalation.Escalations :return: None """ # Now we explode all escalations (host...
python
def explode(self, escalations): """Create instance of Escalation for each HostEscalation object :param escalations: list of escalation, used to add new ones :type escalations: alignak.objects.escalation.Escalations :return: None """ # Now we explode all escalations (host...
[ "def", "explode", "(", "self", ",", "escalations", ")", ":", "# Now we explode all escalations (host_name, hostgroup_name) to escalations", "for", "escalation", "in", "self", ":", "properties", "=", "escalation", ".", "__class__", ".", "properties", "name", "=", "getatt...
Create instance of Escalation for each HostEscalation object :param escalations: list of escalation, used to add new ones :type escalations: alignak.objects.escalation.Escalations :return: None
[ "Create", "instance", "of", "Escalation", "for", "each", "HostEscalation", "object" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostescalation.py#L109-L128
Alignak-monitoring/alignak
alignak/acknowledge.py
Acknowledge.serialize
def serialize(self): """This function serialize into a simple dict object. It is used when transferring data to other daemons over the network (http) Here we directly return all attributes :return: json representation of a Acknowledge :rtype: dict """ return {'u...
python
def serialize(self): """This function serialize into a simple dict object. It is used when transferring data to other daemons over the network (http) Here we directly return all attributes :return: json representation of a Acknowledge :rtype: dict """ return {'u...
[ "def", "serialize", "(", "self", ")", ":", "return", "{", "'uuid'", ":", "self", ".", "uuid", ",", "'ref'", ":", "self", ".", "ref", ",", "'sticky'", ":", "self", ".", "sticky", ",", "'notify'", ":", "self", ".", "notify", ",", "'end_time'", ":", "...
This function serialize into a simple dict object. It is used when transferring data to other daemons over the network (http) Here we directly return all attributes :return: json representation of a Acknowledge :rtype: dict
[ "This", "function", "serialize", "into", "a", "simple", "dict", "object", ".", "It", "is", "used", "when", "transferring", "data", "to", "other", "daemons", "over", "the", "network", "(", "http", ")" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/acknowledge.py#L94-L104
Alignak-monitoring/alignak
alignak/stats.py
Stats.register
def register(self, name, _type, statsd_host='localhost', statsd_port=8125, statsd_prefix='alignak', statsd_enabled=False, broks_enabled=False): """Init instance with real values :param name: daemon name :type name: str :param _type: daemon type :type _type: ...
python
def register(self, name, _type, statsd_host='localhost', statsd_port=8125, statsd_prefix='alignak', statsd_enabled=False, broks_enabled=False): """Init instance with real values :param name: daemon name :type name: str :param _type: daemon type :type _type: ...
[ "def", "register", "(", "self", ",", "name", ",", "_type", ",", "statsd_host", "=", "'localhost'", ",", "statsd_port", "=", "8125", ",", "statsd_prefix", "=", "'alignak'", ",", "statsd_enabled", "=", "False", ",", "broks_enabled", "=", "False", ")", ":", "...
Init instance with real values :param name: daemon name :type name: str :param _type: daemon type :type _type: :param statsd_host: host to post data :type statsd_host: str :param statsd_port: port to post data :type statsd_port: int :param statsd_...
[ "Init", "instance", "with", "real", "values" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/stats.py#L166-L222
Alignak-monitoring/alignak
alignak/stats.py
Stats.load_statsd
def load_statsd(self): """Create socket connection to statsd host Note that because of the UDP protocol used by StatsD, if no server is listening the socket connection will be accepted anyway :) :return: True if socket got created else False and an exception log is raised """ ...
python
def load_statsd(self): """Create socket connection to statsd host Note that because of the UDP protocol used by StatsD, if no server is listening the socket connection will be accepted anyway :) :return: True if socket got created else False and an exception log is raised """ ...
[ "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", "."...
Create socket connection to statsd host Note that because of the UDP protocol used by StatsD, if no server is listening the socket connection will be accepted anyway :) :return: True if socket got created else False and an exception log is raised
[ "Create", "socket", "connection", "to", "statsd", "host" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/stats.py#L224-L255
Alignak-monitoring/alignak
alignak/stats.py
Stats.connect
def connect(self, name, _type, host='localhost', port=2004, prefix='alignak', enabled=False, broks_enabled=False): """Init instance with real values for a graphite/carbon connection :param name: daemon name :type name: str :param _type: daemon type :type _type: ...
python
def connect(self, name, _type, host='localhost', port=2004, prefix='alignak', enabled=False, broks_enabled=False): """Init instance with real values for a graphite/carbon connection :param name: daemon name :type name: str :param _type: daemon type :type _type: ...
[ "def", "connect", "(", "self", ",", "name", ",", "_type", ",", "host", "=", "'localhost'", ",", "port", "=", "2004", ",", "prefix", "=", "'alignak'", ",", "enabled", "=", "False", ",", "broks_enabled", "=", "False", ")", ":", "self", ".", "name", "="...
Init instance with real values for a graphite/carbon connection :param name: daemon name :type name: str :param _type: daemon type :type _type: :param host: host to post data :type host: str :param port: port to post data :type port: int :param pr...
[ "Init", "instance", "with", "real", "values", "for", "a", "graphite", "/", "carbon", "connection" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/stats.py#L257-L306
Alignak-monitoring/alignak
alignak/stats.py
Stats.flush
def flush(self, log=False): """Send inner stored metrics to the defined Graphite Returns False if the sending failed with a warning log if log parameter is set :return: bool """ if not self.my_metrics: logger.debug("Flushing - no metrics to send") return...
python
def flush(self, log=False): """Send inner stored metrics to the defined Graphite Returns False if the sending failed with a warning log if log parameter is set :return: bool """ if not self.my_metrics: logger.debug("Flushing - no metrics to send") return...
[ "def", "flush", "(", "self", ",", "log", "=", "False", ")", ":", "if", "not", "self", ".", "my_metrics", ":", "logger", ".", "debug", "(", "\"Flushing - no metrics to send\"", ")", "return", "True", "now", "=", "int", "(", "time", ".", "time", "(", ")"...
Send inner stored metrics to the defined Graphite Returns False if the sending failed with a warning log if log parameter is set :return: bool
[ "Send", "inner", "stored", "metrics", "to", "the", "defined", "Graphite" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/stats.py#L308-L362
Alignak-monitoring/alignak
alignak/stats.py
Stats.send_to_graphite
def send_to_graphite(self, metric, value, timestamp=None): """ Inner store a new metric and flush to Graphite if the flush threshold is reached. If no timestamp is provided, get the current time for the metric timestam. :param metric: metric name in dotted format :type metric: ...
python
def send_to_graphite(self, metric, value, timestamp=None): """ Inner store a new metric and flush to Graphite if the flush threshold is reached. If no timestamp is provided, get the current time for the metric timestam. :param metric: metric name in dotted format :type metric: ...
[ "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", ...
Inner store a new metric and flush to Graphite if the flush threshold is reached. If no timestamp is provided, get the current time for the metric timestam. :param metric: metric name in dotted format :type metric: str :param value: :type value: float :param timestamp: ...
[ "Inner", "store", "a", "new", "metric", "and", "flush", "to", "Graphite", "if", "the", "flush", "threshold", "is", "reached", "." ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/stats.py#L364-L388
Alignak-monitoring/alignak
alignak/stats.py
Stats.counter
def counter(self, key, value, timestamp=None): """Set a counter value If the inner key does not exist is is created :param key: counter to update :type key: str :param value: counter value :type value: float :return: An alignak_stat brok if broks are enabled els...
python
def counter(self, key, value, timestamp=None): """Set a counter value If the inner key does not exist is is created :param key: counter to update :type key: str :param value: counter value :type value: float :return: An alignak_stat brok if broks are enabled els...
[ "def", "counter", "(", "self", ",", "key", ",", "value", ",", "timestamp", "=", "None", ")", ":", "_min", ",", "_max", ",", "count", ",", "_sum", "=", "self", ".", "stats", ".", "get", "(", "key", ",", "(", "None", ",", "None", ",", "0", ",", ...
Set a counter value If the inner key does not exist is is created :param key: counter to update :type key: str :param value: counter value :type value: float :return: An alignak_stat brok if broks are enabled else None
[ "Set", "a", "counter", "value" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/stats.py#L467-L536
Alignak-monitoring/alignak
alignak/satellite.py
BaseSatellite.get_managed_configurations
def get_managed_configurations(self): """Get the configurations managed by this satellite The configurations managed by a satellite is a list of the configuration attached to the schedulers related to the satellites. A broker linked to several schedulers will return the list of the conf...
python
def get_managed_configurations(self): """Get the configurations managed by this satellite The configurations managed by a satellite is a list of the configuration attached to the schedulers related to the satellites. A broker linked to several schedulers will return the list of the conf...
[ "def", "get_managed_configurations", "(", "self", ")", ":", "res", "=", "{", "}", "for", "scheduler_link", "in", "list", "(", "self", ".", "schedulers", ".", "values", "(", ")", ")", ":", "res", "[", "scheduler_link", ".", "instance_id", "]", "=", "{", ...
Get the configurations managed by this satellite The configurations managed by a satellite is a list of the configuration attached to the schedulers related to the satellites. A broker linked to several schedulers will return the list of the configuration parts of its scheduler links. ...
[ "Get", "the", "configurations", "managed", "by", "this", "satellite" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L132-L151
Alignak-monitoring/alignak
alignak/satellite.py
BaseSatellite.get_scheduler_from_hostname
def get_scheduler_from_hostname(self, host_name): """Get scheduler linked to the given host_name :param host_name: host_name we want the scheduler from :type host_name: str :return: scheduler with id corresponding to the mapping table :rtype: dict """ scheduler_u...
python
def get_scheduler_from_hostname(self, host_name): """Get scheduler linked to the given host_name :param host_name: host_name we want the scheduler from :type host_name: str :return: scheduler with id corresponding to the mapping table :rtype: dict """ scheduler_u...
[ "def", "get_scheduler_from_hostname", "(", "self", ",", "host_name", ")", ":", "scheduler_uuid", "=", "self", ".", "hosts_schedulers", ".", "get", "(", "host_name", ",", "None", ")", "return", "self", ".", "schedulers", ".", "get", "(", "scheduler_uuid", ",", ...
Get scheduler linked to the given host_name :param host_name: host_name we want the scheduler from :type host_name: str :return: scheduler with id corresponding to the mapping table :rtype: dict
[ "Get", "scheduler", "linked", "to", "the", "given", "host_name" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L153-L162
Alignak-monitoring/alignak
alignak/satellite.py
BaseSatellite.get_external_commands
def get_external_commands(self): """Get the external commands :return: External commands list :rtype: list """ res = self.external_commands logger.debug("Get and clear external commands list: %s", res) self.external_commands = [] return res
python
def get_external_commands(self): """Get the external commands :return: External commands list :rtype: list """ res = self.external_commands logger.debug("Get and clear external commands list: %s", res) self.external_commands = [] return res
[ "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 :return: External commands list :rtype: list
[ "Get", "the", "external", "commands" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L164-L173
Alignak-monitoring/alignak
alignak/satellite.py
BaseSatellite.get_results_from_passive
def get_results_from_passive(self, scheduler_instance_id): """Get executed actions results from a passive satellite for a specific scheduler :param scheduler_instance_id: scheduler id :type scheduler_instance_id: int :return: Results list :rtype: list """ # Do I ...
python
def get_results_from_passive(self, scheduler_instance_id): """Get executed actions results from a passive satellite for a specific scheduler :param scheduler_instance_id: scheduler id :type scheduler_instance_id: int :return: Results list :rtype: list """ # Do I ...
[ "def", "get_results_from_passive", "(", "self", ",", "scheduler_instance_id", ")", ":", "# Do I know this scheduler?", "# logger.info(\"My schedulers: %s %s\", self.schedulers, type(self.schedulers))", "if", "not", "self", ".", "schedulers", ":", "# Probably not yet configured ...", ...
Get executed actions results from a passive satellite for a specific scheduler :param scheduler_instance_id: scheduler id :type scheduler_instance_id: int :return: Results list :rtype: list
[ "Get", "executed", "actions", "results", "from", "a", "passive", "satellite", "for", "a", "specific", "scheduler" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L175-L203
Alignak-monitoring/alignak
alignak/satellite.py
BaseSatellite.clean_previous_run
def clean_previous_run(self): """Clean variables from previous configuration, such as schedulers, broks and external commands :return: None """ # Clean all lists self.arbiters.clear() self.schedulers.clear() with self.external_commands_lock: s...
python
def clean_previous_run(self): """Clean variables from previous configuration, such as schedulers, broks and external commands :return: None """ # Clean all lists self.arbiters.clear() self.schedulers.clear() with self.external_commands_lock: s...
[ "def", "clean_previous_run", "(", "self", ")", ":", "# Clean all lists", "self", ".", "arbiters", ".", "clear", "(", ")", "self", ".", "schedulers", ".", "clear", "(", ")", "with", "self", ".", "external_commands_lock", ":", "self", ".", "external_commands", ...
Clean variables from previous configuration, such as schedulers, broks and external commands :return: None
[ "Clean", "variables", "from", "previous", "configuration", "such", "as", "schedulers", "broks", "and", "external", "commands" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L205-L215
Alignak-monitoring/alignak
alignak/satellite.py
BaseSatellite.setup_new_conf
def setup_new_conf(self): # pylint: disable=too-many-locals, too-many-branches """Setup the new configuration received from Arbiter This function is the generic treatment needed for every Alignak daemon when it receivss a new configuration from the Arbiter: - save the new config...
python
def setup_new_conf(self): # pylint: disable=too-many-locals, too-many-branches """Setup the new configuration received from Arbiter This function is the generic treatment needed for every Alignak daemon when it receivss a new configuration from the Arbiter: - save the new config...
[ "def", "setup_new_conf", "(", "self", ")", ":", "# pylint: disable=too-many-locals, too-many-branches", "with", "self", ".", "conf_lock", ":", "# No more configuration now!", "self", ".", "have_conf", "=", "False", "logger", ".", "info", "(", "\"Received a new configurati...
Setup the new configuration received from Arbiter This function is the generic treatment needed for every Alignak daemon when it receivss a new configuration from the Arbiter: - save the new configuration - dump the main configuration elements - get its own configuration (self_c...
[ "Setup", "the", "new", "configuration", "received", "from", "Arbiter" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L221-L350
Alignak-monitoring/alignak
alignak/satellite.py
BaseSatellite.get_events
def get_events(self): """Get event list from satellite :return: A copy of the events list :rtype: list """ res = copy.copy(self.events) del self.events[:] return res
python
def get_events(self): """Get event list from satellite :return: A copy of the events list :rtype: list """ res = copy.copy(self.events) del self.events[:] return res
[ "def", "get_events", "(", "self", ")", ":", "res", "=", "copy", ".", "copy", "(", "self", ".", "events", ")", "del", "self", ".", "events", "[", ":", "]", "return", "res" ]
Get event list from satellite :return: A copy of the events list :rtype: list
[ "Get", "event", "list", "from", "satellite" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L352-L360
Alignak-monitoring/alignak
alignak/satellite.py
BaseSatellite.get_daemon_stats
def get_daemon_stats(self, details=False): """Increase the stats provided by the Daemon base class :return: stats dictionary :rtype: dict """ # call the daemon one res = super(BaseSatellite, self).get_daemon_stats(details=details) counters = res['counters'] ...
python
def get_daemon_stats(self, details=False): """Increase the stats provided by the Daemon base class :return: stats dictionary :rtype: dict """ # call the daemon one res = super(BaseSatellite, self).get_daemon_stats(details=details) counters = res['counters'] ...
[ "def", "get_daemon_stats", "(", "self", ",", "details", "=", "False", ")", ":", "# call the daemon one", "res", "=", "super", "(", "BaseSatellite", ",", "self", ")", ".", "get_daemon_stats", "(", "details", "=", "details", ")", "counters", "=", "res", "[", ...
Increase the stats provided by the Daemon base class :return: stats dictionary :rtype: dict
[ "Increase", "the", "stats", "provided", "by", "the", "Daemon", "base", "class" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L362-L376
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.manage_action_return
def manage_action_return(self, action): """Manage action return from Workers We just put them into the corresponding sched and we clean unused properties like my_scheduler :param action: the action to manage :type action: alignak.action.Action :return: None """ ...
python
def manage_action_return(self, action): """Manage action return from Workers We just put them into the corresponding sched and we clean unused properties like my_scheduler :param action: the action to manage :type action: alignak.action.Action :return: None """ ...
[ "def", "manage_action_return", "(", "self", ",", "action", ")", ":", "# Maybe our workers send us something else than an action", "# if so, just add this in other queues and return", "# todo: test a class instance", "if", "action", ".", "__class__", ".", "my_type", "not", "in", ...
Manage action return from Workers We just put them into the corresponding sched and we clean unused properties like my_scheduler :param action: the action to manage :type action: alignak.action.Action :return: None
[ "Manage", "action", "return", "from", "Workers", "We", "just", "put", "them", "into", "the", "corresponding", "sched", "and", "we", "clean", "unused", "properties", "like", "my_scheduler" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L462-L502
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.push_results
def push_results(self): """Push the checks/actions results to our schedulers :return: None """ # For all schedulers, we check for wait_homerun # and we send back results for scheduler_link_uuid in self.schedulers: scheduler_link = self.schedulers[scheduler_li...
python
def push_results(self): """Push the checks/actions results to our schedulers :return: None """ # For all schedulers, we check for wait_homerun # and we send back results for scheduler_link_uuid in self.schedulers: scheduler_link = self.schedulers[scheduler_li...
[ "def", "push_results", "(", "self", ")", ":", "# For all schedulers, we check for wait_homerun", "# and we send back results", "for", "scheduler_link_uuid", "in", "self", ".", "schedulers", ":", "scheduler_link", "=", "self", ".", "schedulers", "[", "scheduler_link_uuid", ...
Push the checks/actions results to our schedulers :return: None
[ "Push", "the", "checks", "/", "actions", "results", "to", "our", "schedulers" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L504-L538
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.create_and_launch_worker
def create_and_launch_worker(self, module_name='fork'): """Create and launch a new worker, and put it into self.workers It can be mortal or not :param module_name: the module name related to the worker default is "fork" for no module Inde...
python
def create_and_launch_worker(self, module_name='fork'): """Create and launch a new worker, and put it into self.workers It can be mortal or not :param module_name: the module name related to the worker default is "fork" for no module Inde...
[ "def", "create_and_launch_worker", "(", "self", ",", "module_name", "=", "'fork'", ")", ":", "logger", ".", "info", "(", "\"Allocating new '%s' worker...\"", ",", "module_name", ")", "# If we are in the fork module, we do not specify a target", "target", "=", "None", "__w...
Create and launch a new worker, and put it into self.workers It can be mortal or not :param module_name: the module name related to the worker default is "fork" for no module Indeed, it is actually the module 'python_name' :type module_na...
[ "Create", "and", "launch", "a", "new", "worker", "and", "put", "it", "into", "self", ".", "workers", "It", "can", "be", "mortal", "or", "not" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L540-L589
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.do_stop_workers
def do_stop_workers(self): """Stop all workers :return: None """ logger.info("Stopping all workers (%d)", len(self.workers)) for worker in list(self.workers.values()): try: logger.info(" - stopping '%s'", worker.get_id()) worker.termin...
python
def do_stop_workers(self): """Stop all workers :return: None """ logger.info("Stopping all workers (%d)", len(self.workers)) for worker in list(self.workers.values()): try: logger.info(" - stopping '%s'", worker.get_id()) worker.termin...
[ "def", "do_stop_workers", "(", "self", ")", ":", "logger", ".", "info", "(", "\"Stopping all workers (%d)\"", ",", "len", "(", "self", ".", "workers", ")", ")", "for", "worker", "in", "list", "(", "self", ".", "workers", ".", "values", "(", ")", ")", "...
Stop all workers :return: None
[ "Stop", "all", "workers" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L591-L607
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.get_broks
def get_broks(self): """Get brok list from satellite :return: A copy of the broks list :rtype: list """ res = copy.copy(self.broks) del self.broks[:] return res
python
def get_broks(self): """Get brok list from satellite :return: A copy of the broks list :rtype: list """ res = copy.copy(self.broks) del self.broks[:] return res
[ "def", "get_broks", "(", "self", ")", ":", "res", "=", "copy", ".", "copy", "(", "self", ".", "broks", ")", "del", "self", ".", "broks", "[", ":", "]", "return", "res" ]
Get brok list from satellite :return: A copy of the broks list :rtype: list
[ "Get", "brok", "list", "from", "satellite" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L644-L652
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.check_and_del_zombie_workers
def check_and_del_zombie_workers(self): # pragma: no cover, not with unit tests... # pylint: disable= not-callable """Check if worker are fine and kill them if not. Dispatch the actions in the worker to another one TODO: see if unit tests would allow to check this code? :retur...
python
def check_and_del_zombie_workers(self): # pragma: no cover, not with unit tests... # pylint: disable= not-callable """Check if worker are fine and kill them if not. Dispatch the actions in the worker to another one TODO: see if unit tests would allow to check this code? :retur...
[ "def", "check_and_del_zombie_workers", "(", "self", ")", ":", "# pragma: no cover, not with unit tests...", "# pylint: disable= not-callable", "# Active children make a join with everyone, useful :)", "# active_children()", "for", "p", "in", "active_children", "(", ")", ":", "logge...
Check if worker are fine and kill them if not. Dispatch the actions in the worker to another one TODO: see if unit tests would allow to check this code? :return: None
[ "Check", "if", "worker", "are", "fine", "and", "kill", "them", "if", "not", ".", "Dispatch", "the", "actions", "in", "the", "worker", "to", "another", "one" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L654-L699
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.adjust_worker_number_by_load
def adjust_worker_number_by_load(self): """Try to create the minimum workers specified in the configuration :return: None """ if self.interrupted: logger.debug("Trying to adjust worker number. Ignoring because we are stopping.") return to_del = [] ...
python
def adjust_worker_number_by_load(self): """Try to create the minimum workers specified in the configuration :return: None """ if self.interrupted: logger.debug("Trying to adjust worker number. Ignoring because we are stopping.") return to_del = [] ...
[ "def", "adjust_worker_number_by_load", "(", "self", ")", ":", "if", "self", ".", "interrupted", ":", "logger", ".", "debug", "(", "\"Trying to adjust worker number. Ignoring because we are stopping.\"", ")", "return", "to_del", "=", "[", "]", "logger", ".", "debug", ...
Try to create the minimum workers specified in the configuration :return: None
[ "Try", "to", "create", "the", "minimum", "workers", "specified", "in", "the", "configuration" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L701-L731
Alignak-monitoring/alignak
alignak/satellite.py
Satellite._get_queue_for_the_action
def _get_queue_for_the_action(self, action): """Find action queue for the action depending on the module. The id is found with action modulo on action id :param a: the action that need action queue to be assigned :type action: object :return: worker id and queue. (0, None) if no...
python
def _get_queue_for_the_action(self, action): """Find action queue for the action depending on the module. The id is found with action modulo on action id :param a: the action that need action queue to be assigned :type action: object :return: worker id and queue. (0, None) if no...
[ "def", "_get_queue_for_the_action", "(", "self", ",", "action", ")", ":", "# get the module name, if not, take fork", "mod", "=", "getattr", "(", "action", ",", "'module_type'", ",", "'fork'", ")", "queues", "=", "list", "(", "self", ".", "q_by_mod", "[", "mod",...
Find action queue for the action depending on the module. The id is found with action modulo on action id :param a: the action that need action queue to be assigned :type action: object :return: worker id and queue. (0, None) if no queue for the module_type :rtype: tuple
[ "Find", "action", "queue", "for", "the", "action", "depending", "on", "the", "module", ".", "The", "id", "is", "found", "with", "action", "modulo", "on", "action", "id" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L734-L757
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.add_actions
def add_actions(self, actions_list, scheduler_instance_id): """Add a list of actions to the satellite queues :param actions_list: Actions list to add :type actions_list: list :param scheduler_instance_id: sheduler link to assign the actions to :type scheduler_instance_id: Schedu...
python
def add_actions(self, actions_list, scheduler_instance_id): """Add a list of actions to the satellite queues :param actions_list: Actions list to add :type actions_list: list :param scheduler_instance_id: sheduler link to assign the actions to :type scheduler_instance_id: Schedu...
[ "def", "add_actions", "(", "self", ",", "actions_list", ",", "scheduler_instance_id", ")", ":", "# We check for new check in each schedulers and put the result in new_checks", "scheduler_link", "=", "None", "for", "scheduler_id", "in", "self", ".", "schedulers", ":", "logge...
Add a list of actions to the satellite queues :param actions_list: Actions list to add :type actions_list: list :param scheduler_instance_id: sheduler link to assign the actions to :type scheduler_instance_id: SchedulerLink :return: None
[ "Add", "a", "list", "of", "actions", "to", "the", "satellite", "queues" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L759-L802
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.assign_to_a_queue
def assign_to_a_queue(self, action): """Take an action and put it to a worker actions queue :param action: action to put :type action: alignak.action.Action :return: None """ (worker_id, queue) = self._get_queue_for_the_action(action) if not worker_id: ...
python
def assign_to_a_queue(self, action): """Take an action and put it to a worker actions queue :param action: action to put :type action: alignak.action.Action :return: None """ (worker_id, queue) = self._get_queue_for_the_action(action) if not worker_id: ...
[ "def", "assign_to_a_queue", "(", "self", ",", "action", ")", ":", "(", "worker_id", ",", "queue", ")", "=", "self", ".", "_get_queue_for_the_action", "(", "action", ")", "if", "not", "worker_id", ":", "return", "# Tag the action as \"in the worker i\"", "action", ...
Take an action and put it to a worker actions queue :param action: action to put :type action: alignak.action.Action :return: None
[ "Take", "an", "action", "and", "put", "it", "to", "a", "worker", "actions", "queue" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L804-L822
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.get_new_actions
def get_new_actions(self): """ Wrapper function for do_get_new_actions For stats purpose :return: None TODO: Use a decorator for timing this function """ try: _t0 = time.time() self.do_get_new_actions() statsmgr.timer('actions.got.time...
python
def get_new_actions(self): """ Wrapper function for do_get_new_actions For stats purpose :return: None TODO: Use a decorator for timing this function """ try: _t0 = time.time() self.do_get_new_actions() statsmgr.timer('actions.got.time...
[ "def", "get_new_actions", "(", "self", ")", ":", "try", ":", "_t0", "=", "time", ".", "time", "(", ")", "self", ".", "do_get_new_actions", "(", ")", "statsmgr", ".", "timer", "(", "'actions.got.time'", ",", "time", ".", "time", "(", ")", "-", "_t0", ...
Wrapper function for do_get_new_actions For stats purpose :return: None TODO: Use a decorator for timing this function
[ "Wrapper", "function", "for", "do_get_new_actions", "For", "stats", "purpose" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L824-L836
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.do_get_new_actions
def do_get_new_actions(self): """Get new actions from schedulers Create a Message and put into the module queue REF: doc/alignak-action-queues.png (1) :return: None """ # Here are the differences between a poller and a reactionner: # Poller will only do checks, ...
python
def do_get_new_actions(self): """Get new actions from schedulers Create a Message and put into the module queue REF: doc/alignak-action-queues.png (1) :return: None """ # Here are the differences between a poller and a reactionner: # Poller will only do checks, ...
[ "def", "do_get_new_actions", "(", "self", ")", ":", "# Here are the differences between a poller and a reactionner:", "# Poller will only do checks,", "# Reactionner will do actions (notifications and event handlers)", "do_checks", "=", "self", ".", "__class__", ".", "do_checks", "do...
Get new actions from schedulers Create a Message and put into the module queue REF: doc/alignak-action-queues.png (1) :return: None
[ "Get", "new", "actions", "from", "schedulers", "Create", "a", "Message", "and", "put", "into", "the", "module", "queue", "REF", ":", "doc", "/", "alignak", "-", "action", "-", "queues", ".", "png", "(", "1", ")" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L838-L874
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.clean_previous_run
def clean_previous_run(self): """Clean variables from previous configuration, such as schedulers, broks and external commands :return: None """ # Execute the base class treatment... super(Satellite, self).clean_previous_run() # Clean my lists del self.br...
python
def clean_previous_run(self): """Clean variables from previous configuration, such as schedulers, broks and external commands :return: None """ # Execute the base class treatment... super(Satellite, self).clean_previous_run() # Clean my lists del self.br...
[ "def", "clean_previous_run", "(", "self", ")", ":", "# Execute the base class treatment...", "super", "(", "Satellite", ",", "self", ")", ".", "clean_previous_run", "(", ")", "# Clean my lists", "del", "self", ".", "broks", "[", ":", "]", "del", "self", ".", "...
Clean variables from previous configuration, such as schedulers, broks and external commands :return: None
[ "Clean", "variables", "from", "previous", "configuration", "such", "as", "schedulers", "broks", "and", "external", "commands" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L876-L887
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.do_loop_turn
def do_loop_turn(self): # pylint: disable=too-many-branches """Satellite main loop:: * Check and delete zombies actions / modules * Get returns from queues * Adjust worker number * Get new actions :return: None """ # Try to see if one of my module is de...
python
def do_loop_turn(self): # pylint: disable=too-many-branches """Satellite main loop:: * Check and delete zombies actions / modules * Get returns from queues * Adjust worker number * Get new actions :return: None """ # Try to see if one of my module is de...
[ "def", "do_loop_turn", "(", "self", ")", ":", "# pylint: disable=too-many-branches", "# Try to see if one of my module is dead, and restart previously dead modules", "self", ".", "check_and_del_zombie_modules", "(", ")", "# Also if some zombie workers exist...", "self", ".", "check_a...
Satellite main loop:: * Check and delete zombies actions / modules * Get returns from queues * Adjust worker number * Get new actions :return: None
[ "Satellite", "main", "loop", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L889-L1017
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.setup_new_conf
def setup_new_conf(self): # pylint: disable=too-many-branches """Setup the new configuration received from Arbiter This function calls the base satellite treatment and manages the configuration needed for a simple satellite daemon that executes some actions (eg. poller or reactionner): ...
python
def setup_new_conf(self): # pylint: disable=too-many-branches """Setup the new configuration received from Arbiter This function calls the base satellite treatment and manages the configuration needed for a simple satellite daemon that executes some actions (eg. poller or reactionner): ...
[ "def", "setup_new_conf", "(", "self", ")", ":", "# pylint: disable=too-many-branches", "# Execute the base class treatment...", "super", "(", "Satellite", ",", "self", ")", ".", "setup_new_conf", "(", ")", "# ...then our own specific treatment!", "with", "self", ".", "con...
Setup the new configuration received from Arbiter This function calls the base satellite treatment and manages the configuration needed for a simple satellite daemon that executes some actions (eg. poller or reactionner): - configure the passive mode - configure the workers - co...
[ "Setup", "the", "new", "configuration", "received", "from", "Arbiter" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L1030-L1083
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.get_daemon_stats
def get_daemon_stats(self, details=False): """Increase the stats provided by the Daemon base class :return: stats dictionary :rtype: dict """ # call the daemon one res = super(Satellite, self).get_daemon_stats(details=details) counters = res['counters'] ...
python
def get_daemon_stats(self, details=False): """Increase the stats provided by the Daemon base class :return: stats dictionary :rtype: dict """ # call the daemon one res = super(Satellite, self).get_daemon_stats(details=details) counters = res['counters'] ...
[ "def", "get_daemon_stats", "(", "self", ",", "details", "=", "False", ")", ":", "# call the daemon one", "res", "=", "super", "(", "Satellite", ",", "self", ")", ".", "get_daemon_stats", "(", "details", "=", "details", ")", "counters", "=", "res", "[", "'c...
Increase the stats provided by the Daemon base class :return: stats dictionary :rtype: dict
[ "Increase", "the", "stats", "provided", "by", "the", "Daemon", "base", "class" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L1085-L1106
Alignak-monitoring/alignak
alignak/satellite.py
Satellite.main
def main(self): """Main satellite function. Do init and then mainloop :return: None """ try: # Start the daemon mode if not self.do_daemon_init_and_start(): self.exit_on_error(message="Daemon initialization error", exit_code=3) self.d...
python
def main(self): """Main satellite function. Do init and then mainloop :return: None """ try: # Start the daemon mode if not self.do_daemon_init_and_start(): self.exit_on_error(message="Daemon initialization error", exit_code=3) self.d...
[ "def", "main", "(", "self", ")", ":", "try", ":", "# Start the daemon mode", "if", "not", "self", ".", "do_daemon_init_and_start", "(", ")", ":", "self", ".", "exit_on_error", "(", "message", "=", "\"Daemon initialization error\"", ",", "exit_code", "=", "3", ...
Main satellite function. Do init and then mainloop :return: None
[ "Main", "satellite", "function", ".", "Do", "init", "and", "then", "mainloop" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/satellite.py#L1108-L1136
Alignak-monitoring/alignak
alignak/contactdowntime.py
ContactDowntime.check_activation
def check_activation(self, contacts): """Enter or exit downtime if necessary :return: None """ now = time.time() was_is_in_effect = self.is_in_effect self.is_in_effect = (self.start_time <= now <= self.end_time) # Raise a log entry when we get in the downtime ...
python
def check_activation(self, contacts): """Enter or exit downtime if necessary :return: None """ now = time.time() was_is_in_effect = self.is_in_effect self.is_in_effect = (self.start_time <= now <= self.end_time) # Raise a log entry when we get in the downtime ...
[ "def", "check_activation", "(", "self", ",", "contacts", ")", ":", "now", "=", "time", ".", "time", "(", ")", "was_is_in_effect", "=", "self", ".", "is_in_effect", "self", ".", "is_in_effect", "=", "(", "self", ".", "start_time", "<=", "now", "<=", "self...
Enter or exit downtime if necessary :return: None
[ "Enter", "or", "exit", "downtime", "if", "necessary" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/contactdowntime.py#L90-L105
Alignak-monitoring/alignak
alignak/contactdowntime.py
ContactDowntime.exit
def exit(self, contacts): """Wrapper to call raise_exit_downtime_log_entry for ref (host/service) set can_be_deleted to True :return: None """ contact = contacts[self.ref] contact.raise_exit_downtime_log_entry() self.can_be_deleted = True
python
def exit(self, contacts): """Wrapper to call raise_exit_downtime_log_entry for ref (host/service) set can_be_deleted to True :return: None """ contact = contacts[self.ref] contact.raise_exit_downtime_log_entry() self.can_be_deleted = True
[ "def", "exit", "(", "self", ",", "contacts", ")", ":", "contact", "=", "contacts", "[", "self", ".", "ref", "]", "contact", ".", "raise_exit_downtime_log_entry", "(", ")", "self", ".", "can_be_deleted", "=", "True" ]
Wrapper to call raise_exit_downtime_log_entry for ref (host/service) set can_be_deleted to True :return: None
[ "Wrapper", "to", "call", "raise_exit_downtime_log_entry", "for", "ref", "(", "host", "/", "service", ")", "set", "can_be_deleted", "to", "True" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/contactdowntime.py#L123-L131
Alignak-monitoring/alignak
alignak/contactdowntime.py
ContactDowntime.cancel
def cancel(self, contacts): """Wrapper to call raise_cancel_downtime_log_entry for ref (host/service) set can_be_deleted to True set is_in_effect to False :return: None """ self.is_in_effect = False contact = contacts[self.ref] contact.raise_cancel_downti...
python
def cancel(self, contacts): """Wrapper to call raise_cancel_downtime_log_entry for ref (host/service) set can_be_deleted to True set is_in_effect to False :return: None """ self.is_in_effect = False contact = contacts[self.ref] contact.raise_cancel_downti...
[ "def", "cancel", "(", "self", ",", "contacts", ")", ":", "self", ".", "is_in_effect", "=", "False", "contact", "=", "contacts", "[", "self", ".", "ref", "]", "contact", ".", "raise_cancel_downtime_log_entry", "(", ")", "self", ".", "can_be_deleted", "=", "...
Wrapper to call raise_cancel_downtime_log_entry for ref (host/service) set can_be_deleted to True set is_in_effect to False :return: None
[ "Wrapper", "to", "call", "raise_cancel_downtime_log_entry", "for", "ref", "(", "host", "/", "service", ")", "set", "can_be_deleted", "to", "True", "set", "is_in_effect", "to", "False" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/contactdowntime.py#L133-L143
Alignak-monitoring/alignak
alignak/util.py
split_semicolon
def split_semicolon(line, maxsplit=None): r"""Split a line on semicolons characters but not on the escaped semicolons :param line: line to split :type line: str :param maxsplit: maximal number of split (if None, no limit) :type maxsplit: None | int :return: split line :rtype: list >>> ...
python
def split_semicolon(line, maxsplit=None): r"""Split a line on semicolons characters but not on the escaped semicolons :param line: line to split :type line: str :param maxsplit: maximal number of split (if None, no limit) :type maxsplit: None | int :return: split line :rtype: list >>> ...
[ "def", "split_semicolon", "(", "line", ",", "maxsplit", "=", "None", ")", ":", "# Split on ';' character", "split_line", "=", "line", ".", "split", "(", "';'", ")", "split_line_size", "=", "len", "(", "split_line", ")", "# if maxsplit is not specified, we set it to ...
r"""Split a line on semicolons characters but not on the escaped semicolons :param line: line to split :type line: str :param maxsplit: maximal number of split (if None, no limit) :type maxsplit: None | int :return: split line :rtype: list >>> split_semicolon('a,b;c;;g') ['a,b', 'c', '...
[ "r", "Split", "a", "line", "on", "semicolons", "characters", "but", "not", "on", "the", "escaped", "semicolons" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L110-L165
Alignak-monitoring/alignak
alignak/util.py
jsonify_r
def jsonify_r(obj): # pragma: no cover, not for unit tests... # pylint: disable=too-many-branches """Convert an object into json (recursively on attribute) :param obj: obj to jsonify :type obj: object :return: json representation of obj :rtype: dict """ res = {} cls = obj.__class__...
python
def jsonify_r(obj): # pragma: no cover, not for unit tests... # pylint: disable=too-many-branches """Convert an object into json (recursively on attribute) :param obj: obj to jsonify :type obj: object :return: json representation of obj :rtype: dict """ res = {} cls = obj.__class__...
[ "def", "jsonify_r", "(", "obj", ")", ":", "# pragma: no cover, not for unit tests...", "# pylint: disable=too-many-branches", "res", "=", "{", "}", "cls", "=", "obj", ".", "__class__", "if", "not", "hasattr", "(", "cls", ",", "'properties'", ")", ":", "try", ":"...
Convert an object into json (recursively on attribute) :param obj: obj to jsonify :type obj: object :return: json representation of obj :rtype: dict
[ "Convert", "an", "object", "into", "json", "(", "recursively", "on", "attribute", ")" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L168-L226
Alignak-monitoring/alignak
alignak/util.py
format_t_into_dhms_format
def format_t_into_dhms_format(timestamp): """ Convert an amount of second into day, hour, min and sec :param timestamp: seconds :type timestamp: int :return: 'Ad Bh Cm Ds' :rtype: str >>> format_t_into_dhms_format(456189) '5d 6h 43m 9s' >>> format_t_into_dhms_format(3600) '0d 1h 0...
python
def format_t_into_dhms_format(timestamp): """ Convert an amount of second into day, hour, min and sec :param timestamp: seconds :type timestamp: int :return: 'Ad Bh Cm Ds' :rtype: str >>> format_t_into_dhms_format(456189) '5d 6h 43m 9s' >>> format_t_into_dhms_format(3600) '0d 1h 0...
[ "def", "format_t_into_dhms_format", "(", "timestamp", ")", ":", "mins", ",", "timestamp", "=", "divmod", "(", "timestamp", ",", "60", ")", "hour", ",", "mins", "=", "divmod", "(", "mins", ",", "60", ")", "day", ",", "hour", "=", "divmod", "(", "hour", ...
Convert an amount of second into day, hour, min and sec :param timestamp: seconds :type timestamp: int :return: 'Ad Bh Cm Ds' :rtype: str >>> format_t_into_dhms_format(456189) '5d 6h 43m 9s' >>> format_t_into_dhms_format(3600) '0d 1h 0m 0s'
[ "Convert", "an", "amount", "of", "second", "into", "day", "hour", "min", "and", "sec" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L230-L248
Alignak-monitoring/alignak
alignak/util.py
merge_periods
def merge_periods(data): """ Merge periods to have better continous periods. Like 350-450, 400-600 => 350-600 :param data: list of periods :type data: list :return: better continous periods :rtype: list """ # sort by start date newdata = sorted(data, key=lambda drange: drange[0]...
python
def merge_periods(data): """ Merge periods to have better continous periods. Like 350-450, 400-600 => 350-600 :param data: list of periods :type data: list :return: better continous periods :rtype: list """ # sort by start date newdata = sorted(data, key=lambda drange: drange[0]...
[ "def", "merge_periods", "(", "data", ")", ":", "# sort by start date", "newdata", "=", "sorted", "(", "data", ",", "key", "=", "lambda", "drange", ":", "drange", "[", "0", "]", ")", "end", "=", "0", "for", "period", "in", "newdata", ":", "if", "period"...
Merge periods to have better continous periods. Like 350-450, 400-600 => 350-600 :param data: list of periods :type data: list :return: better continous periods :rtype: list
[ "Merge", "periods", "to", "have", "better", "continous", "periods", ".", "Like", "350", "-", "450", "400", "-", "600", "=", ">", "350", "-", "600" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L251-L289
Alignak-monitoring/alignak
alignak/util.py
to_split
def to_split(val, split_on_comma=True): """Try to split a string with comma separator. If val is already a list return it If we don't have to split just return [val] If split gives only [''] empty it :param val: value to split :type val: :param split_on_comma: :type split_on_comma: bool...
python
def to_split(val, split_on_comma=True): """Try to split a string with comma separator. If val is already a list return it If we don't have to split just return [val] If split gives only [''] empty it :param val: value to split :type val: :param split_on_comma: :type split_on_comma: bool...
[ "def", "to_split", "(", "val", ",", "split_on_comma", "=", "True", ")", ":", "if", "isinstance", "(", "val", ",", "list", ")", ":", "return", "val", "if", "not", "split_on_comma", ":", "return", "[", "val", "]", "val", "=", "val", ".", "split", "(", ...
Try to split a string with comma separator. If val is already a list return it If we don't have to split just return [val] If split gives only [''] empty it :param val: value to split :type val: :param split_on_comma: :type split_on_comma: bool :return: split value on comma :rtype: ...
[ "Try", "to", "split", "a", "string", "with", "comma", "separator", ".", "If", "val", "is", "already", "a", "list", "return", "it", "If", "we", "don", "t", "have", "to", "split", "just", "return", "[", "val", "]", "If", "split", "gives", "only", "[", ...
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L329-L361
Alignak-monitoring/alignak
alignak/util.py
list_split
def list_split(val, split_on_comma=True): """Try to split each member of a list with comma separator. If we don't have to split just return val :param val: value to split :type val: :param split_on_comma: :type split_on_comma: bool :return: list with members split on comma :rtype: list ...
python
def list_split(val, split_on_comma=True): """Try to split each member of a list with comma separator. If we don't have to split just return val :param val: value to split :type val: :param split_on_comma: :type split_on_comma: bool :return: list with members split on comma :rtype: list ...
[ "def", "list_split", "(", "val", ",", "split_on_comma", "=", "True", ")", ":", "if", "not", "split_on_comma", ":", "return", "val", "new_val", "=", "[", "]", "for", "subval", "in", "val", ":", "# This may happen when re-serializing", "if", "isinstance", "(", ...
Try to split each member of a list with comma separator. If we don't have to split just return val :param val: value to split :type val: :param split_on_comma: :type split_on_comma: bool :return: list with members split on comma :rtype: list >>> list_split(['a,b,c'], False) ['a,b,c...
[ "Try", "to", "split", "each", "member", "of", "a", "list", "with", "comma", "separator", ".", "If", "we", "don", "t", "have", "to", "split", "just", "return", "val" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L364-L393
Alignak-monitoring/alignak
alignak/util.py
to_best_int_float
def to_best_int_float(val): """Get best type for value between int and float :param val: value :type val: :return: int(float(val)) if int(float(val)) == float(val), else float(val) :rtype: int | float >>> to_best_int_float("20.1") 20.1 >>> to_best_int_float("20.0") 20 >>> to_...
python
def to_best_int_float(val): """Get best type for value between int and float :param val: value :type val: :return: int(float(val)) if int(float(val)) == float(val), else float(val) :rtype: int | float >>> to_best_int_float("20.1") 20.1 >>> to_best_int_float("20.0") 20 >>> to_...
[ "def", "to_best_int_float", "(", "val", ")", ":", "integer", "=", "int", "(", "float", "(", "val", ")", ")", "flt", "=", "float", "(", "val", ")", "# If the f is a .0 value,", "# best match is int", "if", "integer", "==", "flt", ":", "return", "integer", "...
Get best type for value between int and float :param val: value :type val: :return: int(float(val)) if int(float(val)) == float(val), else float(val) :rtype: int | float >>> to_best_int_float("20.1") 20.1 >>> to_best_int_float("20.0") 20 >>> to_best_int_float("20") 20
[ "Get", "best", "type", "for", "value", "between", "int", "and", "float" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L396-L419
Alignak-monitoring/alignak
alignak/util.py
dict_to_serialized_dict
def dict_to_serialized_dict(ref, the_dict): """Serialize the list of elements to a dictionary Used for the retention store :param ref: Not used :type ref: :param the_dict: dictionary to convert :type the_dict: dict :return: dict of serialized :rtype: dict """ result = {} fo...
python
def dict_to_serialized_dict(ref, the_dict): """Serialize the list of elements to a dictionary Used for the retention store :param ref: Not used :type ref: :param the_dict: dictionary to convert :type the_dict: dict :return: dict of serialized :rtype: dict """ result = {} fo...
[ "def", "dict_to_serialized_dict", "(", "ref", ",", "the_dict", ")", ":", "result", "=", "{", "}", "for", "elt", "in", "list", "(", "the_dict", ".", "values", "(", ")", ")", ":", "if", "not", "getattr", "(", "elt", ",", "'serialize'", ",", "None", ")"...
Serialize the list of elements to a dictionary Used for the retention store :param ref: Not used :type ref: :param the_dict: dictionary to convert :type the_dict: dict :return: dict of serialized :rtype: dict
[ "Serialize", "the", "list", "of", "elements", "to", "a", "dictionary" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L587-L604
Alignak-monitoring/alignak
alignak/util.py
list_to_serialized
def list_to_serialized(ref, the_list): """Serialize the list of elements Used for the retention store :param ref: Not used :type ref: :param the_list: dictionary to convert :type the_list: dict :return: dict of serialized :rtype: dict """ result = [] for elt in the_list: ...
python
def list_to_serialized(ref, the_list): """Serialize the list of elements Used for the retention store :param ref: Not used :type ref: :param the_list: dictionary to convert :type the_list: dict :return: dict of serialized :rtype: dict """ result = [] for elt in the_list: ...
[ "def", "list_to_serialized", "(", "ref", ",", "the_list", ")", ":", "result", "=", "[", "]", "for", "elt", "in", "the_list", ":", "if", "not", "getattr", "(", "elt", ",", "'serialize'", ",", "None", ")", ":", "continue", "result", ".", "append", "(", ...
Serialize the list of elements Used for the retention store :param ref: Not used :type ref: :param the_list: dictionary to convert :type the_list: dict :return: dict of serialized :rtype: dict
[ "Serialize", "the", "list", "of", "elements" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L607-L624
Alignak-monitoring/alignak
alignak/util.py
to_hostnames_list
def to_hostnames_list(ref, tab): # pragma: no cover, to be deprecated? """Convert Host list into a list of host_name :param ref: Not used :type ref: :param tab: Host list :type tab: list[alignak.objects.host.Host] :return: host_name list :rtype: list """ res = [] for host in t...
python
def to_hostnames_list(ref, tab): # pragma: no cover, to be deprecated? """Convert Host list into a list of host_name :param ref: Not used :type ref: :param tab: Host list :type tab: list[alignak.objects.host.Host] :return: host_name list :rtype: list """ res = [] for host in t...
[ "def", "to_hostnames_list", "(", "ref", ",", "tab", ")", ":", "# pragma: no cover, to be deprecated?", "res", "=", "[", "]", "for", "host", "in", "tab", ":", "if", "hasattr", "(", "host", ",", "'host_name'", ")", ":", "res", ".", "append", "(", "host", "...
Convert Host list into a list of host_name :param ref: Not used :type ref: :param tab: Host list :type tab: list[alignak.objects.host.Host] :return: host_name list :rtype: list
[ "Convert", "Host", "list", "into", "a", "list", "of", "host_name" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L642-L656
Alignak-monitoring/alignak
alignak/util.py
to_svc_hst_distinct_lists
def to_svc_hst_distinct_lists(ref, tab): # pragma: no cover, to be deprecated? """create a dict with 2 lists:: * services: all services of the tab * hosts: all hosts of the tab :param ref: Not used :type ref: :param tab: list of Host and Service :type tab: list :return: dict with host...
python
def to_svc_hst_distinct_lists(ref, tab): # pragma: no cover, to be deprecated? """create a dict with 2 lists:: * services: all services of the tab * hosts: all hosts of the tab :param ref: Not used :type ref: :param tab: list of Host and Service :type tab: list :return: dict with host...
[ "def", "to_svc_hst_distinct_lists", "(", "ref", ",", "tab", ")", ":", "# pragma: no cover, to be deprecated?", "res", "=", "{", "'hosts'", ":", "[", "]", ",", "'services'", ":", "[", "]", "}", "for", "elem", "in", "tab", ":", "cls", "=", "elem", ".", "__...
create a dict with 2 lists:: * services: all services of the tab * hosts: all hosts of the tab :param ref: Not used :type ref: :param tab: list of Host and Service :type tab: list :return: dict with hosts and services names :rtype: dict
[ "create", "a", "dict", "with", "2", "lists", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L659-L680
Alignak-monitoring/alignak
alignak/util.py
master_then_spare
def master_then_spare(data): """Return the provided satellites list sorted as: - alive first, - then spare - then dead satellites. :param data: the SatelliteLink list :type data: list :return: sorted list :rtype: list """ master = [] spare = [] for sd...
python
def master_then_spare(data): """Return the provided satellites list sorted as: - alive first, - then spare - then dead satellites. :param data: the SatelliteLink list :type data: list :return: sorted list :rtype: list """ master = [] spare = [] for sd...
[ "def", "master_then_spare", "(", "data", ")", ":", "master", "=", "[", "]", "spare", "=", "[", "]", "for", "sdata", "in", "data", ":", "if", "sdata", ".", "spare", ":", "spare", ".", "append", "(", "sdata", ")", "else", ":", "master", ".", "append"...
Return the provided satellites list sorted as: - alive first, - then spare - then dead satellites. :param data: the SatelliteLink list :type data: list :return: sorted list :rtype: list
[ "Return", "the", "provided", "satellites", "list", "sorted", "as", ":", "-", "alive", "first", "-", "then", "spare", "-", "then", "dead", "satellites", "." ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L713-L735
Alignak-monitoring/alignak
alignak/util.py
sort_by_number_values
def sort_by_number_values(x00, y00): # pragma: no cover, looks like not used! """Compare x00, y00 base on number of values :param x00: first elem to compare :type x00: list :param y00: second elem to compare :type y00: list :return: x00 > y00 (-1) if len(x00) > len(y00), x00 == y00 (0) if id e...
python
def sort_by_number_values(x00, y00): # pragma: no cover, looks like not used! """Compare x00, y00 base on number of values :param x00: first elem to compare :type x00: list :param y00: second elem to compare :type y00: list :return: x00 > y00 (-1) if len(x00) > len(y00), x00 == y00 (0) if id e...
[ "def", "sort_by_number_values", "(", "x00", ",", "y00", ")", ":", "# pragma: no cover, looks like not used!", "if", "len", "(", "x00", ")", "<", "len", "(", "y00", ")", ":", "return", "1", "if", "len", "(", "x00", ")", ">", "len", "(", "y00", ")", ":",...
Compare x00, y00 base on number of values :param x00: first elem to compare :type x00: list :param y00: second elem to compare :type y00: list :return: x00 > y00 (-1) if len(x00) > len(y00), x00 == y00 (0) if id equals, x00 < y00 (1) else :rtype: int
[ "Compare", "x00", "y00", "base", "on", "number", "of", "values" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L738-L753
Alignak-monitoring/alignak
alignak/util.py
average_percentile
def average_percentile(values): """ Get the average, min percentile (5%) and max percentile (95%) of a list of values. :param values: list of value to compute :type values: list :return: tuple containing average, min and max value :rtype: tuple """ if not values: return None...
python
def average_percentile(values): """ Get the average, min percentile (5%) and max percentile (95%) of a list of values. :param values: list of value to compute :type values: list :return: tuple containing average, min and max value :rtype: tuple """ if not values: return None...
[ "def", "average_percentile", "(", "values", ")", ":", "if", "not", "values", ":", "return", "None", ",", "None", ",", "None", "value_avg", "=", "round", "(", "float", "(", "sum", "(", "values", ")", ")", "/", "len", "(", "values", ")", ",", "2", ")...
Get the average, min percentile (5%) and max percentile (95%) of a list of values. :param values: list of value to compute :type values: list :return: tuple containing average, min and max value :rtype: tuple
[ "Get", "the", "average", "min", "percentile", "(", "5%", ")", "and", "max", "percentile", "(", "95%", ")", "of", "a", "list", "of", "values", "." ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L757-L773
Alignak-monitoring/alignak
alignak/util.py
strip_and_uniq
def strip_and_uniq(tab): """Strip every element of a list and keep a list of ordered unique values :param tab: list to strip :type tab: list :return: stripped list with unique values :rtype: list """ _list = [] for elt in tab: val = elt.strip() if val and val not in _lis...
python
def strip_and_uniq(tab): """Strip every element of a list and keep a list of ordered unique values :param tab: list to strip :type tab: list :return: stripped list with unique values :rtype: list """ _list = [] for elt in tab: val = elt.strip() if val and val not in _lis...
[ "def", "strip_and_uniq", "(", "tab", ")", ":", "_list", "=", "[", "]", "for", "elt", "in", "tab", ":", "val", "=", "elt", ".", "strip", "(", ")", "if", "val", "and", "val", "not", "in", "_list", ":", "_list", ".", "append", "(", "val", ")", "re...
Strip every element of a list and keep a list of ordered unique values :param tab: list to strip :type tab: list :return: stripped list with unique values :rtype: list
[ "Strip", "every", "element", "of", "a", "list", "and", "keep", "a", "list", "of", "ordered", "unique", "values" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L777-L790
Alignak-monitoring/alignak
alignak/util.py
expand_ranges
def expand_ranges(value): """ :param str value: The value to be "expanded". :return: A generator to yield the different resulting values from expanding the eventual ranges present in the input value. >>> tuple(expand_ranges("Item [1-3] - Bla")) ('Item 1 - Bla', 'Item 2 - Bla', 'Item 3 ...
python
def expand_ranges(value): """ :param str value: The value to be "expanded". :return: A generator to yield the different resulting values from expanding the eventual ranges present in the input value. >>> tuple(expand_ranges("Item [1-3] - Bla")) ('Item 1 - Bla', 'Item 2 - Bla', 'Item 3 ...
[ "def", "expand_ranges", "(", "value", ")", ":", "match_dict", "=", "RANGE_REGEX", ".", "match", "(", "value", ")", ".", "groupdict", "(", ")", "# the regex is supposed to always match..", "before", "=", "match_dict", "[", "'before'", "]", "after", "=", "match_di...
:param str value: The value to be "expanded". :return: A generator to yield the different resulting values from expanding the eventual ranges present in the input value. >>> tuple(expand_ranges("Item [1-3] - Bla")) ('Item 1 - Bla', 'Item 2 - Bla', 'Item 3 - Bla') >>> tuple(expand_ranges("X...
[ ":", "param", "str", "value", ":", "The", "value", "to", "be", "expanded", ".", ":", "return", ":", "A", "generator", "to", "yield", "the", "different", "resulting", "values", "from", "expanding", "the", "eventual", "ranges", "present", "in", "the", "input...
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L829-L856
Alignak-monitoring/alignak
alignak/util.py
generate_key_value_sequences
def generate_key_value_sequences(entry, default_value): """Parse a key value config entry (used in duplicate foreach) If we have a key that look like [X-Y] we will expand it into Y-X+1 keys :param str entry: The config line to be parsed. :param str default_value: The default value to be used when none...
python
def generate_key_value_sequences(entry, default_value): """Parse a key value config entry (used in duplicate foreach) If we have a key that look like [X-Y] we will expand it into Y-X+1 keys :param str entry: The config line to be parsed. :param str default_value: The default value to be used when none...
[ "def", "generate_key_value_sequences", "(", "entry", ",", "default_value", ")", ":", "no_one_yielded", "=", "True", "for", "value", "in", "entry", ".", "split", "(", "','", ")", ":", "value", "=", "value", ".", "strip", "(", ")", "if", "not", "value", ":...
Parse a key value config entry (used in duplicate foreach) If we have a key that look like [X-Y] we will expand it into Y-X+1 keys :param str entry: The config line to be parsed. :param str default_value: The default value to be used when none is available. :return: a generator yielding dicts with 'KE...
[ "Parse", "a", "key", "value", "config", "entry", "(", "used", "in", "duplicate", "foreach", ")" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L859-L898
Alignak-monitoring/alignak
alignak/util.py
filter_host_by_name
def filter_host_by_name(name): """Filter for host Filter on name :param name: name to filter :type name: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for host. Accept if host_name == name""" host = items["host"] if host is None: ...
python
def filter_host_by_name(name): """Filter for host Filter on name :param name: name to filter :type name: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for host. Accept if host_name == name""" host = items["host"] if host is None: ...
[ "def", "filter_host_by_name", "(", "name", ")", ":", "def", "inner_filter", "(", "items", ")", ":", "\"\"\"Inner filter for host. Accept if host_name == name\"\"\"", "host", "=", "items", "[", "\"host\"", "]", "if", "host", "is", "None", ":", "return", "False", "r...
Filter for host Filter on name :param name: name to filter :type name: str :return: Filter :rtype: bool
[ "Filter", "for", "host", "Filter", "on", "name" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L938-L955