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/dependencynode.py
DependencyNode.switch_zeros_of_values
def switch_zeros_of_values(self): """If we are a of: rule, we can get some 0 in of_values, if so, change them with NB sons instead :return: None """ nb_sons = len(self.sons) # Need a list for assignment new_values = list(self.of_values) for i in [0, 1,...
python
def switch_zeros_of_values(self): """If we are a of: rule, we can get some 0 in of_values, if so, change them with NB sons instead :return: None """ nb_sons = len(self.sons) # Need a list for assignment new_values = list(self.of_values) for i in [0, 1,...
If we are a of: rule, we can get some 0 in of_values, if so, change them with NB sons instead :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L374-L386
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNode.is_valid
def is_valid(self): """Check if all leaves are correct (no error) :return: True if correct, otherwise False :rtype: bool """ valid = True if not self.sons: valid = False else: for son in self.sons: if isinstance(son, Depen...
python
def is_valid(self): """Check if all leaves are correct (no error) :return: True if correct, otherwise False :rtype: bool """ valid = True if not self.sons: valid = False else: for son in self.sons: if isinstance(son, Depen...
Check if all leaves are correct (no error) :return: True if correct, otherwise False :rtype: bool
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L388-L403
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNodeFactory.eval_cor_pattern
def eval_cor_pattern(self, pattern, hosts, services, hostgroups, servicegroups, running=False): """Parse and build recursively a tree of DependencyNode from pattern :param pattern: pattern to parse :type pattern: str :param hosts: hosts list, used to find a specific host :type h...
python
def eval_cor_pattern(self, pattern, hosts, services, hostgroups, servicegroups, running=False): """Parse and build recursively a tree of DependencyNode from pattern :param pattern: pattern to parse :type pattern: str :param hosts: hosts list, used to find a specific host :type h...
Parse and build recursively a tree of DependencyNode from pattern :param pattern: pattern to parse :type pattern: str :param hosts: hosts list, used to find a specific host :type hosts: alignak.objects.host.Host :param services: services list, used to find a specific service ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L417-L445
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNodeFactory.eval_xof_pattern
def eval_xof_pattern(node, pattern): """Parse a X of pattern * Set is_of_mul attribute * Set of_values attribute :param node: node to edit :type node: :param pattern: line to match :type pattern: str :return: end of the line (without X of :) :rtyp...
python
def eval_xof_pattern(node, pattern): """Parse a X of pattern * Set is_of_mul attribute * Set of_values attribute :param node: node to edit :type node: :param pattern: line to match :type pattern: str :return: end of the line (without X of :) :rtyp...
Parse a X of pattern * Set is_of_mul attribute * Set of_values attribute :param node: node to edit :type node: :param pattern: line to match :type pattern: str :return: end of the line (without X of :) :rtype: str
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L448-L475
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNodeFactory.eval_complex_cor_pattern
def eval_complex_cor_pattern(self, pattern, hosts, services, hostgroups, servicegroups, running=False): # pylint: disable=too-many-branches """Parse and build recursively a tree of DependencyNode from a complex pattern :param pattern: pattern to parse :t...
python
def eval_complex_cor_pattern(self, pattern, hosts, services, hostgroups, servicegroups, running=False): # pylint: disable=too-many-branches """Parse and build recursively a tree of DependencyNode from a complex pattern :param pattern: pattern to parse :t...
Parse and build recursively a tree of DependencyNode from a complex pattern :param pattern: pattern to parse :type pattern: str :param hosts: hosts list, used to find a specific host :type hosts: alignak.objects.host.Host :param services: services list, used to find a specific s...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L477-L600
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNodeFactory.eval_simple_cor_pattern
def eval_simple_cor_pattern(self, pattern, hosts, services, hostgroups, servicegroups, running=False): """Parse and build recursively a tree of DependencyNode from a simple pattern :param pattern: pattern to parse :type pattern: str :param hosts: hosts li...
python
def eval_simple_cor_pattern(self, pattern, hosts, services, hostgroups, servicegroups, running=False): """Parse and build recursively a tree of DependencyNode from a simple pattern :param pattern: pattern to parse :type pattern: str :param hosts: hosts li...
Parse and build recursively a tree of DependencyNode from a simple pattern :param pattern: pattern to parse :type pattern: str :param hosts: hosts list, used to find a specific host :type hosts: alignak.objects.host.Host :param services: services list, used to find a specific se...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L602-L655
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNodeFactory.find_object
def find_object(self, pattern, hosts, services): """Find object from pattern :param pattern: text to search (host1,service1) :type pattern: str :param hosts: hosts list, used to find a specific host :type hosts: alignak.objects.host.Host :param services: services list, u...
python
def find_object(self, pattern, hosts, services): """Find object from pattern :param pattern: text to search (host1,service1) :type pattern: str :param hosts: hosts list, used to find a specific host :type hosts: alignak.objects.host.Host :param services: services list, u...
Find object from pattern :param pattern: text to search (host1,service1) :type pattern: str :param hosts: hosts list, used to find a specific host :type hosts: alignak.objects.host.Host :param services: services list, used to find a specific service :type services: align...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L657-L691
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNodeFactory.expand_expression
def expand_expression(self, pattern, hosts, services, hostgroups, servicegroups, running=False): # pylint: disable=too-many-locals """Expand a host or service expression into a dependency node tree using (host|service)group membership, regex, or labels as item selector. :param pattern: ...
python
def expand_expression(self, pattern, hosts, services, hostgroups, servicegroups, running=False): # pylint: disable=too-many-locals """Expand a host or service expression into a dependency node tree using (host|service)group membership, regex, or labels as item selector. :param pattern: ...
Expand a host or service expression into a dependency node tree using (host|service)group membership, regex, or labels as item selector. :param pattern: pattern to parse :type pattern: str :param hosts: hosts list, used to find a specific host :type hosts: alignak.objects.host.H...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L693-L765
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNodeFactory.get_host_filters
def get_host_filters(self, expr): # pylint: disable=too-many-return-statements """Generates host filter list corresponding to the expression :: * '*' => any * 'g' => group filter * 'r' => regex name filter * 'l' => bp rule label filter * 't' => tag filter ...
python
def get_host_filters(self, expr): # pylint: disable=too-many-return-statements """Generates host filter list corresponding to the expression :: * '*' => any * 'g' => group filter * 'r' => regex name filter * 'l' => bp rule label filter * 't' => tag filter ...
Generates host filter list corresponding to the expression :: * '*' => any * 'g' => group filter * 'r' => regex name filter * 'l' => bp rule label filter * 't' => tag filter * '' => none filter * No flag match => host name filter :param expr: expression...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L767-L801
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNodeFactory.get_srv_host_filters
def get_srv_host_filters(self, expr): # pylint: disable=too-many-return-statements """Generates service filter list corresponding to the expression :: * '*' => any * 'g' => hostgroup filter * 'r' => host regex name filter * 'l' => host bp rule label filter * 't' ...
python
def get_srv_host_filters(self, expr): # pylint: disable=too-many-return-statements """Generates service filter list corresponding to the expression :: * '*' => any * 'g' => hostgroup filter * 'r' => host regex name filter * 'l' => host bp rule label filter * 't' ...
Generates service filter list corresponding to the expression :: * '*' => any * 'g' => hostgroup filter * 'r' => host regex name filter * 'l' => host bp rule label filter * 't' => tag filter * '' => none filter * No flag match => host name filter :param...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L803-L837
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNodeFactory.get_srv_service_filters
def get_srv_service_filters(self, expr): """Generates service filter list corresponding to the expression :: * '*' => any * 'g' => servicegroup filter * 'r' => service regex name filter * 'l' => service bp rule label filter * 't' => tag filter * '' => none filte...
python
def get_srv_service_filters(self, expr): """Generates service filter list corresponding to the expression :: * '*' => any * 'g' => servicegroup filter * 'r' => service regex name filter * 'l' => service bp rule label filter * 't' => tag filter * '' => none filte...
Generates service filter list corresponding to the expression :: * '*' => any * 'g' => servicegroup filter * 'r' => service regex name filter * 'l' => service bp rule label filter * 't' => tag filter * '' => none filter * No flag match => service name filter ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L839-L870
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiod.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 Timeperiod :rtype: dict """ res = super...
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 Timeperiod :rtype: dict """ res = super...
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 Timeperiod :rtype: dict
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L224-L241
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiod.get_raw_import_values
def get_raw_import_values(self): # pragma: no cover, deprecation """ Get some properties of timeperiod (timeperiod is a bit different from classic item) TODO: never called anywhere, still useful? :return: a dictionnary of some properties :rtype: dict """ ...
python
def get_raw_import_values(self): # pragma: no cover, deprecation """ Get some properties of timeperiod (timeperiod is a bit different from classic item) TODO: never called anywhere, still useful? :return: a dictionnary of some properties :rtype: dict """ ...
Get some properties of timeperiod (timeperiod is a bit different from classic item) TODO: never called anywhere, still useful? :return: a dictionnary of some properties :rtype: dict
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L252-L272
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiod.is_time_valid
def is_time_valid(self, timestamp): """ Check if a time is valid or not :return: time is valid or not :rtype: bool """ if hasattr(self, 'exclude'): for daterange in self.exclude: if daterange.is_time_valid(timestamp): retur...
python
def is_time_valid(self, timestamp): """ Check if a time is valid or not :return: time is valid or not :rtype: bool """ if hasattr(self, 'exclude'): for daterange in self.exclude: if daterange.is_time_valid(timestamp): retur...
Check if a time is valid or not :return: time is valid or not :rtype: bool
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L274-L288
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiod.get_min_from_t
def get_min_from_t(self, timestamp): """ Get the first time > timestamp which is valid :param timestamp: number of seconds :type timestamp: int :return: number of seconds :rtype: int TODO: not used, so delete it """ mins_incl = [] for date...
python
def get_min_from_t(self, timestamp): """ Get the first time > timestamp which is valid :param timestamp: number of seconds :type timestamp: int :return: number of seconds :rtype: int TODO: not used, so delete it """ mins_incl = [] for date...
Get the first time > timestamp which is valid :param timestamp: number of seconds :type timestamp: int :return: number of seconds :rtype: int TODO: not used, so delete it
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L291-L304
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiod.check_and_log_activation_change
def check_and_log_activation_change(self): """ Will look for active/un-active change of timeperiod. In case it change, we log it like: [1327392000] TIMEPERIOD TRANSITION: <name>;<from>;<to> States of is_active: -1: default value when start 0: when timeperiod end ...
python
def check_and_log_activation_change(self): """ Will look for active/un-active change of timeperiod. In case it change, we log it like: [1327392000] TIMEPERIOD TRANSITION: <name>;<from>;<to> States of is_active: -1: default value when start 0: when timeperiod end ...
Will look for active/un-active change of timeperiod. In case it change, we log it like: [1327392000] TIMEPERIOD TRANSITION: <name>;<from>;<to> States of is_active: -1: default value when start 0: when timeperiod end 1: when timeperiod start :return: None or a br...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L343-L379
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiod.clean_cache
def clean_cache(self): """ Clean cache with entries older than now because not used in future ;) :return: None """ now = int(time.time()) t_to_del = [] for timestamp in self.cache: if timestamp < now: t_to_del.append(timestamp) ...
python
def clean_cache(self): """ Clean cache with entries older than now because not used in future ;) :return: None """ now = int(time.time()) t_to_del = [] for timestamp in self.cache: if timestamp < now: t_to_del.append(timestamp) ...
Clean cache with entries older than now because not used in future ;) :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L381-L401
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiod.get_next_valid_time_from_t
def get_next_valid_time_from_t(self, timestamp): # pylint: disable=too-many-branches """ Get next valid time. If it's in cache, get it, otherwise define it. The limit to find it is 1 year. :param timestamp: number of seconds :type timestamp: int or float :return:...
python
def get_next_valid_time_from_t(self, timestamp): # pylint: disable=too-many-branches """ Get next valid time. If it's in cache, get it, otherwise define it. The limit to find it is 1 year. :param timestamp: number of seconds :type timestamp: int or float :return:...
Get next valid time. If it's in cache, get it, otherwise define it. The limit to find it is 1 year. :param timestamp: number of seconds :type timestamp: int or float :return: Nothing or time in seconds :rtype: None or int
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L403-L470
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiod.get_next_invalid_time_from_t
def get_next_invalid_time_from_t(self, timestamp): # pylint: disable=too-many-branches """ Get the next invalid time :param timestamp: timestamp in seconds (of course) :type timestamp: int or float :return: timestamp of next invalid time :rtype: int or float ...
python
def get_next_invalid_time_from_t(self, timestamp): # pylint: disable=too-many-branches """ Get the next invalid time :param timestamp: timestamp in seconds (of course) :type timestamp: int or float :return: timestamp of next invalid time :rtype: int or float ...
Get the next invalid time :param timestamp: timestamp in seconds (of course) :type timestamp: int or float :return: timestamp of next invalid time :rtype: int or float
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L472-L532
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiod.is_correct
def is_correct(self): """Check if this object configuration is correct :: * Check if dateranges of timeperiod are valid * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False if at least one daterange is not correct :rt...
python
def is_correct(self): """Check if this object configuration is correct :: * Check if dateranges of timeperiod are valid * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False if at least one daterange is not correct :rt...
Check if this object configuration is correct :: * Check if dateranges of timeperiod are valid * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False if at least one daterange is not correct :rtype: bool
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L534-L556
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiod.resolve_daterange
def resolve_daterange(self, dateranges, entry): # pylint: disable=too-many-return-statements,too-many-statements, # pylint: disable=too-many-branches,too-many-locals """ Try to solve dateranges (special cases) :param dateranges: dateranges :type dateranges: list ...
python
def resolve_daterange(self, dateranges, entry): # pylint: disable=too-many-return-statements,too-many-statements, # pylint: disable=too-many-branches,too-many-locals """ Try to solve dateranges (special cases) :param dateranges: dateranges :type dateranges: list ...
Try to solve dateranges (special cases) :param dateranges: dateranges :type dateranges: list :param entry: property of timeperiod :type entry: string :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L579-L858
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiod.explode
def explode(self): """ Try to resolve all unresolved elements :return: None """ for entry in self.unresolved: self.resolve_daterange(self.dateranges, entry) self.unresolved = []
python
def explode(self): """ Try to resolve all unresolved elements :return: None """ for entry in self.unresolved: self.resolve_daterange(self.dateranges, entry) self.unresolved = []
Try to resolve all unresolved elements :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L868-L876
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiod.linkify
def linkify(self, timeperiods): """ Will make timeperiod in exclude with id of the timeperiods :param timeperiods: Timeperiods object :type timeperiods: :return: None """ new_exclude = [] if hasattr(self, 'exclude') and self.exclude != []: log...
python
def linkify(self, timeperiods): """ Will make timeperiod in exclude with id of the timeperiods :param timeperiods: Timeperiods object :type timeperiods: :return: None """ new_exclude = [] if hasattr(self, 'exclude') and self.exclude != []: log...
Will make timeperiod in exclude with id of the timeperiods :param timeperiods: Timeperiods object :type timeperiods: :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L878-L897
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiod.check_exclude_rec
def check_exclude_rec(self): # pylint: disable=access-member-before-definition """ Check if this timeperiod is tagged :return: if tagged return false, if not true :rtype: bool """ if self.rec_tag: msg = "[timeentry::%s] is in a loop in exclude paramet...
python
def check_exclude_rec(self): # pylint: disable=access-member-before-definition """ Check if this timeperiod is tagged :return: if tagged return false, if not true :rtype: bool """ if self.rec_tag: msg = "[timeentry::%s] is in a loop in exclude paramet...
Check if this timeperiod is tagged :return: if tagged return false, if not true :rtype: bool
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L899-L914
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiods.explode
def explode(self): """ Try to resolve each timeperiod :return: None """ for t_id in self.items: timeperiod = self.items[t_id] timeperiod.explode()
python
def explode(self): """ Try to resolve each timeperiod :return: None """ for t_id in self.items: timeperiod = self.items[t_id] timeperiod.explode()
Try to resolve each timeperiod :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L948-L956
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiods.linkify
def linkify(self): """ Check exclusion for each timeperiod :return: None """ for t_id in self.items: timeperiod = self.items[t_id] timeperiod.linkify(self)
python
def linkify(self): """ Check exclusion for each timeperiod :return: None """ for t_id in self.items: timeperiod = self.items[t_id] timeperiod.linkify(self)
Check exclusion for each timeperiod :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L958-L966
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiods.get_unresolved_properties_by_inheritance
def get_unresolved_properties_by_inheritance(self, timeperiod): """ Fill full properties with template if needed for the unresolved values (example: sunday ETCETC) :return: None """ # Ok, I do not have prop, Maybe my templates do? # Same story for plus for...
python
def get_unresolved_properties_by_inheritance(self, timeperiod): """ Fill full properties with template if needed for the unresolved values (example: sunday ETCETC) :return: None """ # Ok, I do not have prop, Maybe my templates do? # Same story for plus for...
Fill full properties with template if needed for the unresolved values (example: sunday ETCETC) :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L968-L978
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiods.apply_inheritance
def apply_inheritance(self): """ The only interesting property to inherit is exclude :return: None """ self.apply_partial_inheritance('exclude') for i in self: self.get_customs_properties_by_inheritance(i) # And now apply inheritance for unresolved p...
python
def apply_inheritance(self): """ The only interesting property to inherit is exclude :return: None """ self.apply_partial_inheritance('exclude') for i in self: self.get_customs_properties_by_inheritance(i) # And now apply inheritance for unresolved p...
The only interesting property to inherit is exclude :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L980-L993
Alignak-monitoring/alignak
alignak/objects/timeperiod.py
Timeperiods.is_correct
def is_correct(self): """ check if each properties of timeperiods are valid :return: True if is correct, otherwise False :rtype: bool """ valid = True # We do not want a same hg to be explode again and again # so we tag it for timeperiod in list(s...
python
def is_correct(self): """ check if each properties of timeperiods are valid :return: True if is correct, otherwise False :rtype: bool """ valid = True # We do not want a same hg to be explode again and again # so we tag it for timeperiod in list(s...
check if each properties of timeperiods are valid :return: True if is correct, otherwise False :rtype: bool
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/timeperiod.py#L995-L1033
Alignak-monitoring/alignak
alignak/objects/schedulerlink.py
SchedulerLink.get_override_configuration
def get_override_configuration(self): """ Some parameters can give as 'overridden parameters' like use_timezone so they will be mixed (in the scheduler) with the standard conf sent by the arbiter :return: dictionary of properties :rtype: dict """ res = {} ...
python
def get_override_configuration(self): """ Some parameters can give as 'overridden parameters' like use_timezone so they will be mixed (in the scheduler) with the standard conf sent by the arbiter :return: dictionary of properties :rtype: dict """ res = {} ...
Some parameters can give as 'overridden parameters' like use_timezone so they will be mixed (in the scheduler) with the standard conf sent by the arbiter :return: dictionary of properties :rtype: dict
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/schedulerlink.py#L89-L102
Alignak-monitoring/alignak
alignak/dispatcher.py
Dispatcher.check_reachable
def check_reachable(self, forced=False, test=False): # pylint: disable=too-many-branches """Check all daemons state (reachable or not) If test parameter is True, do not really send but simulate only for testing purpose... The update_infos function returns None when no ping has been exe...
python
def check_reachable(self, forced=False, test=False): # pylint: disable=too-many-branches """Check all daemons state (reachable or not) If test parameter is True, do not really send but simulate only for testing purpose... The update_infos function returns None when no ping has been exe...
Check all daemons state (reachable or not) If test parameter is True, do not really send but simulate only for testing purpose... The update_infos function returns None when no ping has been executed (too early...), or True / False according to the real ping and get managed configurati...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dispatcher.py#L213-L297
Alignak-monitoring/alignak
alignak/dispatcher.py
Dispatcher.check_status_and_get_events
def check_status_and_get_events(self): # pylint: disable=too-many-branches """Get all the daemons status :return: Dictionary with all the daemons returned information :rtype: dict """ statistics = {} events = [] for daemon_link in self.all_daemons_links:...
python
def check_status_and_get_events(self): # pylint: disable=too-many-branches """Get all the daemons status :return: Dictionary with all the daemons returned information :rtype: dict """ statistics = {} events = [] for daemon_link in self.all_daemons_links:...
Get all the daemons status :return: Dictionary with all the daemons returned information :rtype: dict
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dispatcher.py#L299-L337
Alignak-monitoring/alignak
alignak/dispatcher.py
Dispatcher.check_dispatch
def check_dispatch(self): # pylint: disable=too-many-branches """Check that all active satellites have a configuration dispatched A DispatcherError exception is raised if no configuration is dispatched! :return: None """ if not self.arbiter_link: raise DispatcherEr...
python
def check_dispatch(self): # pylint: disable=too-many-branches """Check that all active satellites have a configuration dispatched A DispatcherError exception is raised if no configuration is dispatched! :return: None """ if not self.arbiter_link: raise DispatcherEr...
Check that all active satellites have a configuration dispatched A DispatcherError exception is raised if no configuration is dispatched! :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dispatcher.py#L339-L447
Alignak-monitoring/alignak
alignak/dispatcher.py
Dispatcher.get_satellites_list
def get_satellites_list(self, sat_type): """Get a sorted satellite list: master then spare :param sat_type: type of the required satellites (arbiters, schedulers, ...) :type sat_type: str :return: sorted satellites list :rtype: list[alignak.objects.satellitelink.SatelliteLink] ...
python
def get_satellites_list(self, sat_type): """Get a sorted satellite list: master then spare :param sat_type: type of the required satellites (arbiters, schedulers, ...) :type sat_type: str :return: sorted satellites list :rtype: list[alignak.objects.satellitelink.SatelliteLink] ...
Get a sorted satellite list: master then spare :param sat_type: type of the required satellites (arbiters, schedulers, ...) :type sat_type: str :return: sorted satellites list :rtype: list[alignak.objects.satellitelink.SatelliteLink]
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dispatcher.py#L449-L464
Alignak-monitoring/alignak
alignak/dispatcher.py
Dispatcher.get_scheduler_ordered_list
def get_scheduler_ordered_list(self, realm): """Get sorted scheduler list for a specific realm List is ordered as: alive first, then spare (if any), then dead scheduler links :param realm: realm we want scheduler from :type realm: alignak.objects.realm.Realm :return: sorted sch...
python
def get_scheduler_ordered_list(self, realm): """Get sorted scheduler list for a specific realm List is ordered as: alive first, then spare (if any), then dead scheduler links :param realm: realm we want scheduler from :type realm: alignak.objects.realm.Realm :return: sorted sch...
Get sorted scheduler list for a specific realm List is ordered as: alive first, then spare (if any), then dead scheduler links :param realm: realm we want scheduler from :type realm: alignak.objects.realm.Realm :return: sorted scheduler list :rtype: list[alignak.objects.schedul...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dispatcher.py#L466-L498
Alignak-monitoring/alignak
alignak/dispatcher.py
Dispatcher.prepare_dispatch
def prepare_dispatch(self): # pylint:disable=too-many-branches, too-many-statements, too-many-locals """ Prepare dispatch, so prepare for each daemon (schedulers, brokers, receivers, reactionners, pollers) This function will only prepare something if self.new_to_dispatch is Fals...
python
def prepare_dispatch(self): # pylint:disable=too-many-branches, too-many-statements, too-many-locals """ Prepare dispatch, so prepare for each daemon (schedulers, brokers, receivers, reactionners, pollers) This function will only prepare something if self.new_to_dispatch is Fals...
Prepare dispatch, so prepare for each daemon (schedulers, brokers, receivers, reactionners, pollers) This function will only prepare something if self.new_to_dispatch is False It will reset the first_dispatch_done flag A DispatcherError exception is raised if a configuration is already...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dispatcher.py#L500-L837
Alignak-monitoring/alignak
alignak/dispatcher.py
Dispatcher.dispatch
def dispatch(self, test=False): # pylint: disable=too-many-branches """ Send configuration to satellites :return: None """ if not self.new_to_dispatch: raise DispatcherError("Dispatcher cannot dispatch, " "because no configuration i...
python
def dispatch(self, test=False): # pylint: disable=too-many-branches """ Send configuration to satellites :return: None """ if not self.new_to_dispatch: raise DispatcherError("Dispatcher cannot dispatch, " "because no configuration i...
Send configuration to satellites :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dispatcher.py#L839-L944
Alignak-monitoring/alignak
alignak/dispatcher.py
Dispatcher.stop_request
def stop_request(self, stop_now=False): """Send a stop request to all the daemons :param stop_now: stop now or go to stop wait mode :type stop_now: bool :return: True if all daemons are reachable """ all_ok = True for daemon_link in self.all_daemons_links: ...
python
def stop_request(self, stop_now=False): """Send a stop request to all the daemons :param stop_now: stop now or go to stop wait mode :type stop_now: bool :return: True if all daemons are reachable """ all_ok = True for daemon_link in self.all_daemons_links: ...
Send a stop request to all the daemons :param stop_now: stop now or go to stop wait mode :type stop_now: bool :return: True if all daemons are reachable
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dispatcher.py#L946-L976
Alignak-monitoring/alignak
alignak/property.py
BoolProp.pythonize
def pythonize(self, val): """Convert value into a boolean :param val: value to convert :type val: bool, int, str :return: boolean corresponding to value :: {'1': True, 'yes': True, 'true': True, 'on': True, '0': False, 'no': False, 'false': False, 'off': False} ...
python
def pythonize(self, val): """Convert value into a boolean :param val: value to convert :type val: bool, int, str :return: boolean corresponding to value :: {'1': True, 'yes': True, 'true': True, 'on': True, '0': False, 'no': False, 'false': False, 'off': False} ...
Convert value into a boolean :param val: value to convert :type val: bool, int, str :return: boolean corresponding to value :: {'1': True, 'yes': True, 'true': True, 'on': True, '0': False, 'no': False, 'false': False, 'off': False} :rtype: bool
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/property.py#L222-L243
Alignak-monitoring/alignak
alignak/property.py
ListProp.pythonize
def pythonize(self, val): """Convert value into a list:: * split value (or each element if value is a list) on coma char * strip split values :param val: value to convert :type val: str :return: list corresponding to value :rtype: list """ if isi...
python
def pythonize(self, val): """Convert value into a list:: * split value (or each element if value is a list) on coma char * strip split values :param val: value to convert :type val: str :return: list corresponding to value :rtype: list """ if isi...
Convert value into a list:: * split value (or each element if value is a list) on coma char * strip split values :param val: value to convert :type val: str :return: list corresponding to value :rtype: list
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/property.py#L324-L342
Alignak-monitoring/alignak
alignak/property.py
DictProp.pythonize
def pythonize(self, val): """Convert value into a dict:: * If value is a list, try to take the last element * split "key=value" string and convert to { key:value } :param val: value to convert :type val: :return: log level corresponding to value :rtype: str ...
python
def pythonize(self, val): """Convert value into a dict:: * If value is a list, try to take the last element * split "key=value" string and convert to { key:value } :param val: value to convert :type val: :return: log level corresponding to value :rtype: str ...
Convert value into a dict:: * If value is a list, try to take the last element * split "key=value" string and convert to { key:value } :param val: value to convert :type val: :return: log level corresponding to value :rtype: str
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/property.py#L400-L439
Alignak-monitoring/alignak
alignak/property.py
AddrProp.pythonize
def pythonize(self, val): """Convert value into a address ip format:: * If value is a list, try to take the last element * match ip address and port (if available) :param val: value to convert :type val: :return: address/port corresponding to value :rtype: dict ...
python
def pythonize(self, val): """Convert value into a address ip format:: * If value is a list, try to take the last element * match ip address and port (if available) :param val: value to convert :type val: :return: address/port corresponding to value :rtype: dict ...
Convert value into a address ip format:: * If value is a list, try to take the last element * match ip address and port (if available) :param val: value to convert :type val: :return: address/port corresponding to value :rtype: dict
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/property.py#L445-L465
Alignak-monitoring/alignak
alignak/property.py
ToGuessProp.pythonize
def pythonize(self, val): """If value is a single list element just return the element does nothing otherwise :param val: value to convert :type val: :return: converted value :rtype: """ if isinstance(val, list) and len(set(val)) == 1: # If we...
python
def pythonize(self, val): """If value is a single list element just return the element does nothing otherwise :param val: value to convert :type val: :return: converted value :rtype: """ if isinstance(val, list) and len(set(val)) == 1: # If we...
If value is a single list element just return the element does nothing otherwise :param val: value to convert :type val: :return: converted value :rtype:
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/property.py#L471-L485
Alignak-monitoring/alignak
alignak/property.py
IntListProp.pythonize
def pythonize(self, val): """Convert value into a integer list:: * Try to convert into a list * Convert each element into a int :param val: value to convert :type val: :return: integer list corresponding to value :rtype: list[int] """ val = super...
python
def pythonize(self, val): """Convert value into a integer list:: * Try to convert into a list * Convert each element into a int :param val: value to convert :type val: :return: integer list corresponding to value :rtype: list[int] """ val = super...
Convert value into a integer list:: * Try to convert into a list * Convert each element into a int :param val: value to convert :type val: :return: integer list corresponding to value :rtype: list[int]
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/property.py#L490-L505
Alignak-monitoring/alignak
alignak/monitor.py
MonitorConnection.get_response
def get_response(self, method, endpoint, headers=None, json=None, params=None, data=None): # pylint: disable=too-many-arguments """ Returns the response from the requested endpoint with the requested method :param method: str. one of the methods accepted by Requests ('POST', 'GET', ...) ...
python
def get_response(self, method, endpoint, headers=None, json=None, params=None, data=None): # pylint: disable=too-many-arguments """ Returns the response from the requested endpoint with the requested method :param method: str. one of the methods accepted by Requests ('POST', 'GET', ...) ...
Returns the response from the requested endpoint with the requested method :param method: str. one of the methods accepted by Requests ('POST', 'GET', ...) :param endpoint: str. the relative endpoint to access :param params: (optional) Dictionary or bytes to be sent in the query string f...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/monitor.py#L74-L109
Alignak-monitoring/alignak
alignak/monitor.py
MonitorConnection.decode
def decode(response): """ Decodes and returns the response as JSON (dict) or raise BackendException :param response: requests.response object :return: dict """ # Second stage. Errors are backend errors (bad login, bad url, ...) try: response.raise_for...
python
def decode(response): """ Decodes and returns the response as JSON (dict) or raise BackendException :param response: requests.response object :return: dict """ # Second stage. Errors are backend errors (bad login, bad url, ...) try: response.raise_for...
Decodes and returns the response as JSON (dict) or raise BackendException :param response: requests.response object :return: dict
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/monitor.py#L112-L128
Alignak-monitoring/alignak
alignak/monitor.py
MonitorConnection.login
def login(self, username, password): """ Log into the WS interface and get the authentication token if login is: - accepted, returns True - refused, returns False In case of any error, raises a BackendException :param username: login name :type username...
python
def login(self, username, password): """ Log into the WS interface and get the authentication token if login is: - accepted, returns True - refused, returns False In case of any error, raises a BackendException :param username: login name :type username...
Log into the WS interface and get the authentication token if login is: - accepted, returns True - refused, returns False In case of any error, raises a BackendException :param username: login name :type username: str :param password: password :type pas...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/monitor.py#L153-L198
Alignak-monitoring/alignak
alignak/monitor.py
MonitorConnection.logout
def logout(self): """ Logout from the backend :return: return True if logout is successfull, otherwise False :rtype: bool """ logger.debug("request backend logout") if not self.authenticated: logger.warning("Unnecessary logout ...") return...
python
def logout(self): """ Logout from the backend :return: return True if logout is successfull, otherwise False :rtype: bool """ logger.debug("request backend logout") if not self.authenticated: logger.warning("Unnecessary logout ...") return...
Logout from the backend :return: return True if logout is successfull, otherwise False :rtype: bool
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/monitor.py#L200-L219
Alignak-monitoring/alignak
alignak/monitor.py
MonitorConnection.get
def get(self, endpoint, params=None): """ Get items or item in alignak backend If an error occurs, a BackendException is raised. This method builds a response as a dictionary that always contains: _items and _status:: { u'_items': [ ... ...
python
def get(self, endpoint, params=None): """ Get items or item in alignak backend If an error occurs, a BackendException is raised. This method builds a response as a dictionary that always contains: _items and _status:: { u'_items': [ ... ...
Get items or item in alignak backend If an error occurs, a BackendException is raised. This method builds a response as a dictionary that always contains: _items and _status:: { u'_items': [ ... ], u'_status': u'OK' ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/monitor.py#L221-L249
Alignak-monitoring/alignak
alignak/monitor.py
MonitorConnection.post
def post(self, endpoint, data, files=None, headers=None): # pylint: disable=unused-argument """ Create a new item :param endpoint: endpoint (API URL) :type endpoint: str :param data: properties of item to create :type data: dict :param files: Not used. To...
python
def post(self, endpoint, data, files=None, headers=None): # pylint: disable=unused-argument """ Create a new item :param endpoint: endpoint (API URL) :type endpoint: str :param data: properties of item to create :type data: dict :param files: Not used. To...
Create a new item :param endpoint: endpoint (API URL) :type endpoint: str :param data: properties of item to create :type data: dict :param files: Not used. To be implemented :type files: None :param headers: headers (example: Content-Type) :type headers:...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/monitor.py#L251-L272
Alignak-monitoring/alignak
alignak/monitor.py
MonitorConnection.patch
def patch(self, endpoint, data): """ Method to update an item The headers must include an If-Match containing the object _etag. headers = {'If-Match': contact_etag} The data dictionary contain the fields that must be modified. If the patching fails because the _eta...
python
def patch(self, endpoint, data): """ Method to update an item The headers must include an If-Match containing the object _etag. headers = {'If-Match': contact_etag} The data dictionary contain the fields that must be modified. If the patching fails because the _eta...
Method to update an item The headers must include an If-Match containing the object _etag. headers = {'If-Match': contact_etag} The data dictionary contain the fields that must be modified. If the patching fails because the _etag object do not match with the provided one, a ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/monitor.py#L274-L322
Alignak-monitoring/alignak
alignak/misc/perfdata.py
sanitize_name
def sanitize_name(field_name): """Sanitize a field name for a TSDB (Graphite or Influx) - remove not allowed characters from the field name and replace with authorized characters :param field_name: Field name to clean :type field_name: string :return: sanitized field name """ if not fie...
python
def sanitize_name(field_name): """Sanitize a field name for a TSDB (Graphite or Influx) - remove not allowed characters from the field name and replace with authorized characters :param field_name: Field name to clean :type field_name: string :return: sanitized field name """ if not fie...
Sanitize a field name for a TSDB (Graphite or Influx) - remove not allowed characters from the field name and replace with authorized characters :param field_name: Field name to clean :type field_name: string :return: sanitized field name
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/misc/perfdata.py#L66-L93
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver.init
def init(self, conf): """Initialize MacroResolver instance with conf. Must be called at least once. :param conf: configuration to load :type conf: alignak.objects.Config :return: None """ # For searching class and elements for on-demand # we need link to...
python
def init(self, conf): """Initialize MacroResolver instance with conf. Must be called at least once. :param conf: configuration to load :type conf: alignak.objects.Config :return: None """ # For searching class and elements for on-demand # we need link to...
Initialize MacroResolver instance with conf. Must be called at least once. :param conf: configuration to load :type conf: alignak.objects.Config :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L146-L174
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._get_macros
def _get_macros(chain): """Get all macros of a chain Cut '$' char and create a dict with the following structure:: { 'MacroSTR1' : {'val': '', 'type': 'unknown'} 'MacroSTR2' : {'val': '', 'type': 'unknown'} } :param chain: chain to parse :type chain: str ...
python
def _get_macros(chain): """Get all macros of a chain Cut '$' char and create a dict with the following structure:: { 'MacroSTR1' : {'val': '', 'type': 'unknown'} 'MacroSTR2' : {'val': '', 'type': 'unknown'} } :param chain: chain to parse :type chain: str ...
Get all macros of a chain Cut '$' char and create a dict with the following structure:: { 'MacroSTR1' : {'val': '', 'type': 'unknown'} 'MacroSTR2' : {'val': '', 'type': 'unknown'} } :param chain: chain to parse :type chain: str :return: dict with macro parsed ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L177-L200
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._get_value_from_element
def _get_value_from_element(self, elt, prop): # pylint: disable=too-many-return-statements """Get value from an element's property. the property may be a function to call. If the property is not resolved (because not implemented), this function will return 'n/a' :param elt: el...
python
def _get_value_from_element(self, elt, prop): # pylint: disable=too-many-return-statements """Get value from an element's property. the property may be a function to call. If the property is not resolved (because not implemented), this function will return 'n/a' :param elt: el...
Get value from an element's property. the property may be a function to call. If the property is not resolved (because not implemented), this function will return 'n/a' :param elt: element :type elt: object :param prop: element property :type prop: str :return:...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L202-L258
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._delete_unwanted_caracters
def _delete_unwanted_caracters(self, chain): """Remove not wanted char from chain unwanted char are illegal_macro_output_chars attribute :param chain: chain to remove char from :type chain: str :return: chain cleaned :rtype: str """ try: chain...
python
def _delete_unwanted_caracters(self, chain): """Remove not wanted char from chain unwanted char are illegal_macro_output_chars attribute :param chain: chain to remove char from :type chain: str :return: chain cleaned :rtype: str """ try: chain...
Remove not wanted char from chain unwanted char are illegal_macro_output_chars attribute :param chain: chain to remove char from :type chain: str :return: chain cleaned :rtype: str
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L260-L279
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver.get_env_macros
def get_env_macros(self, data): """Get all environment macros from data For each object in data :: * Fetch all macros in object.__class__.macros * Fetch all customs macros in o.custom :param data: data to get macro :type data: :return: dict with macro name as ke...
python
def get_env_macros(self, data): """Get all environment macros from data For each object in data :: * Fetch all macros in object.__class__.macros * Fetch all customs macros in o.custom :param data: data to get macro :type data: :return: dict with macro name as ke...
Get all environment macros from data For each object in data :: * Fetch all macros in object.__class__.macros * Fetch all customs macros in o.custom :param data: data to get macro :type data: :return: dict with macro name as key and macro value as value :rtype: ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L281-L313
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver.resolve_simple_macros_in_string
def resolve_simple_macros_in_string(self, c_line, data, macromodulations, timeperiods, args=None): # pylint: disable=too-many-locals, too-many-branches, too-many-nested-blocks """Replace macro in the command line with the real value :param c_line: command...
python
def resolve_simple_macros_in_string(self, c_line, data, macromodulations, timeperiods, args=None): # pylint: disable=too-many-locals, too-many-branches, too-many-nested-blocks """Replace macro in the command line with the real value :param c_line: command...
Replace macro in the command line with the real value :param c_line: command line to modify :type c_line: str :param data: objects list, use to look for a specific macro :type data: :param macromodulations: the available macro modulations :type macromodulations: dict ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L315-L427
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver.resolve_command
def resolve_command(self, com, data, macromodulations, timeperiods): """Resolve command macros with data :param com: check / event handler or command call object :type com: object :param data: objects list, used to search for a specific macro (custom or object related) :type dat...
python
def resolve_command(self, com, data, macromodulations, timeperiods): """Resolve command macros with data :param com: check / event handler or command call object :type com: object :param data: objects list, used to search for a specific macro (custom or object related) :type dat...
Resolve command macros with data :param com: check / event handler or command call object :type com: object :param data: objects list, used to search for a specific macro (custom or object related) :type data: :return: command line with '$MACRO$' replaced with values :pa...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L429-L447
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._get_type_of_macro
def _get_type_of_macro(macros, objs): r"""Set macros types Example:: ARG\d -> ARGN, HOSTBLABLA -> class one and set Host in class) _HOSTTOTO -> HOST CUSTOM MACRO TOTO SERVICESTATEID:srv-1:Load$ -> MACRO SERVICESTATEID of the service Load of host srv-1 :param ma...
python
def _get_type_of_macro(macros, objs): r"""Set macros types Example:: ARG\d -> ARGN, HOSTBLABLA -> class one and set Host in class) _HOSTTOTO -> HOST CUSTOM MACRO TOTO SERVICESTATEID:srv-1:Load$ -> MACRO SERVICESTATEID of the service Load of host srv-1 :param ma...
r"""Set macros types Example:: ARG\d -> ARGN, HOSTBLABLA -> class one and set Host in class) _HOSTTOTO -> HOST CUSTOM MACRO TOTO SERVICESTATEID:srv-1:Load$ -> MACRO SERVICESTATEID of the service Load of host srv-1 :param macros: macros list in a dictionary :typ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L450-L496
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._resolve_argn
def _resolve_argn(macro, args): """Get argument from macro name ie : $ARG3$ -> args[2] :param macro: macro to parse :type macro: :param args: args given to command line :type args: :return: argument at position N-1 in args table (where N is the int parsed) ...
python
def _resolve_argn(macro, args): """Get argument from macro name ie : $ARG3$ -> args[2] :param macro: macro to parse :type macro: :param args: args given to command line :type args: :return: argument at position N-1 in args table (where N is the int parsed) ...
Get argument from macro name ie : $ARG3$ -> args[2] :param macro: macro to parse :type macro: :param args: args given to command line :type args: :return: argument at position N-1 in args table (where N is the int parsed) :rtype: None | str
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L500-L521
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._resolve_ondemand
def _resolve_ondemand(self, macro, data): # pylint: disable=too-many-locals """Get on demand macro value If the macro cannot be resolved, this function will return 'n/a' rather than an empty string, this to alert the caller of a potential problem. :param macro: macro to parse ...
python
def _resolve_ondemand(self, macro, data): # pylint: disable=too-many-locals """Get on demand macro value If the macro cannot be resolved, this function will return 'n/a' rather than an empty string, this to alert the caller of a potential problem. :param macro: macro to parse ...
Get on demand macro value If the macro cannot be resolved, this function will return 'n/a' rather than an empty string, this to alert the caller of a potential problem. :param macro: macro to parse :type macro: :param data: data to get value from :type data: :re...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L523-L581
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._tot_hosts_by_state
def _tot_hosts_by_state(self, state=None, state_type=None): """Generic function to get the number of host in the specified state :param state: state to filter on :type state: str :param state_type: state type to filter on (HARD, SOFT) :type state_type: str :return: numbe...
python
def _tot_hosts_by_state(self, state=None, state_type=None): """Generic function to get the number of host in the specified state :param state: state to filter on :type state: str :param state_type: state type to filter on (HARD, SOFT) :type state_type: str :return: numbe...
Generic function to get the number of host in the specified state :param state: state to filter on :type state: str :param state_type: state type to filter on (HARD, SOFT) :type state_type: str :return: number of host in state *state* :rtype: int
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L648-L662
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._tot_unhandled_hosts_by_state
def _tot_unhandled_hosts_by_state(self, state): """Generic function to get the number of unhandled problem hosts in the specified state :param state: state to filter on :type state: :return: number of host in state *state* and which are not acknowledged problems :rtype: int ...
python
def _tot_unhandled_hosts_by_state(self, state): """Generic function to get the number of unhandled problem hosts in the specified state :param state: state to filter on :type state: :return: number of host in state *state* and which are not acknowledged problems :rtype: int ...
Generic function to get the number of unhandled problem hosts in the specified state :param state: state to filter on :type state: :return: number of host in state *state* and which are not acknowledged problems :rtype: int
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L664-L673
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._get_total_hosts_problems_unhandled
def _get_total_hosts_problems_unhandled(self): """ Get the number of host problems not handled :return: Number of hosts which are problems and not handled :rtype: int """ return sum(1 for h in self.hosts if h.is_problem and not h.problem_has_been_acknowledged)
python
def _get_total_hosts_problems_unhandled(self): """ Get the number of host problems not handled :return: Number of hosts which are problems and not handled :rtype: int """ return sum(1 for h in self.hosts if h.is_problem and not h.problem_has_been_acknowledged)
Get the number of host problems not handled :return: Number of hosts which are problems and not handled :rtype: int
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L737-L744
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._get_total_hosts_problems_handled
def _get_total_hosts_problems_handled(self): """ Get the number of host problems not handled :return: Number of hosts which are problems and not handled :rtype: int """ return sum(1 for h in self.hosts if h.is_problem and h.problem_has_been_acknowledged)
python
def _get_total_hosts_problems_handled(self): """ Get the number of host problems not handled :return: Number of hosts which are problems and not handled :rtype: int """ return sum(1 for h in self.hosts if h.is_problem and h.problem_has_been_acknowledged)
Get the number of host problems not handled :return: Number of hosts which are problems and not handled :rtype: int
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L746-L753
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._get_total_hosts_not_monitored
def _get_total_hosts_not_monitored(self): """ Get the number of host not monitored (active and passive checks disabled) :return: Number of hosts which are not monitored :rtype: int """ return sum(1 for h in self.hosts if not h.active_checks_enabled and ...
python
def _get_total_hosts_not_monitored(self): """ Get the number of host not monitored (active and passive checks disabled) :return: Number of hosts which are not monitored :rtype: int """ return sum(1 for h in self.hosts if not h.active_checks_enabled and ...
Get the number of host not monitored (active and passive checks disabled) :return: Number of hosts which are not monitored :rtype: int
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L764-L772
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._tot_services_by_state
def _tot_services_by_state(self, state=None, state_type=None): """Generic function to get the number of services in the specified state :param state: state to filter on :type state: str :param state_type: state type to filter on (HARD, SOFT) :type state_type: str :return...
python
def _tot_services_by_state(self, state=None, state_type=None): """Generic function to get the number of services in the specified state :param state: state to filter on :type state: str :param state_type: state type to filter on (HARD, SOFT) :type state_type: str :return...
Generic function to get the number of services in the specified state :param state: state to filter on :type state: str :param state_type: state type to filter on (HARD, SOFT) :type state_type: str :return: number of host in state *state* :rtype: int TODO: Should...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L783-L798
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._tot_unhandled_services_by_state
def _tot_unhandled_services_by_state(self, state): """Generic function to get the number of unhandled problem services in the specified state :param state: state to filter on :type state: :return: number of service in state *state* and which are not acknowledged problems :rtype:...
python
def _tot_unhandled_services_by_state(self, state): """Generic function to get the number of unhandled problem services in the specified state :param state: state to filter on :type state: :return: number of service in state *state* and which are not acknowledged problems :rtype:...
Generic function to get the number of unhandled problem services in the specified state :param state: state to filter on :type state: :return: number of service in state *state* and which are not acknowledged problems :rtype: int
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L800-L809
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._get_total_services_problems_unhandled
def _get_total_services_problems_unhandled(self): """Get the number of services that are a problem and that are not acknowledged :return: number of problem services which are not acknowledged :rtype: int """ return sum(1 for s in self.services if s.is_problem and not s.problem_h...
python
def _get_total_services_problems_unhandled(self): """Get the number of services that are a problem and that are not acknowledged :return: number of problem services which are not acknowledged :rtype: int """ return sum(1 for s in self.services if s.is_problem and not s.problem_h...
Get the number of services that are a problem and that are not acknowledged :return: number of problem services which are not acknowledged :rtype: int
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L900-L906
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._get_total_services_problems_handled
def _get_total_services_problems_handled(self): """ Get the number of service problems not handled :return: Number of services which are problems and not handled :rtype: int """ return sum(1 for s in self.services if s.is_problem and s.problem_has_been_acknowledged)
python
def _get_total_services_problems_handled(self): """ Get the number of service problems not handled :return: Number of services which are problems and not handled :rtype: int """ return sum(1 for s in self.services if s.is_problem and s.problem_has_been_acknowledged)
Get the number of service problems not handled :return: Number of services which are problems and not handled :rtype: int
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L908-L915
Alignak-monitoring/alignak
alignak/macroresolver.py
MacroResolver._get_total_services_not_monitored
def _get_total_services_not_monitored(self): """ Get the number of service not monitored (active and passive checks disabled) :return: Number of services which are not monitored :rtype: int """ return sum(1 for s in self.services if not s.active_checks_enabled and ...
python
def _get_total_services_not_monitored(self): """ Get the number of service not monitored (active and passive checks disabled) :return: Number of services which are not monitored :rtype: int """ return sum(1 for s in self.services if not s.active_checks_enabled and ...
Get the number of service not monitored (active and passive checks disabled) :return: Number of services which are not monitored :rtype: int
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/macroresolver.py#L926-L934
Alignak-monitoring/alignak
alignak/misc/carboniface.py
CarbonIface.add_data
def add_data(self, metric, value, ts=None): """ Add data to queue :param metric: the metric name :type metric: str :param value: the value of data :type value: int :param ts: the timestamp :type ts: int | None :return: True if added successfully, ...
python
def add_data(self, metric, value, ts=None): """ Add data to queue :param metric: the metric name :type metric: str :param value: the value of data :type value: int :param ts: the timestamp :type ts: int | None :return: True if added successfully, ...
Add data to queue :param metric: the metric name :type metric: str :param value: the value of data :type value: int :param ts: the timestamp :type ts: int | None :return: True if added successfully, otherwise False :rtype: bool
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/misc/carboniface.py#L40-L59
Alignak-monitoring/alignak
alignak/misc/carboniface.py
CarbonIface.add_data_dict
def add_data_dict(self, dd): # pragma: no cover - never used... """ dd must be a dictionary where keys are the metric name, each key contains a dictionary which at least must have 'value' key (optionally 'ts') dd = {'experiment1.subsystem.block.metric1': {'value': 12.3, 'ts': 137949160...
python
def add_data_dict(self, dd): # pragma: no cover - never used... """ dd must be a dictionary where keys are the metric name, each key contains a dictionary which at least must have 'value' key (optionally 'ts') dd = {'experiment1.subsystem.block.metric1': {'value': 12.3, 'ts': 137949160...
dd must be a dictionary where keys are the metric name, each key contains a dictionary which at least must have 'value' key (optionally 'ts') dd = {'experiment1.subsystem.block.metric1': {'value': 12.3, 'ts': 1379491605.55}, 'experiment1.subsystem.block.metric2': {'value': 1.35}, ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/misc/carboniface.py#L61-L77
Alignak-monitoring/alignak
alignak/misc/carboniface.py
CarbonIface.add_data_list
def add_data_list(self, dl): # pragma: no cover - never used... """ dl must be a list of tuples like: dl = [('metricname', (timestamp, value)), ('metricname', (timestamp, value)), ...] """ if self.__data_lock.acquire(): self.__data.extend(...
python
def add_data_list(self, dl): # pragma: no cover - never used... """ dl must be a list of tuples like: dl = [('metricname', (timestamp, value)), ('metricname', (timestamp, value)), ...] """ if self.__data_lock.acquire(): self.__data.extend(...
dl must be a list of tuples like: dl = [('metricname', (timestamp, value)), ('metricname', (timestamp, value)), ...]
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/misc/carboniface.py#L79-L90
Alignak-monitoring/alignak
alignak/misc/carboniface.py
CarbonIface.send_data
def send_data(self, data=None): """If data is empty, current buffer is sent. Otherwise data must be like: data = [('metricname', (timestamp, value)), ('metricname', (timestamp, value)), ...] """ save_in_error = False if not data: if self.__...
python
def send_data(self, data=None): """If data is empty, current buffer is sent. Otherwise data must be like: data = [('metricname', (timestamp, value)), ('metricname', (timestamp, value)), ...] """ save_in_error = False if not data: if self.__...
If data is empty, current buffer is sent. Otherwise data must be like: data = [('metricname', (timestamp, value)), ('metricname', (timestamp, value)), ...]
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/misc/carboniface.py#L92-L125
Alignak-monitoring/alignak
alignak/modulesmanager.py
ModulesManager.set_daemon_name
def set_daemon_name(self, daemon_name): """Set the daemon name of the daemon which this manager is attached to and propagate this daemon name to our managed modules :param daemon_name: :return: """ self.daemon_name = daemon_name for instance in self.instances: ...
python
def set_daemon_name(self, daemon_name): """Set the daemon name of the daemon which this manager is attached to and propagate this daemon name to our managed modules :param daemon_name: :return: """ self.daemon_name = daemon_name for instance in self.instances: ...
Set the daemon name of the daemon which this manager is attached to and propagate this daemon name to our managed modules :param daemon_name: :return:
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modulesmanager.py#L90-L99
Alignak-monitoring/alignak
alignak/modulesmanager.py
ModulesManager.load_and_init
def load_and_init(self, modules): """Import, instantiate & "init" the modules we manage :param modules: list of the managed modules :return: True if no errors """ self.load(modules) self.get_instances() return len(self.configuration_errors) == 0
python
def load_and_init(self, modules): """Import, instantiate & "init" the modules we manage :param modules: list of the managed modules :return: True if no errors """ self.load(modules) self.get_instances() return len(self.configuration_errors) == 0
Import, instantiate & "init" the modules we manage :param modules: list of the managed modules :return: True if no errors
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modulesmanager.py#L101-L110
Alignak-monitoring/alignak
alignak/modulesmanager.py
ModulesManager.load
def load(self, modules): """Load Python modules and check their usability :param modules: list of the modules that must be loaded :return: """ self.modules_assoc = [] for module in modules: if not module.enabled: logger.info("Module %s is decl...
python
def load(self, modules): """Load Python modules and check their usability :param modules: list of the modules that must be loaded :return: """ self.modules_assoc = [] for module in modules: if not module.enabled: logger.info("Module %s is decl...
Load Python modules and check their usability :param modules: list of the modules that must be loaded :return:
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modulesmanager.py#L112-L158
Alignak-monitoring/alignak
alignak/modulesmanager.py
ModulesManager.try_instance_init
def try_instance_init(self, instance, late_start=False): """Try to "initialize" the given module instance. :param instance: instance to init :type instance: object :param late_start: If late_start, don't look for last_init_try :type late_start: bool :return: True on succ...
python
def try_instance_init(self, instance, late_start=False): """Try to "initialize" the given module instance. :param instance: instance to init :type instance: object :param late_start: If late_start, don't look for last_init_try :type late_start: bool :return: True on succ...
Try to "initialize" the given module instance. :param instance: instance to init :type instance: object :param late_start: If late_start, don't look for last_init_try :type late_start: bool :return: True on successful init. False if instance init method raised any Exception. ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modulesmanager.py#L160-L202
Alignak-monitoring/alignak
alignak/modulesmanager.py
ModulesManager.clear_instances
def clear_instances(self, instances=None): """Request to "remove" the given instances list or all if not provided :param instances: instances to remove (all instances are removed if None) :type instances: :return: None """ if instances is None: instances = se...
python
def clear_instances(self, instances=None): """Request to "remove" the given instances list or all if not provided :param instances: instances to remove (all instances are removed if None) :type instances: :return: None """ if instances is None: instances = se...
Request to "remove" the given instances list or all if not provided :param instances: instances to remove (all instances are removed if None) :type instances: :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modulesmanager.py#L204-L214
Alignak-monitoring/alignak
alignak/modulesmanager.py
ModulesManager.set_to_restart
def set_to_restart(self, instance): """Put an instance to the restart queue :param instance: instance to restart :type instance: object :return: None """ self.to_restart.append(instance) if instance.is_external: instance.proc = None
python
def set_to_restart(self, instance): """Put an instance to the restart queue :param instance: instance to restart :type instance: object :return: None """ self.to_restart.append(instance) if instance.is_external: instance.proc = None
Put an instance to the restart queue :param instance: instance to restart :type instance: object :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modulesmanager.py#L216-L225
Alignak-monitoring/alignak
alignak/modulesmanager.py
ModulesManager.get_instances
def get_instances(self): """Create, init and then returns the list of module instances that the caller needs. This method is called once the Python modules are loaded to initialize the modules. If an instance can't be created or initialized then only log is doneand that instance is ski...
python
def get_instances(self): """Create, init and then returns the list of module instances that the caller needs. This method is called once the Python modules are loaded to initialize the modules. If an instance can't be created or initialized then only log is doneand that instance is ski...
Create, init and then returns the list of module instances that the caller needs. This method is called once the Python modules are loaded to initialize the modules. If an instance can't be created or initialized then only log is doneand that instance is skipped. The previous modules instance(...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modulesmanager.py#L227-L281
Alignak-monitoring/alignak
alignak/modulesmanager.py
ModulesManager.start_external_instances
def start_external_instances(self, late_start=False): """Launch external instances that are load correctly :param late_start: If late_start, don't look for last_init_try :type late_start: bool :return: None """ for instance in [i for i in self.instances if i.is_external]...
python
def start_external_instances(self, late_start=False): """Launch external instances that are load correctly :param late_start: If late_start, don't look for last_init_try :type late_start: bool :return: None """ for instance in [i for i in self.instances if i.is_external]...
Launch external instances that are load correctly :param late_start: If late_start, don't look for last_init_try :type late_start: bool :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modulesmanager.py#L283-L300
Alignak-monitoring/alignak
alignak/modulesmanager.py
ModulesManager.remove_instance
def remove_instance(self, instance): """Request to cleanly remove the given instance. If instance is external also shutdown it cleanly :param instance: instance to remove :type instance: object :return: None """ # External instances need to be close before (proce...
python
def remove_instance(self, instance): """Request to cleanly remove the given instance. If instance is external also shutdown it cleanly :param instance: instance to remove :type instance: object :return: None """ # External instances need to be close before (proce...
Request to cleanly remove the given instance. If instance is external also shutdown it cleanly :param instance: instance to remove :type instance: object :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modulesmanager.py#L302-L319
Alignak-monitoring/alignak
alignak/modulesmanager.py
ModulesManager.check_alive_instances
def check_alive_instances(self): """Check alive instances. If not, log error and try to restart it :return: None """ # Only for external for instance in self.instances: if instance in self.to_restart: continue if instance.is_exter...
python
def check_alive_instances(self): """Check alive instances. If not, log error and try to restart it :return: None """ # Only for external for instance in self.instances: if instance in self.to_restart: continue if instance.is_exter...
Check alive instances. If not, log error and try to restart it :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modulesmanager.py#L321-L359
Alignak-monitoring/alignak
alignak/modulesmanager.py
ModulesManager.try_to_restart_deads
def try_to_restart_deads(self): """Try to reinit and restart dead instances :return: None """ to_restart = self.to_restart[:] del self.to_restart[:] for instance in to_restart: logger.warning("Trying to restart module: %s", instance.name) if sel...
python
def try_to_restart_deads(self): """Try to reinit and restart dead instances :return: None """ to_restart = self.to_restart[:] del self.to_restart[:] for instance in to_restart: logger.warning("Trying to restart module: %s", instance.name) if sel...
Try to reinit and restart dead instances :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modulesmanager.py#L361-L381
Alignak-monitoring/alignak
alignak/modulesmanager.py
ModulesManager.get_internal_instances
def get_internal_instances(self, phase=None): """Get a list of internal instances (in a specific phase) If phase is None, return all internal instances whtever the phase :param phase: phase to filter (never used) :type phase: :return: internal instances list :rtype: lis...
python
def get_internal_instances(self, phase=None): """Get a list of internal instances (in a specific phase) If phase is None, return all internal instances whtever the phase :param phase: phase to filter (never used) :type phase: :return: internal instances list :rtype: lis...
Get a list of internal instances (in a specific phase) If phase is None, return all internal instances whtever the phase :param phase: phase to filter (never used) :type phase: :return: internal instances list :rtype: list
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modulesmanager.py#L383-L398
Alignak-monitoring/alignak
alignak/modulesmanager.py
ModulesManager.get_external_instances
def get_external_instances(self, phase=None): """Get a list of external instances (in a specific phase) If phase is None, return all external instances whtever the phase :param phase: phase to filter (never used) :type phase: :return: external instances list :rtype: lis...
python
def get_external_instances(self, phase=None): """Get a list of external instances (in a specific phase) If phase is None, return all external instances whtever the phase :param phase: phase to filter (never used) :type phase: :return: external instances list :rtype: lis...
Get a list of external instances (in a specific phase) If phase is None, return all external instances whtever the phase :param phase: phase to filter (never used) :type phase: :return: external instances list :rtype: list
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modulesmanager.py#L400-L415
Alignak-monitoring/alignak
alignak/modulesmanager.py
ModulesManager.stop_all
def stop_all(self): """Stop all module instances :return: None """ logger.info('Shutting down modules...') # Ask internal to quit if they can for instance in self.get_internal_instances(): if hasattr(instance, 'quit') and isinstance(instance.quit, collections...
python
def stop_all(self): """Stop all module instances :return: None """ logger.info('Shutting down modules...') # Ask internal to quit if they can for instance in self.get_internal_instances(): if hasattr(instance, 'quit') and isinstance(instance.quit, collections...
Stop all module instances :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modulesmanager.py#L417-L428
Alignak-monitoring/alignak
alignak/bin/alignak_environment.py
main
def main(): """ Main function """ parsed_configuration = AlignakConfigParser() try: parsed_configuration.parse() except configparser.ParsingError as exp: print("Environment file parsing error: %s", exp) if parsed_configuration.export: # Export Alignak version ...
python
def main(): """ Main function """ parsed_configuration = AlignakConfigParser() try: parsed_configuration.parse() except configparser.ParsingError as exp: print("Environment file parsing error: %s", exp) if parsed_configuration.export: # Export Alignak version ...
Main function
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/bin/alignak_environment.py#L408-L420
Alignak-monitoring/alignak
alignak/bin/alignak_environment.py
AlignakConfigParser.parse
def parse(self): # pylint: disable=too-many-branches """ Check if some extra configuration files are existing in an `alignak.d` sub directory near the found configuration file. Parse the Alignak configuration file(s) Exit the script if some errors are encountered. ...
python
def parse(self): # pylint: disable=too-many-branches """ Check if some extra configuration files are existing in an `alignak.d` sub directory near the found configuration file. Parse the Alignak configuration file(s) Exit the script if some errors are encountered. ...
Check if some extra configuration files are existing in an `alignak.d` sub directory near the found configuration file. Parse the Alignak configuration file(s) Exit the script if some errors are encountered. :return: True/False
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/bin/alignak_environment.py#L172-L242
Alignak-monitoring/alignak
alignak/bin/alignak_environment.py
AlignakConfigParser.write
def write(self, env_file): """ Write the Alignak configuration to a file :param env_file: file name to dump the configuration :type env_file: str :return: True/False """ try: with open(env_file, "w") as out_file: self.config.write(out_...
python
def write(self, env_file): """ Write the Alignak configuration to a file :param env_file: file name to dump the configuration :type env_file: str :return: True/False """ try: with open(env_file, "w") as out_file: self.config.write(out_...
Write the Alignak configuration to a file :param env_file: file name to dump the configuration :type env_file: str :return: True/False
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/bin/alignak_environment.py#L244-L256
Alignak-monitoring/alignak
alignak/bin/alignak_environment.py
AlignakConfigParser._search_sections
def _search_sections(self, searched_sections=''): """ Search sections in the configuration which name starts with the provided search criteria :param searched_sections: :return: a dict containing the found sections and their parameters """ found_sections = {} # Ge...
python
def _search_sections(self, searched_sections=''): """ Search sections in the configuration which name starts with the provided search criteria :param searched_sections: :return: a dict containing the found sections and their parameters """ found_sections = {} # Ge...
Search sections in the configuration which name starts with the provided search criteria :param searched_sections: :return: a dict containing the found sections and their parameters
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/bin/alignak_environment.py#L258-L274
Alignak-monitoring/alignak
alignak/bin/alignak_environment.py
AlignakConfigParser.get_alignak_macros
def get_alignak_macros(self): """ Get the Alignak macros. :return: a dict containing the Alignak macros """ macros = self.get_alignak_configuration(macros=True) sections = self._search_sections('pack.') for name, _ in list(sections.items()): section_...
python
def get_alignak_macros(self): """ Get the Alignak macros. :return: a dict containing the Alignak macros """ macros = self.get_alignak_configuration(macros=True) sections = self._search_sections('pack.') for name, _ in list(sections.items()): section_...
Get the Alignak macros. :return: a dict containing the Alignak macros
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/bin/alignak_environment.py#L292-L304
Alignak-monitoring/alignak
alignak/bin/alignak_environment.py
AlignakConfigParser.get_alignak_configuration
def get_alignak_configuration(self, section=SECTION_CONFIGURATION, legacy_cfg=False, macros=False): """ Get the Alignak configuration parameters. All the variables included in the SECTION_CONFIGURATION section except the variables starting with 'cfg' and...
python
def get_alignak_configuration(self, section=SECTION_CONFIGURATION, legacy_cfg=False, macros=False): """ Get the Alignak configuration parameters. All the variables included in the SECTION_CONFIGURATION section except the variables starting with 'cfg' and...
Get the Alignak configuration parameters. All the variables included in the SECTION_CONFIGURATION section except the variables starting with 'cfg' and the macros. If `lecagy_cfg` is True, this function only returns the variables included in the SECTION_CONFIGURATION section except the v...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/bin/alignak_environment.py#L306-L345
Alignak-monitoring/alignak
alignak/bin/alignak_environment.py
AlignakConfigParser.get_daemons
def get_daemons(self, daemon_name=None, daemon_type=None): """ Get the daemons configuration parameters If name is provided, get the configuration for this daemon, else, If type is provided, get the configuration for all the daemons of this type, else get the configuration of al...
python
def get_daemons(self, daemon_name=None, daemon_type=None): """ Get the daemons configuration parameters If name is provided, get the configuration for this daemon, else, If type is provided, get the configuration for all the daemons of this type, else get the configuration of al...
Get the daemons configuration parameters If name is provided, get the configuration for this daemon, else, If type is provided, get the configuration for all the daemons of this type, else get the configuration of all the daemons. :param daemon_name: the searched daemon name :p...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/bin/alignak_environment.py#L347-L372
Alignak-monitoring/alignak
alignak/bin/alignak_environment.py
AlignakConfigParser.get_modules
def get_modules(self, name=None, daemon_name=None, names_only=True): """ Get the modules configuration parameters If name is provided, get the configuration for this module, else, If daemon_name is provided, get the configuration for all the modules of this daemon, else get the ...
python
def get_modules(self, name=None, daemon_name=None, names_only=True): """ Get the modules configuration parameters If name is provided, get the configuration for this module, else, If daemon_name is provided, get the configuration for all the modules of this daemon, else get the ...
Get the modules configuration parameters If name is provided, get the configuration for this module, else, If daemon_name is provided, get the configuration for all the modules of this daemon, else get the configuration of all the modules. :param name: the searched module name ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/bin/alignak_environment.py#L374-L405
Alignak-monitoring/alignak
alignak/objects/itemgroup.py
Itemgroup.copy_shell
def copy_shell(self): """ Copy the group properties EXCEPT the members. Members need to be filled after manually :return: Itemgroup object :rtype: alignak.objects.itemgroup.Itemgroup :return: None """ cls = self.__class__ new_i = cls() # create a...
python
def copy_shell(self): """ Copy the group properties EXCEPT the members. Members need to be filled after manually :return: Itemgroup object :rtype: alignak.objects.itemgroup.Itemgroup :return: None """ cls = self.__class__ new_i = cls() # create a...
Copy the group properties EXCEPT the members. Members need to be filled after manually :return: Itemgroup object :rtype: alignak.objects.itemgroup.Itemgroup :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/itemgroup.py#L100-L121
Alignak-monitoring/alignak
alignak/objects/itemgroup.py
Itemgroup.add_members
def add_members(self, members): """Add a new member to the members list :param members: member name :type members: str :return: None """ if not isinstance(members, list): members = [members] if not getattr(self, 'members', None): self.mem...
python
def add_members(self, members): """Add a new member to the members list :param members: member name :type members: str :return: None """ if not isinstance(members, list): members = [members] if not getattr(self, 'members', None): self.mem...
Add a new member to the members list :param members: member name :type members: str :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/itemgroup.py#L144-L157