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_documentation_string stringlengths 1 47.2k | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|
Alignak-monitoring/alignak | alignak/eventhandler.py | EventHandler.get_return_from | def get_return_from(self, e_handler):
"""Setter of the following attributes::
* exit_status
* output
* long_output
* check_time
* execution_time
* perf_data
:param e_handler: event handler to get data from
:type e_handler: alignak.eventhandler.Ev... | python | def get_return_from(self, e_handler):
"""Setter of the following attributes::
* exit_status
* output
* long_output
* check_time
* execution_time
* perf_data
:param e_handler: event handler to get data from
:type e_handler: alignak.eventhandler.Ev... | Setter of the following attributes::
* exit_status
* output
* long_output
* check_time
* execution_time
* perf_data
:param e_handler: event handler to get data from
:type e_handler: alignak.eventhandler.EventHandler
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/eventhandler.py#L90-L106 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.add_flapping_change | def add_flapping_change(self, sample):
"""Add a flapping sample and keep cls.flap_history samples
:param sample: Sample to add
:type sample: bool
:return: None
"""
cls = self.__class__
# If this element is not in flapping check, or
# the flapping is glob... | python | def add_flapping_change(self, sample):
"""Add a flapping sample and keep cls.flap_history samples
:param sample: Sample to add
:type sample: bool
:return: None
"""
cls = self.__class__
# If this element is not in flapping check, or
# the flapping is glob... | Add a flapping sample and keep cls.flap_history samples
:param sample: Sample to add
:type sample: bool
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L550-L570 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.update_flapping | def update_flapping(self, notif_period, hosts, services):
"""Compute the sample list (self.flapping_changes) and determine
whether the host/service is flapping or not
:param notif_period: notification period object for this host/service
:type notif_period: alignak.object.timeperiod.Time... | python | def update_flapping(self, notif_period, hosts, services):
"""Compute the sample list (self.flapping_changes) and determine
whether the host/service is flapping or not
:param notif_period: notification period object for this host/service
:type notif_period: alignak.object.timeperiod.Time... | Compute the sample list (self.flapping_changes) and determine
whether the host/service is flapping or not
:param notif_period: notification period object for this host/service
:type notif_period: alignak.object.timeperiod.Timeperiod
:param hosts: Hosts objects, used to create notificati... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L572-L635 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.add_attempt | def add_attempt(self):
"""Add an attempt when a object is a non-ok state
:return: None
"""
self.attempt += 1
self.attempt = min(self.attempt, self.max_check_attempts) | python | def add_attempt(self):
"""Add an attempt when a object is a non-ok state
:return: None
"""
self.attempt += 1
self.attempt = min(self.attempt, self.max_check_attempts) | Add an attempt when a object is a non-ok state
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L637-L643 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.do_check_freshness | def do_check_freshness(self, hosts, services, timeperiods, macromodulations, checkmodulations,
checks, when):
# pylint: disable=too-many-nested-blocks, too-many-branches
"""Check freshness and schedule a check now if necessary.
This function is called by the scheduler... | python | def do_check_freshness(self, hosts, services, timeperiods, macromodulations, checkmodulations,
checks, when):
# pylint: disable=too-many-nested-blocks, too-many-branches
"""Check freshness and schedule a check now if necessary.
This function is called by the scheduler... | Check freshness and schedule a check now if necessary.
This function is called by the scheduler if Alignak is configured to check the freshness.
It is called for hosts that have the freshness check enabled if they are only
passively checked.
It is called for services that have the fre... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L653-L740 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.set_myself_as_problem | def set_myself_as_problem(self, hosts, services, timeperiods, bi_modulations):
# pylint: disable=too-many-locals
""" Raise all impact from my error. I'm setting myself
as a problem, and I register myself as this in all
hosts/services that depend_on_me. So they are now my
impacts
... | python | def set_myself_as_problem(self, hosts, services, timeperiods, bi_modulations):
# pylint: disable=too-many-locals
""" Raise all impact from my error. I'm setting myself
as a problem, and I register myself as this in all
hosts/services that depend_on_me. So they are now my
impacts
... | Raise all impact from my error. I'm setting myself
as a problem, and I register myself as this in all
hosts/services that depend_on_me. So they are now my
impacts
:param hosts: hosts objects, used to get impacts
:type hosts: alignak.objects.host.Hosts
:param services: se... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L742-L794 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.update_business_impact_value | def update_business_impact_value(self, hosts, services, timeperiods, bi_modulations):
"""We update our 'business_impact' value with the max of
the impacts business_impact if we got impacts. And save our 'configuration'
business_impact if we do not have do it before
If we do not have impa... | python | def update_business_impact_value(self, hosts, services, timeperiods, bi_modulations):
"""We update our 'business_impact' value with the max of
the impacts business_impact if we got impacts. And save our 'configuration'
business_impact if we do not have do it before
If we do not have impa... | We update our 'business_impact' value with the max of
the impacts business_impact if we got impacts. And save our 'configuration'
business_impact if we do not have do it before
If we do not have impacts, we revert our value
:param hosts: hosts objects, used to get impacts
:type ... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L796-L844 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.no_more_a_problem | def no_more_a_problem(self, hosts, services, timeperiods, bi_modulations):
"""Remove this objects as an impact for other schedulingitem.
:param hosts: hosts objects, used to get impacts
:type hosts: alignak.objects.host.Hosts
:param services: services objects, used to get impacts
... | python | def no_more_a_problem(self, hosts, services, timeperiods, bi_modulations):
"""Remove this objects as an impact for other schedulingitem.
:param hosts: hosts objects, used to get impacts
:type hosts: alignak.objects.host.Hosts
:param services: services objects, used to get impacts
... | Remove this objects as an impact for other schedulingitem.
:param hosts: hosts objects, used to get impacts
:type hosts: alignak.objects.host.Hosts
:param services: services objects, used to get impacts
:type services: alignak.objects.service.Services
:param timeperiods: Timeper... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L846-L884 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.register_a_problem | def register_a_problem(self, prob, hosts, services, timeperiods, bi_modulations):
# pylint: disable=too-many-locals
"""Call recursively by potentials impacts so they
update their source_problems list. But do not
go below if the problem is not a real one for me
like If I've got mu... | python | def register_a_problem(self, prob, hosts, services, timeperiods, bi_modulations):
# pylint: disable=too-many-locals
"""Call recursively by potentials impacts so they
update their source_problems list. But do not
go below if the problem is not a real one for me
like If I've got mu... | Call recursively by potentials impacts so they
update their source_problems list. But do not
go below if the problem is not a real one for me
like If I've got multiple parents for examples
:param prob: problem to register
:type prob: alignak.objects.schedulingitem.SchedulingItem... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L886-L961 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.unregister_a_problem | def unregister_a_problem(self, prob):
"""Remove the problem from our problems list
and check if we are still 'impacted'
:param prob: problem to remove
:type prob: alignak.objects.schedulingitem.SchedulingItem
:return: None
"""
self.source_problems.remove(prob.uui... | python | def unregister_a_problem(self, prob):
"""Remove the problem from our problems list
and check if we are still 'impacted'
:param prob: problem to remove
:type prob: alignak.objects.schedulingitem.SchedulingItem
:return: None
"""
self.source_problems.remove(prob.uui... | Remove the problem from our problems list
and check if we are still 'impacted'
:param prob: problem to remove
:type prob: alignak.objects.schedulingitem.SchedulingItem
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L963-L982 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.is_enable_action_dependent | def is_enable_action_dependent(self, hosts, services):
"""
Check if dependencies states match dependencies statuses
This basically means that a dependency is in a bad state and
it can explain this object state.
:param hosts: hosts objects, used to get object in act_depend_of
... | python | def is_enable_action_dependent(self, hosts, services):
"""
Check if dependencies states match dependencies statuses
This basically means that a dependency is in a bad state and
it can explain this object state.
:param hosts: hosts objects, used to get object in act_depend_of
... | Check if dependencies states match dependencies statuses
This basically means that a dependency is in a bad state and
it can explain this object state.
:param hosts: hosts objects, used to get object in act_depend_of
:type hosts: alignak.objects.host.Hosts
:param services: servi... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L984-L1014 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.check_and_set_unreachability | def check_and_set_unreachability(self, hosts, services):
"""
Check if all dependencies are down, if yes set this object
as unreachable.
todo: this function do not care about execution_failure_criteria!
:param hosts: hosts objects, used to get object in act_depend_of
:ty... | python | def check_and_set_unreachability(self, hosts, services):
"""
Check if all dependencies are down, if yes set this object
as unreachable.
todo: this function do not care about execution_failure_criteria!
:param hosts: hosts objects, used to get object in act_depend_of
:ty... | Check if all dependencies are down, if yes set this object
as unreachable.
todo: this function do not care about execution_failure_criteria!
:param hosts: hosts objects, used to get object in act_depend_of
:type hosts: alignak.objects.host.Hosts
:param services: services object... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1016-L1042 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.do_i_raise_dependency | def do_i_raise_dependency(self, status, inherit_parents, hosts, services, timeperiods):
# pylint: disable=too-many-locals
"""Check if this object or one of its dependency state (chk dependencies) match the status
:param status: state list where dependency matters (notification failure criteria)... | python | def do_i_raise_dependency(self, status, inherit_parents, hosts, services, timeperiods):
# pylint: disable=too-many-locals
"""Check if this object or one of its dependency state (chk dependencies) match the status
:param status: state list where dependency matters (notification failure criteria)... | Check if this object or one of its dependency state (chk dependencies) match the status
:param status: state list where dependency matters (notification failure criteria)
:type status: list
:param inherit_parents: recurse over parents
:type inherit_parents: bool
:param hosts: ho... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1044-L1083 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.is_no_check_dependent | def is_no_check_dependent(self, hosts, services, timeperiods):
"""Check if there is some host/service that this object depend on
has a state in the status list .
:param hosts: hosts objects, used to raise dependency check
:type hosts: alignak.objects.host.Hosts
:param services: ... | python | def is_no_check_dependent(self, hosts, services, timeperiods):
"""Check if there is some host/service that this object depend on
has a state in the status list .
:param hosts: hosts objects, used to raise dependency check
:type hosts: alignak.objects.host.Hosts
:param services: ... | Check if there is some host/service that this object depend on
has a state in the status list .
:param hosts: hosts objects, used to raise dependency check
:type hosts: alignak.objects.host.Hosts
:param services: services objects, used to raise dependency check
:type services: a... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1085-L1108 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.raise_dependencies_check | def raise_dependencies_check(self, ref_check, hosts, services, timeperiods, macromodulations,
checkmodulations, checks):
# pylint: disable=too-many-locals, too-many-nested-blocks
"""Get checks that we depend on if EVERY following conditions is met::
* timeperiod... | python | def raise_dependencies_check(self, ref_check, hosts, services, timeperiods, macromodulations,
checkmodulations, checks):
# pylint: disable=too-many-locals, too-many-nested-blocks
"""Get checks that we depend on if EVERY following conditions is met::
* timeperiod... | Get checks that we depend on if EVERY following conditions is met::
* timeperiod is valid
* dep.last_state_update < now - cls.cached_check_horizon (check of dependency is "old")
:param ref_check: Check we want to get dependency from
:type ref_check: alignak.check.Check
:param h... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1110-L1165 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.schedule | def schedule(self, hosts, services, timeperiods, macromodulations, checkmodulations,
checks, force=False, force_time=None):
# pylint: disable=too-many-branches, too-many-arguments, too-many-locals
"""Main scheduling function
If a check is in progress, or active check are disable... | python | def schedule(self, hosts, services, timeperiods, macromodulations, checkmodulations,
checks, force=False, force_time=None):
# pylint: disable=too-many-branches, too-many-arguments, too-many-locals
"""Main scheduling function
If a check is in progress, or active check are disable... | Main scheduling function
If a check is in progress, or active check are disabled, do not schedule a check.
The check interval change with HARD state::
* SOFT: retry_interval
* HARD: check_interval
The first scheduling is evenly distributed, so all checks
are not launche... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1167-L1298 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.compensate_system_time_change | def compensate_system_time_change(self, difference): # pragma: no cover,
# not with unit tests
"""If a system time change occurs we have to update
properties time related to reflect change
:param difference: difference between new time and old time
:type difference:
:re... | python | def compensate_system_time_change(self, difference): # pragma: no cover,
# not with unit tests
"""If a system time change occurs we have to update
properties time related to reflect change
:param difference: difference between new time and old time
:type difference:
:re... | If a system time change occurs we have to update
properties time related to reflect change
:param difference: difference between new time and old time
:type difference:
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1300-L1314 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.disable_active_checks | def disable_active_checks(self, checks):
"""Disable active checks for this host/service
Update check in progress with current object information
:param checks: Checks object, to change all checks in progress
:type checks: alignak.objects.check.Checks
:return: None
"""
... | python | def disable_active_checks(self, checks):
"""Disable active checks for this host/service
Update check in progress with current object information
:param checks: Checks object, to change all checks in progress
:type checks: alignak.objects.check.Checks
:return: None
"""
... | Disable active checks for this host/service
Update check in progress with current object information
:param checks: Checks object, to change all checks in progress
:type checks: alignak.objects.check.Checks
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1316-L1332 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.remove_in_progress_check | def remove_in_progress_check(self, check):
"""Remove check from check in progress
:param check: Check to remove
:type check: alignak.objects.check.Check
:return: None
"""
# The check is consumed, update the in_checking properties
if check in self.checks_in_progre... | python | def remove_in_progress_check(self, check):
"""Remove check from check in progress
:param check: Check to remove
:type check: alignak.objects.check.Check
:return: None
"""
# The check is consumed, update the in_checking properties
if check in self.checks_in_progre... | Remove check from check in progress
:param check: Check to remove
:type check: alignak.objects.check.Check
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1334-L1344 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.remove_in_progress_notification | def remove_in_progress_notification(self, notification):
"""
Remove a notification and mark them as zombie
:param notification: the notification to remove
:type notification: alignak.notification.Notification
:return: None
"""
if notification.uuid in self.notific... | python | def remove_in_progress_notification(self, notification):
"""
Remove a notification and mark them as zombie
:param notification: the notification to remove
:type notification: alignak.notification.Notification
:return: None
"""
if notification.uuid in self.notific... | Remove a notification and mark them as zombie
:param notification: the notification to remove
:type notification: alignak.notification.Notification
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1354-L1364 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.remove_in_progress_notifications | def remove_in_progress_notifications(self, master=True):
"""Remove all notifications from notifications_in_progress
Preserves some specific notifications (downtime, ...)
:param master: remove master notifications only if True (default value)
:type master: bool
:param force: for... | python | def remove_in_progress_notifications(self, master=True):
"""Remove all notifications from notifications_in_progress
Preserves some specific notifications (downtime, ...)
:param master: remove master notifications only if True (default value)
:type master: bool
:param force: for... | Remove all notifications from notifications_in_progress
Preserves some specific notifications (downtime, ...)
:param master: remove master notifications only if True (default value)
:type master: bool
:param force: force remove all notifications except if False
:type force: boo... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1366-L1384 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.get_event_handlers | def get_event_handlers(self, hosts, macromodulations, timeperiods, ext_cmd=False):
"""Raise event handlers if NONE of the following conditions is met::
* externalcmd is False and event_handlers are disabled (globally or locally)
* externalcmd is False and object is in scheduled dowtime and no e... | python | def get_event_handlers(self, hosts, macromodulations, timeperiods, ext_cmd=False):
"""Raise event handlers if NONE of the following conditions is met::
* externalcmd is False and event_handlers are disabled (globally or locally)
* externalcmd is False and object is in scheduled dowtime and no e... | Raise event handlers if NONE of the following conditions is met::
* externalcmd is False and event_handlers are disabled (globally or locally)
* externalcmd is False and object is in scheduled dowtime and no event handlers in downtime
* self.event_handler and cls.global_event_handler are None
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1386-L1438 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.get_snapshot | def get_snapshot(self, hosts, macromodulations, timeperiods): # pragma: no cover, not yet!
"""
Raise snapshot event handlers if NONE of the following conditions is met::
* snapshot_command is None
* snapshot_enabled is disabled
* snapshot_criteria does not matches current state... | python | def get_snapshot(self, hosts, macromodulations, timeperiods): # pragma: no cover, not yet!
"""
Raise snapshot event handlers if NONE of the following conditions is met::
* snapshot_command is None
* snapshot_enabled is disabled
* snapshot_criteria does not matches current state... | Raise snapshot event handlers if NONE of the following conditions is met::
* snapshot_command is None
* snapshot_enabled is disabled
* snapshot_criteria does not matches current state
* last_snapshot > now - snapshot_interval * interval_length (previous snapshot too early)
* sna... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1440-L1503 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.check_for_flexible_downtime | def check_for_flexible_downtime(self, timeperiods, hosts, services):
"""Enter in a downtime if necessary and raise start notification
When a non Ok state occurs we try to raise a flexible downtime.
:param timeperiods: Timeperiods objects, used for downtime period
:type timeperiods: alig... | python | def check_for_flexible_downtime(self, timeperiods, hosts, services):
"""Enter in a downtime if necessary and raise start notification
When a non Ok state occurs we try to raise a flexible downtime.
:param timeperiods: Timeperiods objects, used for downtime period
:type timeperiods: alig... | Enter in a downtime if necessary and raise start notification
When a non Ok state occurs we try to raise a flexible downtime.
:param timeperiods: Timeperiods objects, used for downtime period
:type timeperiods: alignak.objects.timeperiod.Timeperiods
:param hosts: hosts objects, used to ... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1505-L1530 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.update_hard_unknown_phase_state | def update_hard_unknown_phase_state(self):
"""Update in_hard_unknown_reach_phase attribute and
was_in_hard_unknown_reach_phase
UNKNOWN during a HARD state are not so important, and they should
not raise notif about it
:return: None
"""
self.was_in_hard_unknown_r... | python | def update_hard_unknown_phase_state(self):
"""Update in_hard_unknown_reach_phase attribute and
was_in_hard_unknown_reach_phase
UNKNOWN during a HARD state are not so important, and they should
not raise notif about it
:return: None
"""
self.was_in_hard_unknown_r... | Update in_hard_unknown_reach_phase attribute and
was_in_hard_unknown_reach_phase
UNKNOWN during a HARD state are not so important, and they should
not raise notif about it
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1532-L1567 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.consume_result | def consume_result(self, chk, notification_period, hosts,
services, timeperiods, macromodulations, checkmodulations, bi_modulations,
res_modulations, checks, raise_log):
# pylint: disable=too-many-locals, too-many-arguments
# pylint: disable=too-many-branche... | python | def consume_result(self, chk, notification_period, hosts,
services, timeperiods, macromodulations, checkmodulations, bi_modulations,
res_modulations, checks, raise_log):
# pylint: disable=too-many-locals, too-many-arguments
# pylint: disable=too-many-branche... | Consume a check return and send action in return
main function of reaction of checks like raise notifications
Special cases::
* is_flapping: immediate notif when problem
* is_in_scheduled_downtime: no notification
* is_volatile: notif immediately (service only)
Basical... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1569-L1936 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.update_event_and_problem_id | def update_event_and_problem_id(self):
"""Update current_event_id and current_problem_id
Those attributes are used for macros (SERVICEPROBLEMID ...)
:return: None
"""
ok_up = self.__class__.ok_up # OK for service, UP for host
if (self.state != self.last_state and self.l... | python | def update_event_and_problem_id(self):
"""Update current_event_id and current_problem_id
Those attributes are used for macros (SERVICEPROBLEMID ...)
:return: None
"""
ok_up = self.__class__.ok_up # OK for service, UP for host
if (self.state != self.last_state and self.l... | Update current_event_id and current_problem_id
Those attributes are used for macros (SERVICEPROBLEMID ...)
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1938-L1972 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.prepare_notification_for_sending | def prepare_notification_for_sending(self, notif, contact, macromodulations, timeperiods,
host_ref):
"""Used by scheduler when a notification is ok to be sent (to reactionner).
Here we update the command with status of now, and we add the contact to set of
... | python | def prepare_notification_for_sending(self, notif, contact, macromodulations, timeperiods,
host_ref):
"""Used by scheduler when a notification is ok to be sent (to reactionner).
Here we update the command with status of now, and we add the contact to set of
... | Used by scheduler when a notification is ok to be sent (to reactionner).
Here we update the command with status of now, and we add the contact to set of
contact we notified. And we raise the log entry
:param notif: notification to send
:type notif: alignak.objects.notification.Notificat... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1974-L1995 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.update_notification_command | def update_notification_command(self, notif, contact, macromodulations, timeperiods,
host_ref=None):
"""Update the notification command by resolving Macros
And because we are just launching the notification, we can say
that this contact has been notified
... | python | def update_notification_command(self, notif, contact, macromodulations, timeperiods,
host_ref=None):
"""Update the notification command by resolving Macros
And because we are just launching the notification, we can say
that this contact has been notified
... | Update the notification command by resolving Macros
And because we are just launching the notification, we can say
that this contact has been notified
:param notif: notification to send
:type notif: alignak.objects.notification.Notification
:param contact: contact for this host/... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L1997-L2021 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.is_escalable | def is_escalable(self, notification, escalations, timeperiods):
"""Check if a notification can be escalated.
Basically call is_eligible for each escalation
:param notification: notification we would like to escalate
:type notification: alignak.objects.notification.Notification
:... | python | def is_escalable(self, notification, escalations, timeperiods):
"""Check if a notification can be escalated.
Basically call is_eligible for each escalation
:param notification: notification we would like to escalate
:type notification: alignak.objects.notification.Notification
:... | Check if a notification can be escalated.
Basically call is_eligible for each escalation
:param notification: notification we would like to escalate
:type notification: alignak.objects.notification.Notification
:param escalations: Esclations objects, used to get escalation objects (peri... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L2023-L2050 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.get_next_notification_time | def get_next_notification_time(self, notif, escalations, timeperiods):
# pylint: disable=too-many-locals
"""Get the next notification time for a notification
Take the standard notification_interval or ask for our escalation
if one of them need a smaller value to escalade
:param ... | python | def get_next_notification_time(self, notif, escalations, timeperiods):
# pylint: disable=too-many-locals
"""Get the next notification time for a notification
Take the standard notification_interval or ask for our escalation
if one of them need a smaller value to escalade
:param ... | Get the next notification time for a notification
Take the standard notification_interval or ask for our escalation
if one of them need a smaller value to escalade
:param notif: Notification we need time
:type notif: alignak.objects.notification.Notification
:param escalations: ... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L2052-L2113 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.get_escalable_contacts | def get_escalable_contacts(self, notification, escalations, timeperiods):
"""Get all contacts (uniq) from eligible escalations
:param notification: Notification to get data from (notif number...)
:type notification: alignak.objects.notification.Notification
:param escalations: Esclation... | python | def get_escalable_contacts(self, notification, escalations, timeperiods):
"""Get all contacts (uniq) from eligible escalations
:param notification: Notification to get data from (notif number...)
:type notification: alignak.objects.notification.Notification
:param escalations: Esclation... | Get all contacts (uniq) from eligible escalations
:param notification: Notification to get data from (notif number...)
:type notification: alignak.objects.notification.Notification
:param escalations: Esclations objects, used to get escalation objects (contact, period)
:type escalations... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L2115-L2145 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.create_notifications | def create_notifications(self, n_type, notification_period, hosts, services,
t_wished=None, author_data=None):
"""Create a "master" notification here, which will later
(immediately before the reactionner gets it) be split up
in many "child" notifications, one for eac... | python | def create_notifications(self, n_type, notification_period, hosts, services,
t_wished=None, author_data=None):
"""Create a "master" notification here, which will later
(immediately before the reactionner gets it) be split up
in many "child" notifications, one for eac... | Create a "master" notification here, which will later
(immediately before the reactionner gets it) be split up
in many "child" notifications, one for each contact.
:param n_type: notification type ("PROBLEM", "RECOVERY" ...)
:type n_type: str
:param notification_period: notifica... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L2147-L2230 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.scatter_notification | def scatter_notification(self, notif, contacts, notifways, timeperiods, macromodulations,
escalations, host_ref):
# pylint: disable=too-many-locals, too-many-boolean-expressions
"""In create_notifications we created a notification master (eg. a template).
When it's t... | python | def scatter_notification(self, notif, contacts, notifways, timeperiods, macromodulations,
escalations, host_ref):
# pylint: disable=too-many-locals, too-many-boolean-expressions
"""In create_notifications we created a notification master (eg. a template).
When it's t... | In create_notifications we created a notification master (eg. a template).
When it's time to hand it over to the reactionner, this master notification needs
to be split in several child notifications, one for each contact
To be more exact, one for each contact who is willing to accept
n... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L2232-L2352 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.launch_check | def launch_check(self, timestamp, hosts, services, timeperiods,
macromodulations, checkmodulations, checks, ref_check=None, force=False,
dependent=False):
# pylint: disable=too-many-locals, too-many-arguments
# pylint: disable=too-many-branches, too-many-return-... | python | def launch_check(self, timestamp, hosts, services, timeperiods,
macromodulations, checkmodulations, checks, ref_check=None, force=False,
dependent=False):
# pylint: disable=too-many-locals, too-many-arguments
# pylint: disable=too-many-branches, too-many-return-... | Launch a check (command)
:param timestamp:
:type timestamp: int
:param checkmodulations: Checkmodulations objects, used to change check command if necessary
:type checkmodulations: alignak.objects.checkmodulation.Checkmodulations
:param ref_check:
:type ref_check:
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L2354-L2516 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.get_perfdata_command | def get_perfdata_command(self, hosts, macromodulations, timeperiods):
"""Add event_handler to process performance data if necessary (not disabled)
:param macromodulations: Macro modulations objects, used in commands (notif, check)
:type macromodulations: alignak.objects.macromodulation.Macromod... | python | def get_perfdata_command(self, hosts, macromodulations, timeperiods):
"""Add event_handler to process performance data if necessary (not disabled)
:param macromodulations: Macro modulations objects, used in commands (notif, check)
:type macromodulations: alignak.objects.macromodulation.Macromod... | Add event_handler to process performance data if necessary (not disabled)
:param macromodulations: Macro modulations objects, used in commands (notif, check)
:type macromodulations: alignak.objects.macromodulation.Macromodulations
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L2535-L2560 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.create_business_rules | def create_business_rules(self, hosts, services, hostgroups, servicegroups,
macromodulations, timeperiods, running=False):
# pylint: disable=too-many-locals
"""Create business rules if necessary (cmd contains bp_rule)
:param hosts: Hosts object to look for objects
... | python | def create_business_rules(self, hosts, services, hostgroups, servicegroups,
macromodulations, timeperiods, running=False):
# pylint: disable=too-many-locals
"""Create business rules if necessary (cmd contains bp_rule)
:param hosts: Hosts object to look for objects
... | Create business rules if necessary (cmd contains bp_rule)
:param hosts: Hosts object to look for objects
:type hosts: alignak.objects.host.Hosts
:param services: Services object to look for objects
:type services: alignak.objects.service.Services
:param running: flag used in eva... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L2562-L2610 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.get_business_rule_output | def get_business_rule_output(self, hosts, services, macromodulations, timeperiods):
# pylint: disable=too-many-locals, too-many-branches
"""
Returns a status string for business rules based items formatted
using business_rule_output_template attribute as template.
The template m... | python | def get_business_rule_output(self, hosts, services, macromodulations, timeperiods):
# pylint: disable=too-many-locals, too-many-branches
"""
Returns a status string for business rules based items formatted
using business_rule_output_template attribute as template.
The template m... | Returns a status string for business rules based items formatted
using business_rule_output_template attribute as template.
The template may embed output formatting for itself, and for its child
(dependent) items. Child format string is expanded into the $( and )$,
using the string betw... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L2612-L2692 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.business_rule_notification_is_blocked | def business_rule_notification_is_blocked(self, hosts, services):
# pylint: disable=too-many-locals
"""Process business rule notifications behaviour. If all problems have
been acknowledged, no notifications should be sent if state is not OK.
By default, downtimes are ignored, unless expl... | python | def business_rule_notification_is_blocked(self, hosts, services):
# pylint: disable=too-many-locals
"""Process business rule notifications behaviour. If all problems have
been acknowledged, no notifications should be sent if state is not OK.
By default, downtimes are ignored, unless expl... | Process business rule notifications behaviour. If all problems have
been acknowledged, no notifications should be sent if state is not OK.
By default, downtimes are ignored, unless explicitly told to be treated
as acknowledgements through with the business_rule_downtime_as_ack set.
:ret... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L2694-L2729 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.manage_internal_check | def manage_internal_check(self, hosts, services, check, hostgroups, servicegroups,
macromodulations, timeperiods):
# pylint: disable=too-many-branches, too-many-statements, too-many-locals
"""Manage internal commands such as ::
* bp_rule
* _internal_host_up... | python | def manage_internal_check(self, hosts, services, check, hostgroups, servicegroups,
macromodulations, timeperiods):
# pylint: disable=too-many-branches, too-many-statements, too-many-locals
"""Manage internal commands such as ::
* bp_rule
* _internal_host_up... | Manage internal commands such as ::
* bp_rule
* _internal_host_up
* _echo
:param hosts: Used to create business rules
:type hosts: alignak.objects.host.Hosts
:param services: Used to create business rules
:type services: alignak.objects.service.Services
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L2731-L2932 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.fill_data_brok_from | def fill_data_brok_from(self, data, brok_type):
"""Fill data brok dependent on the brok_type
:param data: data to fill
:type data: dict
:param brok_type: brok type
:type: str
:return: None
"""
super(SchedulingItem, self).fill_data_brok_from(data, brok_typ... | python | def fill_data_brok_from(self, data, brok_type):
"""Fill data brok dependent on the brok_type
:param data: data to fill
:type data: dict
:param brok_type: brok type
:type: str
:return: None
"""
super(SchedulingItem, self).fill_data_brok_from(data, brok_typ... | Fill data brok dependent on the brok_type
:param data: data to fill
:type data: dict
:param brok_type: brok type
:type: str
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L2934-L2949 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.acknowledge_problem | def acknowledge_problem(self, notification_period, hosts, services, sticky, notify, author,
comment, end_time=0):
# pylint: disable=too-many-arguments
"""
Add an acknowledge
:param sticky: acknowledge will be always present is host return in UP state
... | python | def acknowledge_problem(self, notification_period, hosts, services, sticky, notify, author,
comment, end_time=0):
# pylint: disable=too-many-arguments
"""
Add an acknowledge
:param sticky: acknowledge will be always present is host return in UP state
... | Add an acknowledge
:param sticky: acknowledge will be always present is host return in UP state
:type sticky: integer
:param notify: if to 1, send a notification
:type notify: integer
:param author: name of the author or the acknowledge
:type author: str
:param c... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L2951-L3017 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.check_for_expire_acknowledge | def check_for_expire_acknowledge(self):
"""
If have acknowledge and is expired, delete it
:return: None
"""
if (self.acknowledgement and
self.acknowledgement.end_time != 0 and
self.acknowledgement.end_time < time.time()):
self.unacknow... | python | def check_for_expire_acknowledge(self):
"""
If have acknowledge and is expired, delete it
:return: None
"""
if (self.acknowledgement and
self.acknowledgement.end_time != 0 and
self.acknowledgement.end_time < time.time()):
self.unacknow... | If have acknowledge and is expired, delete it
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L3019-L3028 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.unacknowledge_problem | def unacknowledge_problem(self):
"""
Remove the acknowledge, reset the flag. The comment is deleted
:return: None
"""
if self.problem_has_been_acknowledged:
logger.debug("[item::%s] deleting acknowledge of %s",
self.get_name(),
... | python | def unacknowledge_problem(self):
"""
Remove the acknowledge, reset the flag. The comment is deleted
:return: None
"""
if self.problem_has_been_acknowledged:
logger.debug("[item::%s] deleting acknowledge of %s",
self.get_name(),
... | Remove the acknowledge, reset the flag. The comment is deleted
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L3030-L3055 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.unacknowledge_problem_if_not_sticky | def unacknowledge_problem_if_not_sticky(self):
"""
Remove the acknowledge if it is not sticky
:return: None
"""
if hasattr(self, 'acknowledgement') and self.acknowledgement is not None:
if not self.acknowledgement.sticky:
self.unacknowledge_problem() | python | def unacknowledge_problem_if_not_sticky(self):
"""
Remove the acknowledge if it is not sticky
:return: None
"""
if hasattr(self, 'acknowledgement') and self.acknowledgement is not None:
if not self.acknowledgement.sticky:
self.unacknowledge_problem() | Remove the acknowledge if it is not sticky
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L3057-L3065 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.raise_freshness_log_entry | def raise_freshness_log_entry(self, t_stale_by):
"""Raise freshness alert entry (warning level)
Example : "The freshness period of host 'host_name' is expired
by 0d 0h 17m 6s (threshold=0d 1h 0m 0s).
Attempt: 1 / 1.
I'm forcing the state to fresh... | python | def raise_freshness_log_entry(self, t_stale_by):
"""Raise freshness alert entry (warning level)
Example : "The freshness period of host 'host_name' is expired
by 0d 0h 17m 6s (threshold=0d 1h 0m 0s).
Attempt: 1 / 1.
I'm forcing the state to fresh... | Raise freshness alert entry (warning level)
Example : "The freshness period of host 'host_name' is expired
by 0d 0h 17m 6s (threshold=0d 1h 0m 0s).
Attempt: 1 / 1.
I'm forcing the state to freshness state (d / HARD)"
:param t_stale_by: time in s... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L3109-L3128 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.set_impact_state | def set_impact_state(self):
"""We just go an impact, so we go unreachable
But only if we enable this state change in the conf
:return: None
"""
cls = self.__class__
if cls.enable_problem_impacts_states_change:
logger.debug("%s is impacted and goes UNREACHABLE... | python | def set_impact_state(self):
"""We just go an impact, so we go unreachable
But only if we enable this state change in the conf
:return: None
"""
cls = self.__class__
if cls.enable_problem_impacts_states_change:
logger.debug("%s is impacted and goes UNREACHABLE... | We just go an impact, so we go unreachable
But only if we enable this state change in the conf
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L3215-L3231 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.unset_impact_state | def unset_impact_state(self):
"""Unset impact, only if impact state change is set in configuration
:return: None
"""
cls = self.__class__
if cls.enable_problem_impacts_states_change and not self.state_changed_since_impact:
self.state = self.state_before_impact
... | python | def unset_impact_state(self):
"""Unset impact, only if impact state change is set in configuration
:return: None
"""
cls = self.__class__
if cls.enable_problem_impacts_states_change and not self.state_changed_since_impact:
self.state = self.state_before_impact
... | Unset impact, only if impact state change is set in configuration
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L3233-L3241 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.set_unreachable | def set_unreachable(self):
"""Set unreachable: all our parents (dependencies) are not ok
Unreachable is different from down/critical
:return:None
"""
self.state_id = 4
self.state = u'UNREACHABLE'
self.last_time_unreachable = int(time.time()) | python | def set_unreachable(self):
"""Set unreachable: all our parents (dependencies) are not ok
Unreachable is different from down/critical
:return:None
"""
self.state_id = 4
self.state = u'UNREACHABLE'
self.last_time_unreachable = int(time.time()) | Set unreachable: all our parents (dependencies) are not ok
Unreachable is different from down/critical
:return:None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L3243-L3251 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItem.is_correct | def is_correct(self):
# pylint: disable=too-many-branches
"""
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: b... | python | def is_correct(self):
# pylint: disable=too-many-branches
"""
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: b... | 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 | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L3301-L3371 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItems.find_by_filter | def find_by_filter(self, filters, all_items):
"""
Find items by filters
:param filters: list of filters
:type filters: list
:param all_items: monitoring items
:type: dict
:return: list of items
:rtype: list
"""
items = []
for i in ... | python | def find_by_filter(self, filters, all_items):
"""
Find items by filters
:param filters: list of filters
:type filters: list
:param all_items: monitoring items
:type: dict
:return: list of items
:rtype: list
"""
items = []
for i in ... | Find items by filters
:param filters: list of filters
:type filters: list
:param all_items: monitoring items
:type: dict
:return: list of items
:rtype: list | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L3379-L3403 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItems.add_act_dependency | def add_act_dependency(self, son_id, parent_id, notif_failure_criteria, dep_period,
inherits_parents):
"""
Add a logical dependency for actions between two hosts or services.
:param son_id: uuid of son host
:type son_id: str
:param parent_id: uuid of p... | python | def add_act_dependency(self, son_id, parent_id, notif_failure_criteria, dep_period,
inherits_parents):
"""
Add a logical dependency for actions between two hosts or services.
:param son_id: uuid of son host
:type son_id: str
:param parent_id: uuid of p... | Add a logical dependency for actions between two hosts or services.
:param son_id: uuid of son host
:type son_id: str
:param parent_id: uuid of parent host
:type parent_id: str
:param notif_failure_criteria: notification failure criteria,
notification for a dependent hos... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L3405-L3435 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItems.del_act_dependency | def del_act_dependency(self, son_id, parent_id): # pragma: no cover, not yet tested
"""Remove act_dependency between two hosts or services.
TODO: do we really intend to remove dynamically ?
:param son_id: uuid of son host/service
:type son_id: str
:param parent_id: uuid of par... | python | def del_act_dependency(self, son_id, parent_id): # pragma: no cover, not yet tested
"""Remove act_dependency between two hosts or services.
TODO: do we really intend to remove dynamically ?
:param son_id: uuid of son host/service
:type son_id: str
:param parent_id: uuid of par... | Remove act_dependency between two hosts or services.
TODO: do we really intend to remove dynamically ?
:param son_id: uuid of son host/service
:type son_id: str
:param parent_id: uuid of parent host/service
:type parent_id: str
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L3437-L3470 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItems.add_chk_dependency | def add_chk_dependency(self, son_id, parent_id, notif_failure_criteria, dep_period,
inherits_parents):
"""
Add a logical dependency for checks between two hosts or services.
:param son_id: uuid of son host/service
:type son_id: str
:param parent_id: uu... | python | def add_chk_dependency(self, son_id, parent_id, notif_failure_criteria, dep_period,
inherits_parents):
"""
Add a logical dependency for checks between two hosts or services.
:param son_id: uuid of son host/service
:type son_id: str
:param parent_id: uu... | Add a logical dependency for checks between two hosts or services.
:param son_id: uuid of son host/service
:type son_id: str
:param parent_id: uuid of parent host/service
:type parent_id: str
:param notif_failure_criteria: notification failure criteria,
notification for ... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L3472-L3499 |
Alignak-monitoring/alignak | alignak/objects/schedulingitem.py | SchedulingItems.create_business_rules | def create_business_rules(self, hosts, services, hostgroups, servicegroups,
macromodulations, timeperiods):
"""
Loop on hosts or services and call SchedulingItem.create_business_rules
:param hosts: hosts to link to
:type hosts: alignak.objects.host.Hosts
... | python | def create_business_rules(self, hosts, services, hostgroups, servicegroups,
macromodulations, timeperiods):
"""
Loop on hosts or services and call SchedulingItem.create_business_rules
:param hosts: hosts to link to
:type hosts: alignak.objects.host.Hosts
... | Loop on hosts or services and call SchedulingItem.create_business_rules
:param hosts: hosts to link to
:type hosts: alignak.objects.host.Hosts
:param services: services to link to
:type services: alignak.objects.service.Services
:param hostgroups: hostgroups to link to
:... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulingitem.py#L3501-L3522 |
Alignak-monitoring/alignak | alignak/objects/servicegroup.py | Servicegroup.get_services_by_explosion | def get_services_by_explosion(self, servicegroups):
# pylint: disable=access-member-before-definition
"""
Get all services of this servicegroup and add it in members container
:param servicegroups: servicegroups object
:type servicegroups: alignak.objects.servicegroup.Servicegro... | python | def get_services_by_explosion(self, servicegroups):
# pylint: disable=access-member-before-definition
"""
Get all services of this servicegroup and add it in members container
:param servicegroups: servicegroups object
:type servicegroups: alignak.objects.servicegroup.Servicegro... | Get all services of this servicegroup and add it in members container
:param servicegroups: servicegroups object
:type servicegroups: alignak.objects.servicegroup.Servicegroups
:return: return empty string or list of members
:rtype: str or list | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/servicegroup.py#L115-L154 |
Alignak-monitoring/alignak | alignak/objects/servicegroup.py | Servicegroups.add_member | def add_member(self, service_name, servicegroup_name):
"""Add a member (service) to this servicegroup
:param service_name: member (service) name
:type service_name: str
:param servicegroup_name: servicegroup name
:type servicegroup_name: str
:return: None
"""
... | python | def add_member(self, service_name, servicegroup_name):
"""Add a member (service) to this servicegroup
:param service_name: member (service) name
:type service_name: str
:param servicegroup_name: servicegroup name
:type servicegroup_name: str
:return: None
"""
... | Add a member (service) to this servicegroup
:param service_name: member (service) name
:type service_name: str
:param servicegroup_name: servicegroup name
:type servicegroup_name: str
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/servicegroup.py#L164-L180 |
Alignak-monitoring/alignak | alignak/objects/servicegroup.py | Servicegroups.get_members_of_group | def get_members_of_group(self, gname):
"""Get all members of a group which name is given in parameter
:param gname: name of the group
:type gname: str
:return: list of the services in the group
:rtype: list[alignak.objects.service.Service]
"""
hostgroup = self.fi... | python | def get_members_of_group(self, gname):
"""Get all members of a group which name is given in parameter
:param gname: name of the group
:type gname: str
:return: list of the services in the group
:rtype: list[alignak.objects.service.Service]
"""
hostgroup = self.fi... | Get all members of a group which name is given in parameter
:param gname: name of the group
:type gname: str
:return: list of the services in the group
:rtype: list[alignak.objects.service.Service] | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/servicegroup.py#L182-L193 |
Alignak-monitoring/alignak | alignak/objects/servicegroup.py | Servicegroups.linkify_servicegroups_services | def linkify_servicegroups_services(self, hosts, services):
"""
We just search for each host the id of the host
and replace the name by the id
TODO: very slow for high services, so search with host list,
not service one
:param hosts: hosts object
:type hosts: alig... | python | def linkify_servicegroups_services(self, hosts, services):
"""
We just search for each host the id of the host
and replace the name by the id
TODO: very slow for high services, so search with host list,
not service one
:param hosts: hosts object
:type hosts: alig... | We just search for each host the id of the host
and replace the name by the id
TODO: very slow for high services, so search with host list,
not service one
:param hosts: hosts object
:type hosts: alignak.objects.host.Hosts
:param services: services object
:type s... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/servicegroup.py#L207-L258 |
Alignak-monitoring/alignak | alignak/objects/servicegroup.py | Servicegroups.explode | def explode(self):
"""
Get services and put them in members container
:return: None
"""
# We do not want a same service group to be exploded again and again
# so we tag it
for tmp_sg in list(self.items.values()):
tmp_sg.already_exploded = False
... | python | def explode(self):
"""
Get services and put them in members container
:return: None
"""
# We do not want a same service group to be exploded again and again
# so we tag it
for tmp_sg in list(self.items.values()):
tmp_sg.already_exploded = False
... | Get services and put them in members container
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/servicegroup.py#L260-L285 |
Alignak-monitoring/alignak | alignak/bin/alignak_arbiter.py | main | def main():
"""Parse args and run main daemon function
:return: None
"""
try:
args = parse_daemon_args(True)
# Protect for windows multiprocessing that will RELAUNCH all
while True:
daemon = Arbiter(**args.__dict__)
daemon.main()
if not daemo... | python | def main():
"""Parse args and run main daemon function
:return: None
"""
try:
args = parse_daemon_args(True)
# Protect for windows multiprocessing that will RELAUNCH all
while True:
daemon = Arbiter(**args.__dict__)
daemon.main()
if not daemo... | Parse args and run main daemon function
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/bin/alignak_arbiter.py#L60-L78 |
Alignak-monitoring/alignak | alignak/log.py | setup_logger | def setup_logger(logger_configuration_file, log_dir=None, process_name='', log_file=''):
# pylint: disable=too-many-branches
"""
Configure the provided logger
- get and update the content of the Json configuration file
- configure the logger with this file
If a log_dir and process_name are prov... | python | def setup_logger(logger_configuration_file, log_dir=None, process_name='', log_file=''):
# pylint: disable=too-many-branches
"""
Configure the provided logger
- get and update the content of the Json configuration file
- configure the logger with this file
If a log_dir and process_name are prov... | Configure the provided logger
- get and update the content of the Json configuration file
- configure the logger with this file
If a log_dir and process_name are provided, the format and filename in the configuration file
are updated with the provided values if they contain the patterns %(logdir)s and ... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/log.py#L111-L198 |
Alignak-monitoring/alignak | alignak/log.py | set_log_console | def set_log_console(log_level=logging.INFO):
"""Set the Alignak daemons logger have a console log handler.
This is only used for the arbiter verify mode to add a console log handler.
:param log_level: log level
:return: n/a
"""
# Change the logger and all its handlers log level
logger_ = l... | python | def set_log_console(log_level=logging.INFO):
"""Set the Alignak daemons logger have a console log handler.
This is only used for the arbiter verify mode to add a console log handler.
:param log_level: log level
:return: n/a
"""
# Change the logger and all its handlers log level
logger_ = l... | Set the Alignak daemons logger have a console log handler.
This is only used for the arbiter verify mode to add a console log handler.
:param log_level: log level
:return: n/a | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/log.py#L201-L217 |
Alignak-monitoring/alignak | alignak/log.py | set_log_level | def set_log_level(log_level=logging.INFO, handlers=None):
"""Set the Alignak logger log level. This is mainly used for the arbiter verify code to
set the log level at INFO level whatever the configured log level is set.
This is also used when changing the daemon log level thanks to the WS interface
If... | python | def set_log_level(log_level=logging.INFO, handlers=None):
"""Set the Alignak logger log level. This is mainly used for the arbiter verify code to
set the log level at INFO level whatever the configured log level is set.
This is also used when changing the daemon log level thanks to the WS interface
If... | Set the Alignak logger log level. This is mainly used for the arbiter verify code to
set the log level at INFO level whatever the configured log level is set.
This is also used when changing the daemon log level thanks to the WS interface
If an handlers name list is provided, all the handlers which name i... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/log.py#L220-L242 |
Alignak-monitoring/alignak | alignak/log.py | make_monitoring_log | def make_monitoring_log(level, message, timestamp=None, to_logger=False):
"""
Function used to build the monitoring log.
Emit a log message with the provided level to the monitoring log logger.
Build a Brok typed as monitoring_log with the provided message
When to_logger is True, the information i... | python | def make_monitoring_log(level, message, timestamp=None, to_logger=False):
"""
Function used to build the monitoring log.
Emit a log message with the provided level to the monitoring log logger.
Build a Brok typed as monitoring_log with the provided message
When to_logger is True, the information i... | Function used to build the monitoring log.
Emit a log message with the provided level to the monitoring log logger.
Build a Brok typed as monitoring_log with the provided message
When to_logger is True, the information is sent to the python logger, else a monitoring_log
Brok is returned. The Brok is m... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/log.py#L256-L308 |
Alignak-monitoring/alignak | alignak/objects/contact.py | Contact.want_service_notification | def want_service_notification(self, notifways, timeperiods,
timestamp, state, n_type, business_impact, cmd=None):
"""Check if notification options match the state of the service
:param timestamp: time we want to notify the contact (usually now)
:type timestamp:... | python | def want_service_notification(self, notifways, timeperiods,
timestamp, state, n_type, business_impact, cmd=None):
"""Check if notification options match the state of the service
:param timestamp: time we want to notify the contact (usually now)
:type timestamp:... | Check if notification options match the state of the service
:param timestamp: time we want to notify the contact (usually now)
:type timestamp: int
:param state: host or service state ("WARNING", "CRITICAL" ..)
:type state: str
:param n_type: type of notification ("PROBLEM", "R... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/contact.py#L243-L281 |
Alignak-monitoring/alignak | alignak/objects/contact.py | Contact.want_host_notification | def want_host_notification(self, notifways, timeperiods, timestamp, state, n_type,
business_impact, cmd=None):
"""Check if notification options match the state of the host
:param timestamp: time we want to notify the contact (usually now)
:type timestamp: int
... | python | def want_host_notification(self, notifways, timeperiods, timestamp, state, n_type,
business_impact, cmd=None):
"""Check if notification options match the state of the host
:param timestamp: time we want to notify the contact (usually now)
:type timestamp: int
... | Check if notification options match the state of the host
:param timestamp: time we want to notify the contact (usually now)
:type timestamp: int
:param state: host or service state ("UP", "DOWN" ..)
:type state: str
:param n_type: type of notification ("PROBLEM", "RECOVERY" ..)... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/contact.py#L283-L320 |
Alignak-monitoring/alignak | alignak/objects/contact.py | Contact.get_notification_commands | def get_notification_commands(self, notifways, n_type, command_name=False):
"""Get notification commands for object type
:param notifways: list of alignak.objects.NotificationWay objects
:type notifways: NotificationWays
:param n_type: object type (host or service)
:type n_type:... | python | def get_notification_commands(self, notifways, n_type, command_name=False):
"""Get notification commands for object type
:param notifways: list of alignak.objects.NotificationWay objects
:type notifways: NotificationWays
:param n_type: object type (host or service)
:type n_type:... | Get notification commands for object type
:param notifways: list of alignak.objects.NotificationWay objects
:type notifways: NotificationWays
:param n_type: object type (host or service)
:type n_type: string
:param command_name: True to update the inner property with the name of... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/contact.py#L322-L347 |
Alignak-monitoring/alignak | alignak/objects/contact.py | Contact.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
cls = se... | 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
cls = se... | 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 | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/contact.py#L349-L386 |
Alignak-monitoring/alignak | alignak/objects/contact.py | Contact.raise_enter_downtime_log_entry | def raise_enter_downtime_log_entry(self):
"""Raise CONTACT DOWNTIME ALERT entry (info level)
Format is : "CONTACT DOWNTIME ALERT: *get_name()*;STARTED;
Contact has entered a period of scheduled downtime"
Example : "CONTACT DOWNTIME ALERT: test_contact;STARTED;
... | python | def raise_enter_downtime_log_entry(self):
"""Raise CONTACT DOWNTIME ALERT entry (info level)
Format is : "CONTACT DOWNTIME ALERT: *get_name()*;STARTED;
Contact has entered a period of scheduled downtime"
Example : "CONTACT DOWNTIME ALERT: test_contact;STARTED;
... | Raise CONTACT DOWNTIME ALERT entry (info level)
Format is : "CONTACT DOWNTIME ALERT: *get_name()*;STARTED;
Contact has entered a period of scheduled downtime"
Example : "CONTACT DOWNTIME ALERT: test_contact;STARTED;
Contact has entered a period of scheduled down... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/contact.py#L388-L401 |
Alignak-monitoring/alignak | alignak/objects/contact.py | Contact.raise_exit_downtime_log_entry | def raise_exit_downtime_log_entry(self):
"""Raise CONTACT DOWNTIME ALERT entry (info level)
Format is : "CONTACT DOWNTIME ALERT: *get_name()*;STOPPED;
Contact has entered a period of scheduled downtime"
Example : "CONTACT DOWNTIME ALERT: test_contact;STOPPED;
... | python | def raise_exit_downtime_log_entry(self):
"""Raise CONTACT DOWNTIME ALERT entry (info level)
Format is : "CONTACT DOWNTIME ALERT: *get_name()*;STOPPED;
Contact has entered a period of scheduled downtime"
Example : "CONTACT DOWNTIME ALERT: test_contact;STOPPED;
... | Raise CONTACT DOWNTIME ALERT entry (info level)
Format is : "CONTACT DOWNTIME ALERT: *get_name()*;STOPPED;
Contact has entered a period of scheduled downtime"
Example : "CONTACT DOWNTIME ALERT: test_contact;STOPPED;
Contact has entered a period of scheduled down... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/contact.py#L403-L416 |
Alignak-monitoring/alignak | alignak/objects/contact.py | Contact.raise_cancel_downtime_log_entry | def raise_cancel_downtime_log_entry(self):
"""Raise CONTACT DOWNTIME ALERT entry (info level)
Format is : "CONTACT DOWNTIME ALERT: *get_name()*;CANCELLED;
Contact has entered a period of scheduled downtime"
Example : "CONTACT DOWNTIME ALERT: test_contact;CANCELLED;
... | python | def raise_cancel_downtime_log_entry(self):
"""Raise CONTACT DOWNTIME ALERT entry (info level)
Format is : "CONTACT DOWNTIME ALERT: *get_name()*;CANCELLED;
Contact has entered a period of scheduled downtime"
Example : "CONTACT DOWNTIME ALERT: test_contact;CANCELLED;
... | Raise CONTACT DOWNTIME ALERT entry (info level)
Format is : "CONTACT DOWNTIME ALERT: *get_name()*;CANCELLED;
Contact has entered a period of scheduled downtime"
Example : "CONTACT DOWNTIME ALERT: test_contact;CANCELLED;
Contact has entered a period of scheduled ... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/contact.py#L418-L431 |
Alignak-monitoring/alignak | alignak/objects/contact.py | Contacts.linkify | def linkify(self, commands, notificationways):
"""Create link between objects::
* contacts -> notificationways
:param notificationways: notificationways to link
:type notificationways: alignak.objects.notificationway.Notificationways
:return: None
TODO: Clean this func... | python | def linkify(self, commands, notificationways):
"""Create link between objects::
* contacts -> notificationways
:param notificationways: notificationways to link
:type notificationways: alignak.objects.notificationway.Notificationways
:return: None
TODO: Clean this func... | Create link between objects::
* contacts -> notificationways
:param notificationways: notificationways to link
:type notificationways: alignak.objects.notificationway.Notificationways
:return: None
TODO: Clean this function | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/contact.py#L441-L453 |
Alignak-monitoring/alignak | alignak/objects/contact.py | Contacts.linkify_with_notificationways | def linkify_with_notificationways(self, notificationways):
"""Link hosts with realms
:param notificationways: notificationways object to link with
:type notificationways: alignak.objects.notificationway.Notificationways
:return: None
"""
for i in self:
if not... | python | def linkify_with_notificationways(self, notificationways):
"""Link hosts with realms
:param notificationways: notificationways object to link with
:type notificationways: alignak.objects.notificationway.Notificationways
:return: None
"""
for i in self:
if not... | Link hosts with realms
:param notificationways: notificationways object to link with
:type notificationways: alignak.objects.notificationway.Notificationways
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/contact.py#L455-L479 |
Alignak-monitoring/alignak | alignak/objects/contact.py | Contacts.explode | def explode(self, contactgroups, notificationways):
"""Explode all contact for each contactsgroup
:param contactgroups: contactgroups to explode
:type contactgroups: alignak.objects.contactgroup.Contactgroups
:param notificationways: notificationways to explode
:type notificatio... | python | def explode(self, contactgroups, notificationways):
"""Explode all contact for each contactsgroup
:param contactgroups: contactgroups to explode
:type contactgroups: alignak.objects.contactgroup.Contactgroups
:param notificationways: notificationways to explode
:type notificatio... | Explode all contact for each contactsgroup
:param contactgroups: contactgroups to explode
:type contactgroups: alignak.objects.contactgroup.Contactgroups
:param notificationways: notificationways to explode
:type notificationways: alignak.objects.notificationway.Notificationways
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/contact.py#L481-L528 |
Alignak-monitoring/alignak | alignak/http/cherrypy_extend.py | zlib_processor | def zlib_processor(entity): # pragma: no cover, not used in the testing environment...
"""Read application/zlib data and put content into entity.params for later use.
:param entity: cherrypy entity
:type entity: cherrypy._cpreqbody.Entity
:return: None
"""
if not entity.headers.get(ntou("Conte... | python | def zlib_processor(entity): # pragma: no cover, not used in the testing environment...
"""Read application/zlib data and put content into entity.params for later use.
:param entity: cherrypy entity
:type entity: cherrypy._cpreqbody.Entity
:return: None
"""
if not entity.headers.get(ntou("Conte... | Read application/zlib data and put content into entity.params for later use.
:param entity: cherrypy entity
:type entity: cherrypy._cpreqbody.Entity
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/cherrypy_extend.py#L33-L70 |
Alignak-monitoring/alignak | alignak/modules/inner_retention.py | get_instance | def get_instance(mod_conf):
"""
Return a module instance for the modules manager
:param mod_conf: the module properties as defined globally in this file
:return:
"""
logger.info("Giving an instance of %s for alias: %s",
mod_conf.python_name, mod_conf.module_alias)
return In... | python | def get_instance(mod_conf):
"""
Return a module instance for the modules manager
:param mod_conf: the module properties as defined globally in this file
:return:
"""
logger.info("Giving an instance of %s for alias: %s",
mod_conf.python_name, mod_conf.module_alias)
return In... | Return a module instance for the modules manager
:param mod_conf: the module properties as defined globally in this file
:return: | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modules/inner_retention.py#L45-L55 |
Alignak-monitoring/alignak | alignak/modules/inner_retention.py | InnerRetention.hook_load_retention | def hook_load_retention(self, scheduler): # pylint: disable=too-many-locals, too-many-branches
"""Load retention data from a file
:param scheduler: scheduler instance of alignak
:type scheduler: object
:return: None
"""
if not self.enabled:
logger.warning("A... | python | def hook_load_retention(self, scheduler): # pylint: disable=too-many-locals, too-many-branches
"""Load retention data from a file
:param scheduler: scheduler instance of alignak
:type scheduler: object
:return: None
"""
if not self.enabled:
logger.warning("A... | Load retention data from a file
:param scheduler: scheduler instance of alignak
:type scheduler: object
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modules/inner_retention.py#L168-L257 |
Alignak-monitoring/alignak | alignak/modules/inner_retention.py | InnerRetention.hook_save_retention | def hook_save_retention(self, scheduler):
"""Save retention data to a Json formated file
:param scheduler: scheduler instance of alignak
:type scheduler: object
:return: None
"""
if not self.enabled:
logger.warning("Alignak retention module is not enabled."
... | python | def hook_save_retention(self, scheduler):
"""Save retention data to a Json formated file
:param scheduler: scheduler instance of alignak
:type scheduler: object
:return: None
"""
if not self.enabled:
logger.warning("Alignak retention module is not enabled."
... | Save retention data to a Json formated file
:param scheduler: scheduler instance of alignak
:type scheduler: object
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modules/inner_retention.py#L259-L326 |
Alignak-monitoring/alignak | alignak/objects/checkmodulation.py | CheckModulation.get_check_command | def get_check_command(self, timeperiods, t_to_go):
"""Get the check_command if we are in the check period modulation
:param t_to_go: time to check if we are in the timeperiod
:type t_to_go:
:return: A check command if we are in the check period, None otherwise
:rtype: alignak.ob... | python | def get_check_command(self, timeperiods, t_to_go):
"""Get the check_command if we are in the check period modulation
:param t_to_go: time to check if we are in the timeperiod
:type t_to_go:
:return: A check command if we are in the check period, None otherwise
:rtype: alignak.ob... | Get the check_command if we are in the check period modulation
:param t_to_go: time to check if we are in the timeperiod
:type t_to_go:
:return: A check command if we are in the check period, None otherwise
:rtype: alignak.objects.command.Command | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/checkmodulation.py#L113-L123 |
Alignak-monitoring/alignak | alignak/objects/checkmodulation.py | CheckModulation.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... | 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 | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/checkmodulation.py#L125-L157 |
Alignak-monitoring/alignak | alignak/objects/checkmodulation.py | CheckModulations.linkify | def linkify(self, timeperiods, commands):
"""Replace check_period by real Timeperiod object into each CheckModulation
Replace check_command by real Command object into each CheckModulation
:param timeperiods: timeperiods to link to
:type timeperiods: alignak.objects.timeperiod.Timeperio... | python | def linkify(self, timeperiods, commands):
"""Replace check_period by real Timeperiod object into each CheckModulation
Replace check_command by real Command object into each CheckModulation
:param timeperiods: timeperiods to link to
:type timeperiods: alignak.objects.timeperiod.Timeperio... | Replace check_period by real Timeperiod object into each CheckModulation
Replace check_command by real Command object into each CheckModulation
:param timeperiods: timeperiods to link to
:type timeperiods: alignak.objects.timeperiod.Timeperiods
:param commands: commands to link to
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/checkmodulation.py#L167-L178 |
Alignak-monitoring/alignak | alignak/objects/checkmodulation.py | CheckModulations.new_inner_member | def new_inner_member(self, name=None, params=None):
"""Create a CheckModulation object and add it to items
:param name: CheckModulation name
:type name: str
:param params: parameters to init CheckModulation
:type params: dict
:return: None
TODO: Remove this defau... | python | def new_inner_member(self, name=None, params=None):
"""Create a CheckModulation object and add it to items
:param name: CheckModulation name
:type name: str
:param params: parameters to init CheckModulation
:type params: dict
:return: None
TODO: Remove this defau... | Create a CheckModulation object and add it to items
:param name: CheckModulation name
:type name: str
:param params: parameters to init CheckModulation
:type params: dict
:return: None
TODO: Remove this default mutable argument. Usually result in unexpected behavior | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/checkmodulation.py#L180-L198 |
harmsm/PyCmdMessenger | PyCmdMessenger/arduino.py | ArduinoBoard.open | def open(self):
"""
Open the serial connection.
"""
if not self._is_connected:
print("Connecting to arduino on {}... ".format(self.device),end="")
self.comm = serial.Serial()
self.comm.port = self.device
self.comm.baudrate = ... | python | def open(self):
"""
Open the serial connection.
"""
if not self._is_connected:
print("Connecting to arduino on {}... ".format(self.device),end="")
self.comm = serial.Serial()
self.comm.port = self.device
self.comm.baudrate = ... | Open the serial connection. | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/arduino.py#L147-L166 |
harmsm/PyCmdMessenger | PyCmdMessenger/arduino.py | ArduinoBoard.close | def close(self):
"""
Close serial connection.
"""
if self._is_connected:
self.comm.close()
self._is_connected = False | python | def close(self):
"""
Close serial connection.
"""
if self._is_connected:
self.comm.close()
self._is_connected = False | Close serial connection. | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/arduino.py#L189-L196 |
harmsm/PyCmdMessenger | PyCmdMessenger/PyCmdMessenger.py | CmdMessenger.send | def send(self,cmd,*args,arg_formats=None):
"""
Send a command (which may or may not have associated arguments) to an
arduino using the CmdMessage protocol. The command and any parameters
should be passed as direct arguments to send.
arg_formats is an optional string that spe... | python | def send(self,cmd,*args,arg_formats=None):
"""
Send a command (which may or may not have associated arguments) to an
arduino using the CmdMessage protocol. The command and any parameters
should be passed as direct arguments to send.
arg_formats is an optional string that spe... | Send a command (which may or may not have associated arguments) to an
arduino using the CmdMessage protocol. The command and any parameters
should be passed as direct arguments to send.
arg_formats is an optional string that specifies the formats to use for
each argument when passed... | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/PyCmdMessenger.py#L120-L173 |
harmsm/PyCmdMessenger | PyCmdMessenger/PyCmdMessenger.py | CmdMessenger.receive | def receive(self,arg_formats=None):
"""
Recieve commands coming off the serial port.
arg_formats is an optimal keyword that specifies the formats to use to
parse incoming arguments. If specified here, arg_formats supercedes
the formats specified on initialization.
""... | python | def receive(self,arg_formats=None):
"""
Recieve commands coming off the serial port.
arg_formats is an optimal keyword that specifies the formats to use to
parse incoming arguments. If specified here, arg_formats supercedes
the formats specified on initialization.
""... | Recieve commands coming off the serial port.
arg_formats is an optimal keyword that specifies the formats to use to
parse incoming arguments. If specified here, arg_formats supercedes
the formats specified on initialization. | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/PyCmdMessenger.py#L175-L289 |
harmsm/PyCmdMessenger | PyCmdMessenger/PyCmdMessenger.py | CmdMessenger._treat_star_format | def _treat_star_format(self,arg_format_list,args):
"""
Deal with "*" format if specified.
"""
num_stars = len([a for a in arg_format_list if a == "*"])
if num_stars > 0:
# Make sure the repeated format argument only occurs once, is last,
# and that there... | python | def _treat_star_format(self,arg_format_list,args):
"""
Deal with "*" format if specified.
"""
num_stars = len([a for a in arg_format_list if a == "*"])
if num_stars > 0:
# Make sure the repeated format argument only occurs once, is last,
# and that there... | Deal with "*" format if specified. | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/PyCmdMessenger.py#L291-L317 |
harmsm/PyCmdMessenger | PyCmdMessenger/PyCmdMessenger.py | CmdMessenger._send_char | def _send_char(self,value):
"""
Convert a single char to a bytes object.
"""
if type(value) != str and type(value) != bytes:
err = "char requires a string or bytes array of length 1"
raise ValueError(err)
if len(value) != 1:
err = "char must ... | python | def _send_char(self,value):
"""
Convert a single char to a bytes object.
"""
if type(value) != str and type(value) != bytes:
err = "char requires a string or bytes array of length 1"
raise ValueError(err)
if len(value) != 1:
err = "char must ... | Convert a single char to a bytes object. | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/PyCmdMessenger.py#L319-L339 |
harmsm/PyCmdMessenger | PyCmdMessenger/PyCmdMessenger.py | CmdMessenger._send_byte | def _send_byte(self,value):
"""
Convert a numerical value into an integer, then to a byte object. Check
bounds for byte.
"""
# Coerce to int. This will throw a ValueError if the value can't
# actually be converted.
if type(value) != int:
new_value = i... | python | def _send_byte(self,value):
"""
Convert a numerical value into an integer, then to a byte object. Check
bounds for byte.
"""
# Coerce to int. This will throw a ValueError if the value can't
# actually be converted.
if type(value) != int:
new_value = i... | Convert a numerical value into an integer, then to a byte object. Check
bounds for byte. | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/PyCmdMessenger.py#L341-L362 |
harmsm/PyCmdMessenger | PyCmdMessenger/PyCmdMessenger.py | CmdMessenger._send_int | def _send_int(self,value):
"""
Convert a numerical value into an integer, then to a bytes object Check
bounds for signed int.
"""
# Coerce to int. This will throw a ValueError if the value can't
# actually be converted.
if type(value) != int:
new_val... | python | def _send_int(self,value):
"""
Convert a numerical value into an integer, then to a bytes object Check
bounds for signed int.
"""
# Coerce to int. This will throw a ValueError if the value can't
# actually be converted.
if type(value) != int:
new_val... | Convert a numerical value into an integer, then to a bytes object Check
bounds for signed int. | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/PyCmdMessenger.py#L364-L385 |
harmsm/PyCmdMessenger | PyCmdMessenger/PyCmdMessenger.py | CmdMessenger._send_unsigned_int | def _send_unsigned_int(self,value):
"""
Convert a numerical value into an integer, then to a bytes object. Check
bounds for unsigned int.
"""
# Coerce to int. This will throw a ValueError if the value can't
# actually be converted.
if type(value) != int:
... | python | def _send_unsigned_int(self,value):
"""
Convert a numerical value into an integer, then to a bytes object. Check
bounds for unsigned int.
"""
# Coerce to int. This will throw a ValueError if the value can't
# actually be converted.
if type(value) != int:
... | Convert a numerical value into an integer, then to a bytes object. Check
bounds for unsigned int. | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/PyCmdMessenger.py#L387-L407 |
harmsm/PyCmdMessenger | PyCmdMessenger/PyCmdMessenger.py | CmdMessenger._send_long | def _send_long(self,value):
"""
Convert a numerical value into an integer, then to a bytes object. Check
bounds for signed long.
"""
# Coerce to int. This will throw a ValueError if the value can't
# actually be converted.
if type(value) != int:
new_... | python | def _send_long(self,value):
"""
Convert a numerical value into an integer, then to a bytes object. Check
bounds for signed long.
"""
# Coerce to int. This will throw a ValueError if the value can't
# actually be converted.
if type(value) != int:
new_... | Convert a numerical value into an integer, then to a bytes object. Check
bounds for signed long. | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/PyCmdMessenger.py#L409-L430 |
harmsm/PyCmdMessenger | PyCmdMessenger/PyCmdMessenger.py | CmdMessenger._send_unsigned_long | def _send_unsigned_long(self,value):
"""
Convert a numerical value into an integer, then to a bytes object.
Check bounds for unsigned long.
"""
# Coerce to int. This will throw a ValueError if the value can't
# actually be converted.
if type(value) != int:
... | python | def _send_unsigned_long(self,value):
"""
Convert a numerical value into an integer, then to a bytes object.
Check bounds for unsigned long.
"""
# Coerce to int. This will throw a ValueError if the value can't
# actually be converted.
if type(value) != int:
... | Convert a numerical value into an integer, then to a bytes object.
Check bounds for unsigned long. | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/PyCmdMessenger.py#L432-L453 |
harmsm/PyCmdMessenger | PyCmdMessenger/PyCmdMessenger.py | CmdMessenger._send_float | def _send_float(self,value):
"""
Return a float as a IEEE 754 format bytes object.
"""
# convert to float. this will throw a ValueError if the type is not
# readily converted
if type(value) != float:
value = float(value)
# Range check
if val... | python | def _send_float(self,value):
"""
Return a float as a IEEE 754 format bytes object.
"""
# convert to float. this will throw a ValueError if the type is not
# readily converted
if type(value) != float:
value = float(value)
# Range check
if val... | Return a float as a IEEE 754 format bytes object. | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/PyCmdMessenger.py#L455-L470 |
harmsm/PyCmdMessenger | PyCmdMessenger/PyCmdMessenger.py | CmdMessenger._send_double | def _send_double(self,value):
"""
Return a float as a IEEE 754 format bytes object.
"""
# convert to float. this will throw a ValueError if the type is not
# readily converted
if type(value) != float:
value = float(value)
# Range check
if va... | python | def _send_double(self,value):
"""
Return a float as a IEEE 754 format bytes object.
"""
# convert to float. this will throw a ValueError if the type is not
# readily converted
if type(value) != float:
value = float(value)
# Range check
if va... | Return a float as a IEEE 754 format bytes object. | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/PyCmdMessenger.py#L472-L487 |
harmsm/PyCmdMessenger | PyCmdMessenger/PyCmdMessenger.py | CmdMessenger._send_string | def _send_string(self,value):
"""
Convert a string to a bytes object. If value is not a string, it is
be converted to one with a standard string.format call.
"""
if type(value) != bytes:
value = "{}".format(value).encode("ascii")
return value | python | def _send_string(self,value):
"""
Convert a string to a bytes object. If value is not a string, it is
be converted to one with a standard string.format call.
"""
if type(value) != bytes:
value = "{}".format(value).encode("ascii")
return value | Convert a string to a bytes object. If value is not a string, it is
be converted to one with a standard string.format call. | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/PyCmdMessenger.py#L489-L498 |
harmsm/PyCmdMessenger | PyCmdMessenger/PyCmdMessenger.py | CmdMessenger._send_bool | def _send_bool(self,value):
"""
Convert a boolean value into a bytes object. Uses 0 and 1 as output.
"""
# Sanity check.
if type(value) != bool and value not in [0,1]:
err = "{} is not boolean.".format(value)
raise ValueError(err)
return struct.... | python | def _send_bool(self,value):
"""
Convert a boolean value into a bytes object. Uses 0 and 1 as output.
"""
# Sanity check.
if type(value) != bool and value not in [0,1]:
err = "{} is not boolean.".format(value)
raise ValueError(err)
return struct.... | Convert a boolean value into a bytes object. Uses 0 and 1 as output. | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/PyCmdMessenger.py#L500-L510 |
harmsm/PyCmdMessenger | PyCmdMessenger/PyCmdMessenger.py | CmdMessenger._send_guess | def _send_guess(self,value):
"""
Send the argument as a string in a way that should (probably, maybe!) be
processed properly by C++ calls like atoi, atof, etc. This method is
NOT RECOMMENDED, particularly for floats, because values are often
mangled silently. Instead, specify ... | python | def _send_guess(self,value):
"""
Send the argument as a string in a way that should (probably, maybe!) be
processed properly by C++ calls like atoi, atof, etc. This method is
NOT RECOMMENDED, particularly for floats, because values are often
mangled silently. Instead, specify ... | Send the argument as a string in a way that should (probably, maybe!) be
processed properly by C++ calls like atoi, atof, etc. This method is
NOT RECOMMENDED, particularly for floats, because values are often
mangled silently. Instead, specify a format (e.g. "f") and use the
CmdMesse... | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/PyCmdMessenger.py#L512-L531 |
harmsm/PyCmdMessenger | PyCmdMessenger/PyCmdMessenger.py | CmdMessenger._recv_string | def _recv_string(self,value):
"""
Recieve a binary (bytes) string, returning a python string.
"""
s = value.decode('ascii')
# Strip null characters
s = s.strip("\x00")
# Strip other white space
s = s.strip()
return s | python | def _recv_string(self,value):
"""
Recieve a binary (bytes) string, returning a python string.
"""
s = value.decode('ascii')
# Strip null characters
s = s.strip("\x00")
# Strip other white space
s = s.strip()
return s | Recieve a binary (bytes) string, returning a python string. | https://github.com/harmsm/PyCmdMessenger/blob/215d6f9402262662a14a2996f532934339639a5b/PyCmdMessenger/PyCmdMessenger.py#L588-L601 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.