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/util.py | filter_host_by_regex | def filter_host_by_regex(regex):
"""Filter for host
Filter on regex
:param regex: regex to filter
:type regex: str
:return: Filter
:rtype: bool
"""
host_re = re.compile(regex)
def inner_filter(items):
"""Inner filter for host. Accept if regex match host_name"""
host... | python | def filter_host_by_regex(regex):
"""Filter for host
Filter on regex
:param regex: regex to filter
:type regex: str
:return: Filter
:rtype: bool
"""
host_re = re.compile(regex)
def inner_filter(items):
"""Inner filter for host. Accept if regex match host_name"""
host... | Filter for host
Filter on regex
:param regex: regex to filter
:type regex: str
:return: Filter
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L958-L976 |
Alignak-monitoring/alignak | alignak/util.py | filter_host_by_group | def filter_host_by_group(group):
"""Filter for host
Filter on group
:param group: group name to filter
:type group: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for host. Accept if group in host.hostgroups"""
host = items["host"]
... | python | def filter_host_by_group(group):
"""Filter for host
Filter on group
:param group: group name to filter
:type group: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for host. Accept if group in host.hostgroups"""
host = items["host"]
... | Filter for host
Filter on group
:param group: group name to filter
:type group: str
:return: Filter
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L979-L996 |
Alignak-monitoring/alignak | alignak/util.py | filter_host_by_tag | def filter_host_by_tag(tpl):
"""Filter for host
Filter on tag
:param tpl: tag to filter
:type tpl: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for host. Accept if tag in host.tags"""
host = items["host"]
if host is None:
... | python | def filter_host_by_tag(tpl):
"""Filter for host
Filter on tag
:param tpl: tag to filter
:type tpl: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for host. Accept if tag in host.tags"""
host = items["host"]
if host is None:
... | Filter for host
Filter on tag
:param tpl: tag to filter
:type tpl: str
:return: Filter
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L999-L1016 |
Alignak-monitoring/alignak | alignak/util.py | filter_service_by_name | def filter_service_by_name(name):
"""Filter for service
Filter on name
:param name: name to filter
:type name: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for service. Accept if service_description == name"""
service = items["service"]
... | python | def filter_service_by_name(name):
"""Filter for service
Filter on name
:param name: name to filter
:type name: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for service. Accept if service_description == name"""
service = items["service"]
... | Filter for service
Filter on name
:param name: name to filter
:type name: str
:return: Filter
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1019-L1036 |
Alignak-monitoring/alignak | alignak/util.py | filter_service_by_regex_name | def filter_service_by_regex_name(regex):
"""Filter for service
Filter on regex
:param regex: regex to filter
:type regex: str
:return: Filter
:rtype: bool
"""
host_re = re.compile(regex)
def inner_filter(items):
"""Inner filter for service. Accept if regex match service_des... | python | def filter_service_by_regex_name(regex):
"""Filter for service
Filter on regex
:param regex: regex to filter
:type regex: str
:return: Filter
:rtype: bool
"""
host_re = re.compile(regex)
def inner_filter(items):
"""Inner filter for service. Accept if regex match service_des... | Filter for service
Filter on regex
:param regex: regex to filter
:type regex: str
:return: Filter
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1039-L1057 |
Alignak-monitoring/alignak | alignak/util.py | filter_service_by_host_name | def filter_service_by_host_name(host_name):
"""Filter for service
Filter on host_name
:param host_name: host_name to filter
:type host_name: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for service. Accept if service.host.host_name == host_name"... | python | def filter_service_by_host_name(host_name):
"""Filter for service
Filter on host_name
:param host_name: host_name to filter
:type host_name: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for service. Accept if service.host.host_name == host_name"... | Filter for service
Filter on host_name
:param host_name: host_name to filter
:type host_name: str
:return: Filter
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1060-L1078 |
Alignak-monitoring/alignak | alignak/util.py | filter_service_by_regex_host_name | def filter_service_by_regex_host_name(regex):
"""Filter for service
Filter on regex host_name
:param regex: regex to filter
:type regex: str
:return: Filter
:rtype: bool
"""
host_re = re.compile(regex)
def inner_filter(items):
"""Inner filter for service. Accept if regex ma... | python | def filter_service_by_regex_host_name(regex):
"""Filter for service
Filter on regex host_name
:param regex: regex to filter
:type regex: str
:return: Filter
:rtype: bool
"""
host_re = re.compile(regex)
def inner_filter(items):
"""Inner filter for service. Accept if regex ma... | Filter for service
Filter on regex host_name
:param regex: regex to filter
:type regex: str
:return: Filter
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1081-L1100 |
Alignak-monitoring/alignak | alignak/util.py | filter_service_by_hostgroup_name | def filter_service_by_hostgroup_name(group):
"""Filter for service
Filter on hostgroup
:param group: hostgroup to filter
:type group: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for service. Accept if hostgroup in service.host.hostgroups"""
... | python | def filter_service_by_hostgroup_name(group):
"""Filter for service
Filter on hostgroup
:param group: hostgroup to filter
:type group: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for service. Accept if hostgroup in service.host.hostgroups"""
... | Filter for service
Filter on hostgroup
:param group: hostgroup to filter
:type group: str
:return: Filter
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1103-L1121 |
Alignak-monitoring/alignak | alignak/util.py | filter_service_by_host_tag_name | def filter_service_by_host_tag_name(tpl):
"""Filter for service
Filter on tag
:param tpl: tag to filter
:type tpl: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for service. Accept if tpl in service.host.tags"""
service = items["service"]... | python | def filter_service_by_host_tag_name(tpl):
"""Filter for service
Filter on tag
:param tpl: tag to filter
:type tpl: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for service. Accept if tpl in service.host.tags"""
service = items["service"]... | Filter for service
Filter on tag
:param tpl: tag to filter
:type tpl: str
:return: Filter
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1124-L1142 |
Alignak-monitoring/alignak | alignak/util.py | filter_service_by_servicegroup_name | def filter_service_by_servicegroup_name(group):
"""Filter for service
Filter on group
:param group: group to filter
:type group: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for service. Accept if group in service.servicegroups"""
servic... | python | def filter_service_by_servicegroup_name(group):
"""Filter for service
Filter on group
:param group: group to filter
:type group: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for service. Accept if group in service.servicegroups"""
servic... | Filter for service
Filter on group
:param group: group to filter
:type group: str
:return: Filter
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1145-L1162 |
Alignak-monitoring/alignak | alignak/util.py | filter_host_by_bp_rule_label | def filter_host_by_bp_rule_label(label):
"""Filter for host
Filter on label
:param label: label to filter
:type label: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for host. Accept if label in host.labels"""
host = items["host"]
... | python | def filter_host_by_bp_rule_label(label):
"""Filter for host
Filter on label
:param label: label to filter
:type label: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for host. Accept if label in host.labels"""
host = items["host"]
... | Filter for host
Filter on label
:param label: label to filter
:type label: str
:return: Filter
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1165-L1182 |
Alignak-monitoring/alignak | alignak/util.py | filter_service_by_host_bp_rule_label | def filter_service_by_host_bp_rule_label(label):
"""Filter for service
Filter on label
:param label: label to filter
:type label: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for service. Accept if label in service.host.labels"""
service... | python | def filter_service_by_host_bp_rule_label(label):
"""Filter for service
Filter on label
:param label: label to filter
:type label: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for service. Accept if label in service.host.labels"""
service... | Filter for service
Filter on label
:param label: label to filter
:type label: str
:return: Filter
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1185-L1203 |
Alignak-monitoring/alignak | alignak/util.py | filter_service_by_bp_rule_label | def filter_service_by_bp_rule_label(label):
"""Filter for service
Filter on label
:param label: label to filter
:type label: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for service. Accept if label in service.labels"""
service = items["s... | python | def filter_service_by_bp_rule_label(label):
"""Filter for service
Filter on label
:param label: label to filter
:type label: str
:return: Filter
:rtype: bool
"""
def inner_filter(items):
"""Inner filter for service. Accept if label in service.labels"""
service = items["s... | Filter for service
Filter on label
:param label: label to filter
:type label: str
:return: Filter
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1206-L1222 |
Alignak-monitoring/alignak | alignak/util.py | parse_daemon_args | def parse_daemon_args(arbiter=False):
"""Generic parsing function for daemons
All daemons:
'-n', "--name": Set the name of the daemon to pick in the configuration files.
This allows an arbiter to find its own configuration in the whole Alignak configuration
Using this parameter is manda... | python | def parse_daemon_args(arbiter=False):
"""Generic parsing function for daemons
All daemons:
'-n', "--name": Set the name of the daemon to pick in the configuration files.
This allows an arbiter to find its own configuration in the whole Alignak configuration
Using this parameter is manda... | Generic parsing function for daemons
All daemons:
'-n', "--name": Set the name of the daemon to pick in the configuration files.
This allows an arbiter to find its own configuration in the whole Alignak configuration
Using this parameter is mandatory for all the daemons except for the arbit... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1240-L1353 |
Alignak-monitoring/alignak | alignak/worker.py | Worker.manage_signal | def manage_signal(self, sig, frame): # pylint: disable=unused-argument
"""Manage signals caught by the process but I do not do anything...
our master daemon is managing our termination.
:param sig: signal caught by daemon
:type sig: str
:param frame: current stack frame
... | python | def manage_signal(self, sig, frame): # pylint: disable=unused-argument
"""Manage signals caught by the process but I do not do anything...
our master daemon is managing our termination.
:param sig: signal caught by daemon
:type sig: str
:param frame: current stack frame
... | Manage signals caught by the process but I do not do anything...
our master daemon is managing our termination.
:param sig: signal caught by daemon
:type sig: str
:param frame: current stack frame
:type frame:
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L183-L196 |
Alignak-monitoring/alignak | alignak/worker.py | Worker.set_exit_handler | def set_exit_handler(self):
"""Set the signal handler to manage_signal (defined in this class)
Only set handlers for signal.SIGTERM, signal.SIGINT, signal.SIGUSR1, signal.SIGUSR2
:return: None
"""
signal.signal(signal.SIGINT, self.manage_signal)
signal.signal(signal.SIGT... | python | def set_exit_handler(self):
"""Set the signal handler to manage_signal (defined in this class)
Only set handlers for signal.SIGTERM, signal.SIGINT, signal.SIGUSR1, signal.SIGUSR2
:return: None
"""
signal.signal(signal.SIGINT, self.manage_signal)
signal.signal(signal.SIGT... | Set the signal handler to manage_signal (defined in this class)
Only set handlers for signal.SIGTERM, signal.SIGINT, signal.SIGUSR1, signal.SIGUSR2
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L198-L207 |
Alignak-monitoring/alignak | alignak/worker.py | Worker.get_new_checks | def get_new_checks(self, queue, return_queue):
"""Get new checks if less than nb_checks_max
If no new checks got and no check in queue, sleep for 1 sec
REF: doc/alignak-action-queues.png (3)
:return: None
"""
try:
logger.debug("get_new_checks: %s / %s", len(s... | python | def get_new_checks(self, queue, return_queue):
"""Get new checks if less than nb_checks_max
If no new checks got and no check in queue, sleep for 1 sec
REF: doc/alignak-action-queues.png (3)
:return: None
"""
try:
logger.debug("get_new_checks: %s / %s", len(s... | Get new checks if less than nb_checks_max
If no new checks got and no check in queue, sleep for 1 sec
REF: doc/alignak-action-queues.png (3)
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L241-L280 |
Alignak-monitoring/alignak | alignak/worker.py | Worker.launch_new_checks | def launch_new_checks(self):
"""Launch checks that are in status
REF: doc/alignak-action-queues.png (4)
:return: None
"""
# queue
for chk in self.checks:
if chk.status not in [ACT_STATUS_QUEUED]:
continue
logger.debug("Launch check... | python | def launch_new_checks(self):
"""Launch checks that are in status
REF: doc/alignak-action-queues.png (4)
:return: None
"""
# queue
for chk in self.checks:
if chk.status not in [ACT_STATUS_QUEUED]:
continue
logger.debug("Launch check... | Launch checks that are in status
REF: doc/alignak-action-queues.png (4)
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L282-L303 |
Alignak-monitoring/alignak | alignak/worker.py | Worker.manage_finished_checks | def manage_finished_checks(self, queue):
"""Check the status of checks
if done, return message finished :)
REF: doc/alignak-action-queues.png (5)
:return: None
"""
to_del = []
wait_time = 1.0
now = time.time()
logger.debug("--- manage finished che... | python | def manage_finished_checks(self, queue):
"""Check the status of checks
if done, return message finished :)
REF: doc/alignak-action-queues.png (5)
:return: None
"""
to_del = []
wait_time = 1.0
now = time.time()
logger.debug("--- manage finished che... | Check the status of checks
if done, return message finished :)
REF: doc/alignak-action-queues.png (5)
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L305-L341 |
Alignak-monitoring/alignak | alignak/worker.py | Worker.check_for_system_time_change | def check_for_system_time_change(self): # pragma: no cover, hardly testable with unit tests...
"""Check if our system time change. If so, change our
:return: 0 if the difference < 900, difference else
:rtype: int
"""
now = time.time()
difference = now - self.t_each_loop... | python | def check_for_system_time_change(self): # pragma: no cover, hardly testable with unit tests...
"""Check if our system time change. If so, change our
:return: 0 if the difference < 900, difference else
:rtype: int
"""
now = time.time()
difference = now - self.t_each_loop... | Check if our system time change. If so, change our
:return: 0 if the difference < 900, difference else
:rtype: int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L343-L360 |
Alignak-monitoring/alignak | alignak/worker.py | Worker.work | def work(self, actions_queue, returns_queue, control_queue=None): # pragma: no cover
"""Wrapper function for do_work in order to catch the exception
to see the real work, look at do_work
:param actions_queue: Global Queue Master->Slave
:type actions_queue: Queue.Queue
:param re... | python | def work(self, actions_queue, returns_queue, control_queue=None): # pragma: no cover
"""Wrapper function for do_work in order to catch the exception
to see the real work, look at do_work
:param actions_queue: Global Queue Master->Slave
:type actions_queue: Queue.Queue
:param re... | Wrapper function for do_work in order to catch the exception
to see the real work, look at do_work
:param actions_queue: Global Queue Master->Slave
:type actions_queue: Queue.Queue
:param returns_queue: queue managed by manager
:type returns_queue: Queue.Queue
:return: N... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L362-L384 |
Alignak-monitoring/alignak | alignak/worker.py | Worker.do_work | def do_work(self, actions_queue, returns_queue, control_queue=None): # pragma: no cover
"""Main function of the worker.
* Get checks
* Launch new checks
* Manage finished checks
:param actions_queue: Global Queue Master->Slave
:type actions_queue: Queue.Queue
:p... | python | def do_work(self, actions_queue, returns_queue, control_queue=None): # pragma: no cover
"""Main function of the worker.
* Get checks
* Launch new checks
* Manage finished checks
:param actions_queue: Global Queue Master->Slave
:type actions_queue: Queue.Queue
:p... | Main function of the worker.
* Get checks
* Launch new checks
* Manage finished checks
:param actions_queue: Global Queue Master->Slave
:type actions_queue: Queue.Queue
:param returns_queue: queue managed by manager
:type returns_queue: Queue.Queue
:retur... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L386-L466 |
Alignak-monitoring/alignak | setup.py | read_requirements | def read_requirements(filename='requirements.txt'):
"""Reads the list of requirements from given file.
:param filename: Filename to read the requirements from.
Uses ``'requirements.txt'`` by default.
:return: Requirments as list of strings.
"""
# allow for some leeway with the... | python | def read_requirements(filename='requirements.txt'):
"""Reads the list of requirements from given file.
:param filename: Filename to read the requirements from.
Uses ``'requirements.txt'`` by default.
:return: Requirments as list of strings.
"""
# allow for some leeway with the... | Reads the list of requirements from given file.
:param filename: Filename to read the requirements from.
Uses ``'requirements.txt'`` by default.
:return: Requirments as list of strings. | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/setup.py#L21-L48 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.init_running_properties | def init_running_properties(self):
"""
Initialize the running_properties.
Each instance have own property.
:return: None
"""
for prop, entry in list(self.__class__.running_properties.items()):
val = entry.default
# Make a copy of the value for com... | python | def init_running_properties(self):
"""
Initialize the running_properties.
Each instance have own property.
:return: None
"""
for prop, entry in list(self.__class__.running_properties.items()):
val = entry.default
# Make a copy of the value for com... | Initialize the running_properties.
Each instance have own property.
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L247-L258 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.copy | def copy(self):
"""
Get a copy of this item but with a new id
:return: copy of this object with a new id
:rtype: object
"""
# New dummy item with it's own running properties
copied_item = self.__class__({})
# Now, copy the properties
for prop in s... | python | def copy(self):
"""
Get a copy of this item but with a new id
:return: copy of this object with a new id
:rtype: object
"""
# New dummy item with it's own running properties
copied_item = self.__class__({})
# Now, copy the properties
for prop in s... | Get a copy of this item but with a new id
:return: copy of this object with a new id
:rtype: object | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L260-L287 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.clean | def clean(self):
"""
Clean properties only needed for initialization and configuration
:return: None
"""
for prop in ('imported_from', 'use', 'plus', 'templates', 'register'):
try:
delattr(self, prop)
except AttributeError:
... | python | def clean(self):
"""
Clean properties only needed for initialization and configuration
:return: None
"""
for prop in ('imported_from', 'use', 'plus', 'templates', 'register'):
try:
delattr(self, prop)
except AttributeError:
... | Clean properties only needed for initialization and configuration
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L289-L305 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.serialize | def serialize(self):
"""This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here is the generic function that simply export attributes declared in the
properties dictionary and the running_properties of the object... | python | def serialize(self):
"""This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here is the generic function that simply export attributes declared in the
properties dictionary and the running_properties of the object... | This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here is the generic function that simply export attributes declared in the
properties dictionary and the running_properties of the object.
:return: Dictionary c... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L327-L347 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.load_global_conf | def load_global_conf(cls, global_configuration):
"""
Apply global Alignak configuration.
Some objects inherit some properties from the global configuration if they do not
define their own value. E.g. the global 'accept_passive_service_checks' is inherited
by the services as 'acc... | python | def load_global_conf(cls, global_configuration):
"""
Apply global Alignak configuration.
Some objects inherit some properties from the global configuration if they do not
define their own value. E.g. the global 'accept_passive_service_checks' is inherited
by the services as 'acc... | Apply global Alignak configuration.
Some objects inherit some properties from the global configuration if they do not
define their own value. E.g. the global 'accept_passive_service_checks' is inherited
by the services as 'accept_passive_checks'
:param cls: parent object
:type ... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L350-L378 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.get_templates | def get_templates(self):
"""
Get list of templates this object use
:return: list of templates
:rtype: list
"""
use = getattr(self, 'use', '')
if isinstance(use, list):
return [n.strip() for n in use if n.strip()]
return [n.strip() for n in us... | python | def get_templates(self):
"""
Get list of templates this object use
:return: list of templates
:rtype: list
"""
use = getattr(self, 'use', '')
if isinstance(use, list):
return [n.strip() for n in use if n.strip()]
return [n.strip() for n in us... | Get list of templates this object use
:return: list of templates
:rtype: list | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L380-L391 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.get_all_plus_and_delete | def get_all_plus_and_delete(self):
"""
Get all self.plus items of list. We copy it, delete the original and return the copy list
:return: list of self.plus
:rtype: list
"""
res = {}
props = list(self.plus.keys()) # we delete entries, so no for ... in ...
... | python | def get_all_plus_and_delete(self):
"""
Get all self.plus items of list. We copy it, delete the original and return the copy list
:return: list of self.plus
:rtype: list
"""
res = {}
props = list(self.plus.keys()) # we delete entries, so no for ... in ...
... | Get all self.plus items of list. We copy it, delete the original and return the copy list
:return: list of self.plus
:rtype: list | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L409-L420 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.get_plus_and_delete | def get_plus_and_delete(self, prop):
"""
get a copy of the property (parameter) in self.plus, delete the original and return the
value of copy
:param prop: a property
:type prop: str
:return: return the value of the property
:rtype: str
"""
val = ... | python | def get_plus_and_delete(self, prop):
"""
get a copy of the property (parameter) in self.plus, delete the original and return the
value of copy
:param prop: a property
:type prop: str
:return: return the value of the property
:rtype: str
"""
val = ... | get a copy of the property (parameter) in self.plus, delete the original and return the
value of copy
:param prop: a property
:type prop: str
:return: return the value of the property
:rtype: str | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L422-L434 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.add_error | def add_error(self, txt):
"""Add a message in the configuration errors list so we can print them
all in one place
Set the object configuration as not correct
:param txt: error message
:type txt: str
:return: None
"""
self.configuration_errors.append(tx... | python | def add_error(self, txt):
"""Add a message in the configuration errors list so we can print them
all in one place
Set the object configuration as not correct
:param txt: error message
:type txt: str
:return: None
"""
self.configuration_errors.append(tx... | Add a message in the configuration errors list so we can print them
all in one place
Set the object configuration as not correct
:param txt: error message
:type txt: str
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L436-L447 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.is_correct | def is_correct(self):
"""
Check if this object is correct
This function:
- checks if the required properties are defined, ignoring special_properties if some exist
- logs the previously found warnings and errors
:return: True if it's correct, otherwise False
:rt... | python | def is_correct(self):
"""
Check if this object is correct
This function:
- checks if the required properties are defined, ignoring special_properties if some exist
- logs the previously found warnings and errors
:return: True if it's correct, otherwise False
:rt... | Check if this object is correct
This function:
- checks if the required properties are defined, ignoring special_properties if some exist
- logs the previously found warnings and errors
:return: True if it's correct, otherwise False
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L459-L481 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.old_properties_names_to_new | def old_properties_names_to_new(self):
"""
This function is used by service and hosts to transform Nagios2 parameters to Nagios3
ones, like normal_check_interval to check_interval. There is a old_parameters tab
in Classes that give such modifications to do.
:return: None
... | python | def old_properties_names_to_new(self):
"""
This function is used by service and hosts to transform Nagios2 parameters to Nagios3
ones, like normal_check_interval to check_interval. There is a old_parameters tab
in Classes that give such modifications to do.
:return: None
... | This function is used by service and hosts to transform Nagios2 parameters to Nagios3
ones, like normal_check_interval to check_interval. There is a old_parameters tab
in Classes that give such modifications to do.
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L483-L498 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.get_raw_import_values | def get_raw_import_values(self): # pragma: no cover, never used
"""
Get properties => values of this object
TODO: never called anywhere, still useful?
:return: dictionary of properties => values
:rtype: dict
"""
res = {}
properties = list(self.__class__... | python | def get_raw_import_values(self): # pragma: no cover, never used
"""
Get properties => values of this object
TODO: never called anywhere, still useful?
:return: dictionary of properties => values
:rtype: dict
"""
res = {}
properties = list(self.__class__... | Get properties => values of this object
TODO: never called anywhere, still useful?
:return: dictionary of properties => values
:rtype: dict | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L500-L519 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.del_downtime | def del_downtime(self, downtime_id):
"""
Delete a downtime in this object
:param downtime_id: id of the downtime to delete
:type downtime_id: int
:return: None
"""
if downtime_id in self.downtimes:
self.downtimes[downtime_id].can_be_deleted = True
... | python | def del_downtime(self, downtime_id):
"""
Delete a downtime in this object
:param downtime_id: id of the downtime to delete
:type downtime_id: int
:return: None
"""
if downtime_id in self.downtimes:
self.downtimes[downtime_id].can_be_deleted = True
... | Delete a downtime in this object
:param downtime_id: id of the downtime to delete
:type downtime_id: int
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L531-L541 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.get_property_value_for_brok | def get_property_value_for_brok(self, prop, tab):
"""
Get the property of an object and brok_transformation if needed and return the value
:param prop: property name
:type prop: str
:param tab: object with all properties of an object
:type tab: object
:return: va... | python | def get_property_value_for_brok(self, prop, tab):
"""
Get the property of an object and brok_transformation if needed and return the value
:param prop: property name
:type prop: str
:param tab: object with all properties of an object
:type tab: object
:return: va... | Get the property of an object and brok_transformation if needed and return the value
:param prop: property name
:type prop: str
:param tab: object with all properties of an object
:type tab: object
:return: value of the property original or brok converted
:rtype: str | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L564-L585 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.fill_data_brok_from | def fill_data_brok_from(self, data, brok_type):
"""
Add properties to 'data' parameter with properties of this object when 'brok_type'
parameter is defined in fill_brok of these properties
:param data: object to fill
:type data: object
:param brok_type: name of brok_type... | python | def fill_data_brok_from(self, data, brok_type):
"""
Add properties to 'data' parameter with properties of this object when 'brok_type'
parameter is defined in fill_brok of these properties
:param data: object to fill
:type data: object
:param brok_type: name of brok_type... | Add properties to 'data' parameter with properties of this object when 'brok_type'
parameter is defined in fill_brok of these properties
:param data: object to fill
:type data: object
:param brok_type: name of brok_type
:type brok_type: var
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L587-L611 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.get_initial_status_brok | def get_initial_status_brok(self, extra=None):
"""
Create an initial status brok
:param extra: some extra information to be added in the brok data
:type extra: dict
:return: Brok object
:rtype: alignak.Brok
"""
data = {'uuid': self.uuid}
self.fill... | python | def get_initial_status_brok(self, extra=None):
"""
Create an initial status brok
:param extra: some extra information to be added in the brok data
:type extra: dict
:return: Brok object
:rtype: alignak.Brok
"""
data = {'uuid': self.uuid}
self.fill... | Create an initial status brok
:param extra: some extra information to be added in the brok data
:type extra: dict
:return: Brok object
:rtype: alignak.Brok | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L613-L626 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.get_update_status_brok | def get_update_status_brok(self):
"""
Create an update item brok
:return: Brok object
:rtype: alignak.Brok
"""
data = {'uuid': self.uuid}
self.fill_data_brok_from(data, 'full_status')
return Brok({'type': 'update_' + self.my_type + '_status', 'data': data... | python | def get_update_status_brok(self):
"""
Create an update item brok
:return: Brok object
:rtype: alignak.Brok
"""
data = {'uuid': self.uuid}
self.fill_data_brok_from(data, 'full_status')
return Brok({'type': 'update_' + self.my_type + '_status', 'data': data... | Create an update item brok
:return: Brok object
:rtype: alignak.Brok | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L639-L648 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.get_check_result_brok | def get_check_result_brok(self):
"""
Create check_result brok
:return: Brok object
:rtype: alignak.Brok
"""
data = {'uuid': self.uuid}
self.fill_data_brok_from(data, 'check_result')
return Brok({'type': self.my_type + '_check_result', 'data': data}) | python | def get_check_result_brok(self):
"""
Create check_result brok
:return: Brok object
:rtype: alignak.Brok
"""
data = {'uuid': self.uuid}
self.fill_data_brok_from(data, 'check_result')
return Brok({'type': self.my_type + '_check_result', 'data': data}) | Create check_result brok
:return: Brok object
:rtype: alignak.Brok | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L650-L659 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.get_next_schedule_brok | def get_next_schedule_brok(self):
"""
Create next_schedule (next check) brok
:return: Brok object
:rtype: alignak.Brok
"""
data = {'uuid': self.uuid}
self.fill_data_brok_from(data, 'next_schedule')
return Brok({'type': self.my_type + '_next_schedule', 'da... | python | def get_next_schedule_brok(self):
"""
Create next_schedule (next check) brok
:return: Brok object
:rtype: alignak.Brok
"""
data = {'uuid': self.uuid}
self.fill_data_brok_from(data, 'next_schedule')
return Brok({'type': self.my_type + '_next_schedule', 'da... | Create next_schedule (next check) brok
:return: Brok object
:rtype: alignak.Brok | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L661-L670 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.get_snapshot_brok | def get_snapshot_brok(self, snap_output, exit_status):
"""
Create snapshot (check_result type) brok
:param snap_output: value of output
:type snap_output: str
:param exit_status: status of exit
:type exit_status: integer
:return: Brok object
:rtype: align... | python | def get_snapshot_brok(self, snap_output, exit_status):
"""
Create snapshot (check_result type) brok
:param snap_output: value of output
:type snap_output: str
:param exit_status: status of exit
:type exit_status: integer
:return: Brok object
:rtype: align... | Create snapshot (check_result type) brok
:param snap_output: value of output
:type snap_output: str
:param exit_status: status of exit
:type exit_status: integer
:return: Brok object
:rtype: alignak.Brok | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L672-L690 |
Alignak-monitoring/alignak | alignak/objects/item.py | Item.dump | def dump(self, dump_file_name=None): # pragma: no cover, never called
# pylint: disable=unused-argument
"""
Dump Item object properties
:return: dictionary with properties
:rtype: dict
"""
dump = {}
for prop in self.properties:
if not hasattr... | python | def dump(self, dump_file_name=None): # pragma: no cover, never called
# pylint: disable=unused-argument
"""
Dump Item object properties
:return: dictionary with properties
:rtype: dict
"""
dump = {}
for prop in self.properties:
if not hasattr... | Dump Item object properties
:return: dictionary with properties
:rtype: dict | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L692-L711 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.add_items | def add_items(self, items, index_items):
"""
Add items to template if is template, else add in item list
:param items: items list to add
:type items: alignak.objects.item.Items
:param index_items: Flag indicating if the items should be indexed on the fly.
:type index_ite... | python | def add_items(self, items, index_items):
"""
Add items to template if is template, else add in item list
:param items: items list to add
:type items: alignak.objects.item.Items
:param index_items: Flag indicating if the items should be indexed on the fly.
:type index_ite... | Add items to template if is template, else add in item list
:param items: items list to add
:type items: alignak.objects.item.Items
:param index_items: Flag indicating if the items should be indexed on the fly.
:type index_items: bool
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L816-L841 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.manage_conflict | def manage_conflict(self, item, name):
"""
Checks if an object holding the same name already exists in the index.
If so, it compares their definition order: the lowest definition order
is kept. If definition order equal, an error is risen.Item
The method returns the item that s... | python | def manage_conflict(self, item, name):
"""
Checks if an object holding the same name already exists in the index.
If so, it compares their definition order: the lowest definition order
is kept. If definition order equal, an error is risen.Item
The method returns the item that s... | Checks if an object holding the same name already exists in the index.
If so, it compares their definition order: the lowest definition order
is kept. If definition order equal, an error is risen.Item
The method returns the item that should be added after it has decided
which one shoul... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L843-L896 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.add_template | def add_template(self, tpl):
"""
Add and index a template into the `templates` container.
:param tpl: The template to add
:type tpl: alignak.objects.item.Item
:return: None
"""
tpl = self.index_template(tpl)
self.templates[tpl.uuid] = tpl | python | def add_template(self, tpl):
"""
Add and index a template into the `templates` container.
:param tpl: The template to add
:type tpl: alignak.objects.item.Item
:return: None
"""
tpl = self.index_template(tpl)
self.templates[tpl.uuid] = tpl | Add and index a template into the `templates` container.
:param tpl: The template to add
:type tpl: alignak.objects.item.Item
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L898-L907 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.index_template | def index_template(self, tpl):
"""
Indexes a template by `name` into the `name_to_template` dictionary.
:param tpl: The template to index
:type tpl: alignak.objects.item.Item
:return: None
"""
objcls = self.inner_class.my_type
name = getattr(tpl, 'name', ... | python | def index_template(self, tpl):
"""
Indexes a template by `name` into the `name_to_template` dictionary.
:param tpl: The template to index
:type tpl: alignak.objects.item.Item
:return: None
"""
objcls = self.inner_class.my_type
name = getattr(tpl, 'name', ... | Indexes a template by `name` into the `name_to_template` dictionary.
:param tpl: The template to index
:type tpl: alignak.objects.item.Item
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L909-L928 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.remove_template | def remove_template(self, tpl):
"""
Removes and un-index a template from the `templates` container.
:param tpl: The template to remove
:type tpl: alignak.objects.item.Item
:return: None
"""
try:
del self.templates[tpl.uuid]
except KeyError: #... | python | def remove_template(self, tpl):
"""
Removes and un-index a template from the `templates` container.
:param tpl: The template to remove
:type tpl: alignak.objects.item.Item
:return: None
"""
try:
del self.templates[tpl.uuid]
except KeyError: #... | Removes and un-index a template from the `templates` container.
:param tpl: The template to remove
:type tpl: alignak.objects.item.Item
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L930-L942 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.unindex_template | def unindex_template(self, tpl):
"""
Unindex a template from the `templates` container.
:param tpl: The template to un-index
:type tpl: alignak.objects.item.Item
:return: None
"""
name = getattr(tpl, 'name', '')
try:
del self.name_to_template[... | python | def unindex_template(self, tpl):
"""
Unindex a template from the `templates` container.
:param tpl: The template to un-index
:type tpl: alignak.objects.item.Item
:return: None
"""
name = getattr(tpl, 'name', '')
try:
del self.name_to_template[... | Unindex a template from the `templates` container.
:param tpl: The template to un-index
:type tpl: alignak.objects.item.Item
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L944-L956 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.add_item | def add_item(self, item, index=True):
# pylint: disable=too-many-branches, too-many-locals, too-many-nested-blocks
"""
Add an item into our containers, and index it depending on the `index` flag.
:param item: object to add
:type item: alignak.objects.item.Item
:param ind... | python | def add_item(self, item, index=True):
# pylint: disable=too-many-branches, too-many-locals, too-many-nested-blocks
"""
Add an item into our containers, and index it depending on the `index` flag.
:param item: object to add
:type item: alignak.objects.item.Item
:param ind... | Add an item into our containers, and index it depending on the `index` flag.
:param item: object to add
:type item: alignak.objects.item.Item
:param index: Flag indicating if the item should be indexed
:type index: bool
:return: the new items created
:rtype list | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L958-L1029 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.remove_item | def remove_item(self, item):
"""
Remove (and un-index) an object
:param item: object to remove
:type item: alignak.objects.item.Item
:return: None
"""
self.unindex_item(item)
self.items.pop(item.uuid, None) | python | def remove_item(self, item):
"""
Remove (and un-index) an object
:param item: object to remove
:type item: alignak.objects.item.Item
:return: None
"""
self.unindex_item(item)
self.items.pop(item.uuid, None) | Remove (and un-index) an object
:param item: object to remove
:type item: alignak.objects.item.Item
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1031-L1040 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.index_item | def index_item(self, item):
"""
Index an item into our `name_to_item` dictionary.
If an object holding the same item's name/key already exists in the index
then the conflict is managed by the `manage_conflict` method.
:param item: item to index
:type item: alignak.object... | python | def index_item(self, item):
"""
Index an item into our `name_to_item` dictionary.
If an object holding the same item's name/key already exists in the index
then the conflict is managed by the `manage_conflict` method.
:param item: item to index
:type item: alignak.object... | Index an item into our `name_to_item` dictionary.
If an object holding the same item's name/key already exists in the index
then the conflict is managed by the `manage_conflict` method.
:param item: item to index
:type item: alignak.objects.item.Item
:return: item modified
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1042-L1064 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.unindex_item | def unindex_item(self, item):
"""
Un-index an item from our name_to_item dict.
:param item: the item to un-index
:type item: alignak.objects.item.Item
:return: None
"""
name_property = getattr(self.__class__, "name_property", None)
if name_property is None... | python | def unindex_item(self, item):
"""
Un-index an item from our name_to_item dict.
:param item: the item to un-index
:type item: alignak.objects.item.Item
:return: None
"""
name_property = getattr(self.__class__, "name_property", None)
if name_property is None... | Un-index an item from our name_to_item dict.
:param item: the item to un-index
:type item: alignak.objects.item.Item
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1066-L1079 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.old_properties_names_to_new | def old_properties_names_to_new(self): # pragma: no cover, never called
"""Convert old Nagios2 names to Nagios3 new names
TODO: still useful?
:return: None
"""
for i in itertools.chain(iter(list(self.items.values())),
iter(list(self.templates.v... | python | def old_properties_names_to_new(self): # pragma: no cover, never called
"""Convert old Nagios2 names to Nagios3 new names
TODO: still useful?
:return: None
"""
for i in itertools.chain(iter(list(self.items.values())),
iter(list(self.templates.v... | Convert old Nagios2 names to Nagios3 new names
TODO: still useful?
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1092-L1101 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.get_all_tags | def get_all_tags(self, item):
"""
Get all tags of an item
:param item: an item
:type item: Item
:return: list of tags
:rtype: list
"""
all_tags = item.get_templates()
for template_id in item.templates:
template = self.templates[templa... | python | def get_all_tags(self, item):
"""
Get all tags of an item
:param item: an item
:type item: Item
:return: list of tags
:rtype: list
"""
all_tags = item.get_templates()
for template_id in item.templates:
template = self.templates[templa... | Get all tags of an item
:param item: an item
:type item: Item
:return: list of tags
:rtype: list | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1114-L1129 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.linkify_item_templates | def linkify_item_templates(self, item):
"""
Link templates
:param item: an item
:type item: alignak.objects.item.Item
:return: None
"""
tpls = []
tpl_names = item.get_templates()
for name in tpl_names:
template = self.find_tpl_by_name... | python | def linkify_item_templates(self, item):
"""
Link templates
:param item: an item
:type item: alignak.objects.item.Item
:return: None
"""
tpls = []
tpl_names = item.get_templates()
for name in tpl_names:
template = self.find_tpl_by_name... | Link templates
:param item: an item
:type item: alignak.objects.item.Item
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1131-L1154 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.linkify_templates | def linkify_templates(self):
"""
Link all templates, and create the template graph too
:return: None
"""
# First we create a list of all templates
for i in itertools.chain(iter(list(self.items.values())),
iter(list(self.templates.values()... | python | def linkify_templates(self):
"""
Link all templates, and create the template graph too
:return: None
"""
# First we create a list of all templates
for i in itertools.chain(iter(list(self.items.values())),
iter(list(self.templates.values()... | Link all templates, and create the template graph too
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1156-L1167 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.is_correct | def is_correct(self):
"""
Check if the items list configuration is correct ::
* check if duplicate items exist in the list and warn about this
* set alias and display_name property for each item in the list if they do not exist
* check each item in the list
* log all pre... | python | def is_correct(self):
"""
Check if the items list configuration is correct ::
* check if duplicate items exist in the list and warn about this
* set alias and display_name property for each item in the list if they do not exist
* check each item in the list
* log all pre... | Check if the items list configuration is correct ::
* check if duplicate items exist in the list and warn about this
* set alias and display_name property for each item in the list if they do not exist
* check each item in the list
* log all previous warnings
* log all previous ... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1169-L1216 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.serialize | def serialize(self):
"""This function serialize items into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here is the generic function that simply serialize each item of the items object
:return: Dictionary containing item's uuid as key... | python | def serialize(self):
"""This function serialize items into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here is the generic function that simply serialize each item of the items object
:return: Dictionary containing item's uuid as key... | This function serialize items into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here is the generic function that simply serialize each item of the items object
:return: Dictionary containing item's uuid as key and item as value
:rtyp... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1244-L1256 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.apply_partial_inheritance | def apply_partial_inheritance(self, prop):
"""
Define property with inheritance value of the property
:param prop: property
:type prop: str
:return: None
"""
for i in itertools.chain(iter(list(self.items.values())),
iter(list(self... | python | def apply_partial_inheritance(self, prop):
"""
Define property with inheritance value of the property
:param prop: property
:type prop: str
:return: None
"""
for i in itertools.chain(iter(list(self.items.values())),
iter(list(self... | Define property with inheritance value of the property
:param prop: property
:type prop: str
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1258-L1274 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.apply_inheritance | def apply_inheritance(self):
"""
For all items and templates inherit properties and custom variables.
:return: None
"""
# We check for all Class properties if the host has it
# if not, it check all host templates for a value
cls = self.inner_class
for pro... | python | def apply_inheritance(self):
"""
For all items and templates inherit properties and custom variables.
:return: None
"""
# We check for all Class properties if the host has it
# if not, it check all host templates for a value
cls = self.inner_class
for pro... | For all items and templates inherit properties and custom variables.
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1276-L1289 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.linkify_with_contacts | def linkify_with_contacts(self, contacts):
"""
Link items with contacts items
:param contacts: all contacts object
:type contacts: alignak.objects.contact.Contacts
:return: None
"""
for i in self:
if not hasattr(i, 'contacts'):
continu... | python | def linkify_with_contacts(self, contacts):
"""
Link items with contacts items
:param contacts: all contacts object
:type contacts: alignak.objects.contact.Contacts
:return: None
"""
for i in self:
if not hasattr(i, 'contacts'):
continu... | Link items with contacts items
:param contacts: all contacts object
:type contacts: alignak.objects.contact.Contacts
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1291-L1313 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.linkify_with_escalations | def linkify_with_escalations(self, escalations):
"""
Link with escalations
:param escalations: all escalations object
:type escalations: alignak.objects.escalation.Escalations
:return: None
"""
for i in self:
if not hasattr(i, 'escalations'):
... | python | def linkify_with_escalations(self, escalations):
"""
Link with escalations
:param escalations: all escalations object
:type escalations: alignak.objects.escalation.Escalations
:return: None
"""
for i in self:
if not hasattr(i, 'escalations'):
... | Link with escalations
:param escalations: all escalations object
:type escalations: alignak.objects.escalation.Escalations
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1315-L1337 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.explode_contact_groups_into_contacts | def explode_contact_groups_into_contacts(item, contactgroups):
"""
Get all contacts of contact_groups and put them in contacts container
:param item: item where have contact_groups property
:type item: object
:param contactgroups: all contactgroups object
:type contactgr... | python | def explode_contact_groups_into_contacts(item, contactgroups):
"""
Get all contacts of contact_groups and put them in contacts container
:param item: item where have contact_groups property
:type item: object
:param contactgroups: all contactgroups object
:type contactgr... | Get all contacts of contact_groups and put them in contacts container
:param item: item where have contact_groups property
:type item: object
:param contactgroups: all contactgroups object
:type contactgroups: alignak.objects.contactgroup.Contactgroups
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1390-L1425 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.linkify_with_timeperiods | def linkify_with_timeperiods(self, timeperiods, prop):
"""
Link items with timeperiods items
:param timeperiods: all timeperiods object
:type timeperiods: alignak.objects.timeperiod.Timeperiods
:param prop: property name
:type prop: str
:return: None
"""
... | python | def linkify_with_timeperiods(self, timeperiods, prop):
"""
Link items with timeperiods items
:param timeperiods: all timeperiods object
:type timeperiods: alignak.objects.timeperiod.Timeperiods
:param prop: property name
:type prop: str
:return: None
"""
... | Link items with timeperiods items
:param timeperiods: all timeperiods object
:type timeperiods: alignak.objects.timeperiod.Timeperiods
:param prop: property name
:type prop: str
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1427-L1454 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.linkify_with_checkmodulations | def linkify_with_checkmodulations(self, checkmodulations):
"""
Link checkmodulation object
:param checkmodulations: checkmodulations object
:type checkmodulations: alignak.objects.checkmodulation.Checkmodulations
:return: None
"""
for i in self:
if no... | python | def linkify_with_checkmodulations(self, checkmodulations):
"""
Link checkmodulation object
:param checkmodulations: checkmodulations object
:type checkmodulations: alignak.objects.checkmodulation.Checkmodulations
:return: None
"""
for i in self:
if no... | Link checkmodulation object
:param checkmodulations: checkmodulations object
:type checkmodulations: alignak.objects.checkmodulation.Checkmodulations
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1456-L1478 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.linkify_s_by_module | def linkify_s_by_module(self, modules):
"""
Link modules to items
:param modules: Modules object (list of all the modules found in the configuration)
:type modules: alignak.objects.module.Modules
:return: None
"""
for i in self:
links_list = strip_an... | python | def linkify_s_by_module(self, modules):
"""
Link modules to items
:param modules: Modules object (list of all the modules found in the configuration)
:type modules: alignak.objects.module.Modules
:return: None
"""
for i in self:
links_list = strip_an... | Link modules to items
:param modules: Modules object (list of all the modules found in the configuration)
:type modules: alignak.objects.module.Modules
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1504-L1523 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.evaluate_hostgroup_expression | def evaluate_hostgroup_expression(expr, hosts, hostgroups, look_in='hostgroups'):
"""
Evaluate hostgroup expression
:param expr: an expression
:type expr: str
:param hosts: hosts object (all hosts)
:type hosts: alignak.objects.host.Hosts
:param hostgroups: hostgr... | python | def evaluate_hostgroup_expression(expr, hosts, hostgroups, look_in='hostgroups'):
"""
Evaluate hostgroup expression
:param expr: an expression
:type expr: str
:param hosts: hosts object (all hosts)
:type hosts: alignak.objects.host.Hosts
:param hostgroups: hostgr... | Evaluate hostgroup expression
:param expr: an expression
:type expr: str
:param hosts: hosts object (all hosts)
:type hosts: alignak.objects.host.Hosts
:param hostgroups: hostgroups object (all hostgroups)
:type hostgroups: alignak.objects.hostgroup.Hostgroups
:p... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1526-L1553 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.get_hosts_from_hostgroups | def get_hosts_from_hostgroups(hgname, hostgroups):
"""
Get hosts of hostgroups
:param hgname: hostgroup name
:type hgname: str
:param hostgroups: hostgroups object (all hostgroups)
:type hostgroups: alignak.objects.hostgroup.Hostgroups
:return: list of hosts
... | python | def get_hosts_from_hostgroups(hgname, hostgroups):
"""
Get hosts of hostgroups
:param hgname: hostgroup name
:type hgname: str
:param hostgroups: hostgroups object (all hostgroups)
:type hostgroups: alignak.objects.hostgroup.Hostgroups
:return: list of hosts
... | Get hosts of hostgroups
:param hgname: hostgroup name
:type hgname: str
:param hostgroups: hostgroups object (all hostgroups)
:type hostgroups: alignak.objects.hostgroup.Hostgroups
:return: list of hosts
:rtype: list | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1556-L1578 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.explode_host_groups_into_hosts | def explode_host_groups_into_hosts(self, item, hosts, hostgroups):
"""
Get all hosts of hostgroups and add all in host_name container
:param item: the item object
:type item: alignak.objects.item.Item
:param hosts: hosts object
:type hosts: alignak.objects.host.Hosts
... | python | def explode_host_groups_into_hosts(self, item, hosts, hostgroups):
"""
Get all hosts of hostgroups and add all in host_name container
:param item: the item object
:type item: alignak.objects.item.Item
:param hosts: hosts object
:type hosts: alignak.objects.host.Hosts
... | Get all hosts of hostgroups and add all in host_name container
:param item: the item object
:type item: alignak.objects.item.Item
:param hosts: hosts object
:type hosts: alignak.objects.host.Hosts
:param hostgroups: hostgroups object
:type hostgroups: alignak.objects.hos... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1580-L1629 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.no_loop_in_parents | def no_loop_in_parents(self, attr1, attr2):
# pylint: disable=too-many-branches
"""
Find loop in dependencies.
For now, used with the following attributes :
:(self, parents):
host dependencies from host object
:(host_name, dependent_host_name):\
ho... | python | def no_loop_in_parents(self, attr1, attr2):
# pylint: disable=too-many-branches
"""
Find loop in dependencies.
For now, used with the following attributes :
:(self, parents):
host dependencies from host object
:(host_name, dependent_host_name):\
ho... | Find loop in dependencies.
For now, used with the following attributes :
:(self, parents):
host dependencies from host object
:(host_name, dependent_host_name):\
host dependencies from hostdependencies object
:(service_description, dependent_service_description):
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1631-L1693 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.get_property_by_inheritance | def get_property_by_inheritance(self, obj, prop):
# pylint: disable=too-many-branches, too-many-nested-blocks
"""
Get the property asked in parameter to this object or from defined templates of this
object
todo: rewrite this function which is really too complex!
:param ... | python | def get_property_by_inheritance(self, obj, prop):
# pylint: disable=too-many-branches, too-many-nested-blocks
"""
Get the property asked in parameter to this object or from defined templates of this
object
todo: rewrite this function which is really too complex!
:param ... | Get the property asked in parameter to this object or from defined templates of this
object
todo: rewrite this function which is really too complex!
:param obj: the object to search the property
:type obj: alignak.objects.item.Item
:param prop: name of property
:type pr... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1695-L1851 |
Alignak-monitoring/alignak | alignak/objects/item.py | Items.get_customs_properties_by_inheritance | def get_customs_properties_by_inheritance(self, obj):
"""
Get custom properties from the templates defined in this object
:param obj: the oject to search the property
:type obj: alignak.objects.item.Item
:return: list of custom properties
:rtype: list
"""
... | python | def get_customs_properties_by_inheritance(self, obj):
"""
Get custom properties from the templates defined in this object
:param obj: the oject to search the property
:type obj: alignak.objects.item.Item
:return: list of custom properties
:rtype: list
"""
... | Get custom properties from the templates defined in this object
:param obj: the oject to search the property
:type obj: alignak.objects.item.Item
:return: list of custom properties
:rtype: list | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1853-L1886 |
Alignak-monitoring/alignak | alignak/graph.py | Graph.add_edge | def add_edge(self, from_node, to_node):
"""Add edge between two node
The edge is oriented
:param from_node: node where edge starts
:type from_node: object
:param to_node: node where edge ends
:type to_node: object
:return: None
"""
# Maybe to_node... | python | def add_edge(self, from_node, to_node):
"""Add edge between two node
The edge is oriented
:param from_node: node where edge starts
:type from_node: object
:param to_node: node where edge ends
:type to_node: object
:return: None
"""
# Maybe to_node... | Add edge between two node
The edge is oriented
:param from_node: node where edge starts
:type from_node: object
:param to_node: node where edge ends
:type to_node: object
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/graph.py#L81-L99 |
Alignak-monitoring/alignak | alignak/graph.py | Graph.loop_check | def loop_check(self):
"""Check if we have a loop in the graph
:return: Nodes in loop
:rtype: list
"""
in_loop = []
# Add the tag for dfs check
for node in list(self.nodes.values()):
node['dfs_loop_status'] = 'DFS_UNCHECKED'
# Now do the job
... | python | def loop_check(self):
"""Check if we have a loop in the graph
:return: Nodes in loop
:rtype: list
"""
in_loop = []
# Add the tag for dfs check
for node in list(self.nodes.values()):
node['dfs_loop_status'] = 'DFS_UNCHECKED'
# Now do the job
... | Check if we have a loop in the graph
:return: Nodes in loop
:rtype: list | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/graph.py#L101-L125 |
Alignak-monitoring/alignak | alignak/graph.py | Graph.dfs_loop_search | def dfs_loop_search(self, root):
"""Main algorithm to look for loop.
It tags nodes and find ones stuck in loop.
* Init all nodes with DFS_UNCHECKED value
* DFS_TEMPORARY_CHECKED means we found it once
* DFS_OK : this node (and all sons) are fine
* DFS_NEAR_LOOP : One pro... | python | def dfs_loop_search(self, root):
"""Main algorithm to look for loop.
It tags nodes and find ones stuck in loop.
* Init all nodes with DFS_UNCHECKED value
* DFS_TEMPORARY_CHECKED means we found it once
* DFS_OK : this node (and all sons) are fine
* DFS_NEAR_LOOP : One pro... | Main algorithm to look for loop.
It tags nodes and find ones stuck in loop.
* Init all nodes with DFS_UNCHECKED value
* DFS_TEMPORARY_CHECKED means we found it once
* DFS_OK : this node (and all sons) are fine
* DFS_NEAR_LOOP : One problem was found in of of the son
* DF... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/graph.py#L127-L170 |
Alignak-monitoring/alignak | alignak/graph.py | Graph.get_accessibility_packs | def get_accessibility_packs(self):
"""Get accessibility packs of the graph:
in one pack element are related in a way. Between packs, there is no relation at all.
TODO: Make it work for directional graph too
Because for now, edge must be father->son AND son->father
:return: packs... | python | def get_accessibility_packs(self):
"""Get accessibility packs of the graph:
in one pack element are related in a way. Between packs, there is no relation at all.
TODO: Make it work for directional graph too
Because for now, edge must be father->son AND son->father
:return: packs... | Get accessibility packs of the graph:
in one pack element are related in a way. Between packs, there is no relation at all.
TODO: Make it work for directional graph too
Because for now, edge must be father->son AND son->father
:return: packs of nodes
:rtype: list | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/graph.py#L172-L195 |
Alignak-monitoring/alignak | alignak/graph.py | Graph.dfs_get_all_childs | def dfs_get_all_childs(self, root):
"""Recursively get all sons of this node
:param root: node to get sons
:type root:
:return: sons
:rtype: list
"""
self.nodes[root]['dfs_loop_status'] = 'DFS_CHECKED'
ret = set()
# Me
ret.add(root)
... | python | def dfs_get_all_childs(self, root):
"""Recursively get all sons of this node
:param root: node to get sons
:type root:
:return: sons
:rtype: list
"""
self.nodes[root]['dfs_loop_status'] = 'DFS_CHECKED'
ret = set()
# Me
ret.add(root)
... | Recursively get all sons of this node
:param root: node to get sons
:type root:
:return: sons
:rtype: list | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/graph.py#L197-L218 |
Alignak-monitoring/alignak | alignak/http/generic_interface.py | GenericInterface.identity | def identity(self):
"""Get the daemon identity
This will return an object containing some properties:
- alignak: the Alignak instance name
- version: the Alignak version
- type: the daemon type
- name: the daemon name
:return: daemon identity
:rtype: dic... | python | def identity(self):
"""Get the daemon identity
This will return an object containing some properties:
- alignak: the Alignak instance name
- version: the Alignak version
- type: the daemon type
- name: the daemon name
:return: daemon identity
:rtype: dic... | Get the daemon identity
This will return an object containing some properties:
- alignak: the Alignak instance name
- version: the Alignak version
- type: the daemon type
- name: the daemon name
:return: daemon identity
:rtype: dict | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L76-L91 |
Alignak-monitoring/alignak | alignak/http/generic_interface.py | GenericInterface.api | def api(self):
"""List the methods available on the daemon Web service interface
:return: a list of methods and parameters
:rtype: dict
"""
functions = [x[0]for x in inspect.getmembers(self, predicate=inspect.ismethod)
if not x[0].startswith('_')]
f... | python | def api(self):
"""List the methods available on the daemon Web service interface
:return: a list of methods and parameters
:rtype: dict
"""
functions = [x[0]for x in inspect.getmembers(self, predicate=inspect.ismethod)
if not x[0].startswith('_')]
f... | List the methods available on the daemon Web service interface
:return: a list of methods and parameters
:rtype: dict | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L95-L138 |
Alignak-monitoring/alignak | alignak/http/generic_interface.py | GenericInterface.stop_request | def stop_request(self, stop_now='0'):
"""Request the daemon to stop
If `stop_now` is set to '1' the daemon will stop now. Else, the daemon
will enter the stop wait mode. In this mode the daemon stops its activity and
waits until it receives a new `stop_now` request to stop really.
... | python | def stop_request(self, stop_now='0'):
"""Request the daemon to stop
If `stop_now` is set to '1' the daemon will stop now. Else, the daemon
will enter the stop wait mode. In this mode the daemon stops its activity and
waits until it receives a new `stop_now` request to stop really.
... | Request the daemon to stop
If `stop_now` is set to '1' the daemon will stop now. Else, the daemon
will enter the stop wait mode. In this mode the daemon stops its activity and
waits until it receives a new `stop_now` request to stop really.
:param stop_now: stop now or go to stop wait ... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L143-L157 |
Alignak-monitoring/alignak | alignak/http/generic_interface.py | GenericInterface.get_log_level | def get_log_level(self):
"""Get the current daemon log level
Returns an object with the daemon identity and a `log_level` property.
running_id
:return: current log level
:rtype: str
"""
level_names = {
logging.DEBUG: 'DEBUG', logging.INFO: 'INFO', lo... | python | def get_log_level(self):
"""Get the current daemon log level
Returns an object with the daemon identity and a `log_level` property.
running_id
:return: current log level
:rtype: str
"""
level_names = {
logging.DEBUG: 'DEBUG', logging.INFO: 'INFO', lo... | Get the current daemon log level
Returns an object with the daemon identity and a `log_level` property.
running_id
:return: current log level
:rtype: str | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L161-L179 |
Alignak-monitoring/alignak | alignak/http/generic_interface.py | GenericInterface.set_log_level | def set_log_level(self, log_level=None):
"""Set the current log level for the daemon
The `log_level` parameter must be in [DEBUG, INFO, WARNING, ERROR, CRITICAL]
In case of any error, this function returns an object containing some properties:
'_status': 'ERR' because of the error
... | python | def set_log_level(self, log_level=None):
"""Set the current log level for the daemon
The `log_level` parameter must be in [DEBUG, INFO, WARNING, ERROR, CRITICAL]
In case of any error, this function returns an object containing some properties:
'_status': 'ERR' because of the error
... | Set the current log level for the daemon
The `log_level` parameter must be in [DEBUG, INFO, WARNING, ERROR, CRITICAL]
In case of any error, this function returns an object containing some properties:
'_status': 'ERR' because of the error
`_message`: some more explanations about the err... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L184-L209 |
Alignak-monitoring/alignak | alignak/http/generic_interface.py | GenericInterface.stats | def stats(self, details=False):
"""Get statistics and information from the daemon
Returns an object with the daemon identity, the daemon start_time
and some extra properties depending upon the daemon type.
All daemons provide these ones:
- program_start: the Alignak start times... | python | def stats(self, details=False):
"""Get statistics and information from the daemon
Returns an object with the daemon identity, the daemon start_time
and some extra properties depending upon the daemon type.
All daemons provide these ones:
- program_start: the Alignak start times... | Get statistics and information from the daemon
Returns an object with the daemon identity, the daemon start_time
and some extra properties depending upon the daemon type.
All daemons provide these ones:
- program_start: the Alignak start timestamp
- spare: to indicate if the da... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L240-L263 |
Alignak-monitoring/alignak | alignak/http/generic_interface.py | GenericInterface._wait_new_conf | def _wait_new_conf(self):
"""Ask the daemon to drop its configuration and wait for a new one
:return: None
"""
with self.app.conf_lock:
logger.debug("My Arbiter wants me to wait for a new configuration.")
# Clear can occur while setting up a new conf and lead to ... | python | def _wait_new_conf(self):
"""Ask the daemon to drop its configuration and wait for a new one
:return: None
"""
with self.app.conf_lock:
logger.debug("My Arbiter wants me to wait for a new configuration.")
# Clear can occur while setting up a new conf and lead to ... | Ask the daemon to drop its configuration and wait for a new one
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L276-L285 |
Alignak-monitoring/alignak | alignak/http/generic_interface.py | GenericInterface._push_configuration | def _push_configuration(self, pushed_configuration=None):
"""Send a new configuration to the daemon
This function is not intended for external use. It is quite complex to
build a configuration for a daemon and it is the arbiter dispatcher job ;)
:param pushed_configuration: new conf to... | python | def _push_configuration(self, pushed_configuration=None):
"""Send a new configuration to the daemon
This function is not intended for external use. It is quite complex to
build a configuration for a daemon and it is the arbiter dispatcher job ;)
:param pushed_configuration: new conf to... | Send a new configuration to the daemon
This function is not intended for external use. It is quite complex to
build a configuration for a daemon and it is the arbiter dispatcher job ;)
:param pushed_configuration: new conf to send
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L290-L305 |
Alignak-monitoring/alignak | alignak/http/generic_interface.py | GenericInterface._have_conf | def _have_conf(self, magic_hash=None):
"""Get the daemon current configuration state
If the daemon has received a configuration from its arbiter, this will
return True
If a `magic_hash` is provided it is compared with the one included in the
daemon configuration and this functi... | python | def _have_conf(self, magic_hash=None):
"""Get the daemon current configuration state
If the daemon has received a configuration from its arbiter, this will
return True
If a `magic_hash` is provided it is compared with the one included in the
daemon configuration and this functi... | Get the daemon current configuration state
If the daemon has received a configuration from its arbiter, this will
return True
If a `magic_hash` is provided it is compared with the one included in the
daemon configuration and this function returns True only if they match!
:retu... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L310-L329 |
Alignak-monitoring/alignak | alignak/http/generic_interface.py | GenericInterface._push_actions | def _push_actions(self):
"""Push actions to the poller/reactionner
This function is used by the scheduler to send the actions to get executed to
the poller/reactionner
{'actions': actions, 'instance_id': scheduler_instance_id}
:return:None
"""
data = cherrypy.r... | python | def _push_actions(self):
"""Push actions to the poller/reactionner
This function is used by the scheduler to send the actions to get executed to
the poller/reactionner
{'actions': actions, 'instance_id': scheduler_instance_id}
:return:None
"""
data = cherrypy.r... | Push actions to the poller/reactionner
This function is used by the scheduler to send the actions to get executed to
the poller/reactionner
{'actions': actions, 'instance_id': scheduler_instance_id}
:return:None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L334-L346 |
Alignak-monitoring/alignak | alignak/http/generic_interface.py | GenericInterface._results | def _results(self, scheduler_instance_id):
"""Get the results of the executed actions for the scheduler which instance id is provided
Calling this method for daemons that are not configured as passive do not make sense.
Indeed, this service should only be exposed on poller and reactionner daemo... | python | def _results(self, scheduler_instance_id):
"""Get the results of the executed actions for the scheduler which instance id is provided
Calling this method for daemons that are not configured as passive do not make sense.
Indeed, this service should only be exposed on poller and reactionner daemo... | Get the results of the executed actions for the scheduler which instance id is provided
Calling this method for daemons that are not configured as passive do not make sense.
Indeed, this service should only be exposed on poller and reactionner daemons.
:param scheduler_instance_id: instance id... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L367-L380 |
Alignak-monitoring/alignak | alignak/http/generic_interface.py | GenericInterface._broks | def _broks(self, broker_name): # pylint: disable=unused-argument
"""Get the broks from the daemon
This is used by the brokers to get the broks list of a daemon
:return: Brok list serialized
:rtype: dict
"""
with self.app.broks_lock:
res = self.app.get_broks... | python | def _broks(self, broker_name): # pylint: disable=unused-argument
"""Get the broks from the daemon
This is used by the brokers to get the broks list of a daemon
:return: Brok list serialized
:rtype: dict
"""
with self.app.broks_lock:
res = self.app.get_broks... | Get the broks from the daemon
This is used by the brokers to get the broks list of a daemon
:return: Brok list serialized
:rtype: dict | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L384-L394 |
Alignak-monitoring/alignak | alignak/http/generic_interface.py | GenericInterface._events | def _events(self):
"""Get the monitoring events from the daemon
This is used by the arbiter to get the monitoring events from all its satellites
:return: Events list serialized
:rtype: list
"""
with self.app.events_lock:
res = self.app.get_events()
r... | python | def _events(self):
"""Get the monitoring events from the daemon
This is used by the arbiter to get the monitoring events from all its satellites
:return: Events list serialized
:rtype: list
"""
with self.app.events_lock:
res = self.app.get_events()
r... | Get the monitoring events from the daemon
This is used by the arbiter to get the monitoring events from all its satellites
:return: Events list serialized
:rtype: list | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L398-L408 |
Alignak-monitoring/alignak | alignak/dependencynode.py | DependencyNode.serialize | def serialize(self):
"""This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here we directly return all attributes
:return: json representation of a DependencyNode
:rtype: dict
"""
return ... | python | def serialize(self):
"""This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here we directly return all attributes
:return: json representation of a DependencyNode
:rtype: dict
"""
return ... | This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here we directly return all attributes
:return: json representation of a DependencyNode
:rtype: dict | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L103-L114 |
Alignak-monitoring/alignak | alignak/dependencynode.py | DependencyNode.get_state | def get_state(self, hosts, services):
"""Get node state by looking recursively over sons and applying operand
:param hosts: list of available hosts to search for
:param services: list of available services to search for
:return: Node state
:rtype: int
"""
# If we... | python | def get_state(self, hosts, services):
"""Get node state by looking recursively over sons and applying operand
:param hosts: list of available hosts to search for
:param services: list of available services to search for
:return: Node state
:rtype: int
"""
# If we... | Get node state by looking recursively over sons and applying operand
:param hosts: list of available hosts to search for
:param services: list of available services to search for
:return: Node state
:rtype: int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L140-L171 |
Alignak-monitoring/alignak | alignak/dependencynode.py | DependencyNode.get_host_node_state | def get_host_node_state(self, state, problem_has_been_acknowledged, in_scheduled_downtime):
"""Get host node state, simplest case ::
* Handle not value (revert) for host and consider 1 as 2
:return: 0, 1 or 2
:rtype: int
"""
# Make DOWN look as CRITICAL (2 instead of 1)... | python | def get_host_node_state(self, state, problem_has_been_acknowledged, in_scheduled_downtime):
"""Get host node state, simplest case ::
* Handle not value (revert) for host and consider 1 as 2
:return: 0, 1 or 2
:rtype: int
"""
# Make DOWN look as CRITICAL (2 instead of 1)... | Get host node state, simplest case ::
* Handle not value (revert) for host and consider 1 as 2
:return: 0, 1 or 2
:rtype: int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L173-L192 |
Alignak-monitoring/alignak | alignak/dependencynode.py | DependencyNode.get_service_node_state | def get_service_node_state(self, state, problem_has_been_acknowledged, in_scheduled_downtime):
"""Get service node state, simplest case ::
* Handle not value (revert) for service
:return: 0, 1 or 2
:rtype: int
"""
# If our node is acknowledged or in downtime, state is o... | python | def get_service_node_state(self, state, problem_has_been_acknowledged, in_scheduled_downtime):
"""Get service node state, simplest case ::
* Handle not value (revert) for service
:return: 0, 1 or 2
:rtype: int
"""
# If our node is acknowledged or in downtime, state is o... | Get service node state, simplest case ::
* Handle not value (revert) for service
:return: 0, 1 or 2
:rtype: int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L194-L214 |
Alignak-monitoring/alignak | alignak/dependencynode.py | DependencyNode.get_complex_or_node_state | def get_complex_or_node_state(self, hosts, services):
"""Get state , handle OR aggregation ::
* Get the best state (min of sons)
* Revert if it's a not node
:param hosts: host objects
:param services: service objects
:return: 0, 1 or 2
:rtype: int
... | python | def get_complex_or_node_state(self, hosts, services):
"""Get state , handle OR aggregation ::
* Get the best state (min of sons)
* Revert if it's a not node
:param hosts: host objects
:param services: service objects
:return: 0, 1 or 2
:rtype: int
... | Get state , handle OR aggregation ::
* Get the best state (min of sons)
* Revert if it's a not node
:param hosts: host objects
:param services: service objects
:return: 0, 1 or 2
:rtype: int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L216-L234 |
Alignak-monitoring/alignak | alignak/dependencynode.py | DependencyNode.get_complex_and_node_state | def get_complex_and_node_state(self, hosts, services):
"""Get state , handle AND aggregation ::
* Get the worst state. 2 or max of sons (3 <=> UNKNOWN < CRITICAL <=> 2)
* Revert if it's a not node
:param hosts: host objects
:param services: service objects
:return... | python | def get_complex_and_node_state(self, hosts, services):
"""Get state , handle AND aggregation ::
* Get the worst state. 2 or max of sons (3 <=> UNKNOWN < CRITICAL <=> 2)
* Revert if it's a not node
:param hosts: host objects
:param services: service objects
:return... | Get state , handle AND aggregation ::
* Get the worst state. 2 or max of sons (3 <=> UNKNOWN < CRITICAL <=> 2)
* Revert if it's a not node
:param hosts: host objects
:param services: service objects
:return: 0, 1 or 2
:rtype: int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L236-L257 |
Alignak-monitoring/alignak | alignak/dependencynode.py | DependencyNode.get_complex_xof_node_state | def get_complex_xof_node_state(self, hosts, services):
# pylint: disable=too-many-locals, too-many-return-statements, too-many-branches
"""Get state , handle X of aggregation ::
* Count the number of OK, WARNING, CRITICAL
* Try too apply, in this order, Critical, Warning, OK rule
... | python | def get_complex_xof_node_state(self, hosts, services):
# pylint: disable=too-many-locals, too-many-return-statements, too-many-branches
"""Get state , handle X of aggregation ::
* Count the number of OK, WARNING, CRITICAL
* Try too apply, in this order, Critical, Warning, OK rule
... | Get state , handle X of aggregation ::
* Count the number of OK, WARNING, CRITICAL
* Try too apply, in this order, Critical, Warning, OK rule
* Return the code for first match (2, 1, 0)
* If no rule apply, return OK for simple X of and worst state for multiple X of
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L259-L354 |
Alignak-monitoring/alignak | alignak/dependencynode.py | DependencyNode.list_all_elements | def list_all_elements(self):
"""Get all host/service uuid in our node and below
:return: list of hosts/services uuids
:rtype: list
"""
res = []
# We are a host/service
if self.operand in ['host', 'service']:
return [self.sons[0]]
for son in ... | python | def list_all_elements(self):
"""Get all host/service uuid in our node and below
:return: list of hosts/services uuids
:rtype: list
"""
res = []
# We are a host/service
if self.operand in ['host', 'service']:
return [self.sons[0]]
for son in ... | Get all host/service uuid in our node and below
:return: list of hosts/services uuids
:rtype: list | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L356-L372 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.