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/objects/config.py
Config.prepare_for_sending
def prepare_for_sending(self): """The configuration needs to be serialized before being sent to a spare arbiter :return: None """ if [arbiter_link for arbiter_link in self.arbiters if arbiter_link.spare]: logger.info('Serializing the configuration for my spare arbiter...') ...
python
def prepare_for_sending(self): """The configuration needs to be serialized before being sent to a spare arbiter :return: None """ if [arbiter_link for arbiter_link in self.arbiters if arbiter_link.spare]: logger.info('Serializing the configuration for my spare arbiter...') ...
The configuration needs to be serialized before being sent to a spare arbiter :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/config.py#L3042-L3051
Alignak-monitoring/alignak
alignak/objects/config.py
Config.dump
def dump(self, dump_file_name=None): """Dump configuration to a file in a JSON format :param dump_file_name: the file to dump configuration to :type dump_file_name: str :return: None """ config_dump = {} for _, _, category, _, _ in list(self.types_creations.valu...
python
def dump(self, dump_file_name=None): """Dump configuration to a file in a JSON format :param dump_file_name: the file to dump configuration to :type dump_file_name: str :return: None """ config_dump = {} for _, _, category, _, _ in list(self.types_creations.valu...
Dump configuration to a file in a JSON format :param dump_file_name: the file to dump configuration to :type dump_file_name: str :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/config.py#L3053-L3090
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.add
def add(self, elt): """Generic function to add objects to the daemon internal lists. Manage Broks, External commands :param elt: objects to add :type elt: alignak.AlignakObject :return: None """ if isinstance(elt, Brok): # For brok, we tag the brok wi...
python
def add(self, elt): """Generic function to add objects to the daemon internal lists. Manage Broks, External commands :param elt: objects to add :type elt: alignak.AlignakObject :return: None """ if isinstance(elt, Brok): # For brok, we tag the brok wi...
Generic function to add objects to the daemon internal lists. Manage Broks, External commands :param elt: objects to add :type elt: alignak.AlignakObject :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L217-L243
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.push_broks_to_broker
def push_broks_to_broker(self): # pragma: no cover - not used! """Send all broks from arbiter internal list to broker The arbiter get some broks and then pushes them to all the brokers. :return: None """ someone_is_concerned = False sent = False for broker_link...
python
def push_broks_to_broker(self): # pragma: no cover - not used! """Send all broks from arbiter internal list to broker The arbiter get some broks and then pushes them to all the brokers. :return: None """ someone_is_concerned = False sent = False for broker_link...
Send all broks from arbiter internal list to broker The arbiter get some broks and then pushes them to all the brokers. :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L268-L291
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.push_external_commands_to_schedulers
def push_external_commands_to_schedulers(self): # pragma: no cover - not used! """Send external commands to schedulers :return: None """ # Now get all external commands and push them to the schedulers for external_command in self.external_commands: self.external_com...
python
def push_external_commands_to_schedulers(self): # pragma: no cover - not used! """Send external commands to schedulers :return: None """ # Now get all external commands and push them to the schedulers for external_command in self.external_commands: self.external_com...
Send external commands to schedulers :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L293-L314
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.get_broks_from_satellites
def get_broks_from_satellites(self): # pragma: no cover - not used! """Get broks from my all internal satellite links The arbiter get the broks from ALL the known satellites :return: None """ for satellites in [self.conf.brokers, self.conf.schedulers, ...
python
def get_broks_from_satellites(self): # pragma: no cover - not used! """Get broks from my all internal satellite links The arbiter get the broks from ALL the known satellites :return: None """ for satellites in [self.conf.brokers, self.conf.schedulers, ...
Get broks from my all internal satellite links The arbiter get the broks from ALL the known satellites :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L327-L345
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.get_initial_broks_from_satellites
def get_initial_broks_from_satellites(self): """Get initial broks from my internal satellite links :return: None """ for satellites in [self.conf.brokers, self.conf.schedulers, self.conf.pollers, self.conf.reactionners, self.conf.receivers]: for sa...
python
def get_initial_broks_from_satellites(self): """Get initial broks from my internal satellite links :return: None """ for satellites in [self.conf.brokers, self.conf.schedulers, self.conf.pollers, self.conf.reactionners, self.conf.receivers]: for sa...
Get initial broks from my internal satellite links :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L347-L361
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.load_monitoring_config_file
def load_monitoring_config_file(self, clean=True): # pylint: disable=too-many-branches,too-many-statements, too-many-locals """Load main configuration file (alignak.cfg):: * Read all files given in the -c parameters * Read all .cfg files in cfg_dir * Read all files in cfg_file ...
python
def load_monitoring_config_file(self, clean=True): # pylint: disable=too-many-branches,too-many-statements, too-many-locals """Load main configuration file (alignak.cfg):: * Read all files given in the -c parameters * Read all .cfg files in cfg_dir * Read all files in cfg_file ...
Load main configuration file (alignak.cfg):: * Read all files given in the -c parameters * Read all .cfg files in cfg_dir * Read all files in cfg_file * Create objects (Arbiter, Module) * Set HTTP links info (ssl etc) * Load its own modules * Execute read_configu...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L363-L819
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.load_modules_configuration_objects
def load_modules_configuration_objects(self, raw_objects): # pragma: no cover, # not yet with unit tests. """Load configuration objects from arbiter modules If module implements get_objects arbiter will call it and add create objects :param raw_objects: raw objects we got from ...
python
def load_modules_configuration_objects(self, raw_objects): # pragma: no cover, # not yet with unit tests. """Load configuration objects from arbiter modules If module implements get_objects arbiter will call it and add create objects :param raw_objects: raw objects we got from ...
Load configuration objects from arbiter modules If module implements get_objects arbiter will call it and add create objects :param raw_objects: raw objects we got from reading config files :type raw_objects: dict :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L821-L871
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.load_modules_alignak_configuration
def load_modules_alignak_configuration(self): # pragma: no cover, not yet with unit tests. """Load Alignak configuration from the arbiter modules If module implements get_alignak_configuration, call this function :param raw_objects: raw objects we got from reading config files :type ra...
python
def load_modules_alignak_configuration(self): # pragma: no cover, not yet with unit tests. """Load Alignak configuration from the arbiter modules If module implements get_alignak_configuration, call this function :param raw_objects: raw objects we got from reading config files :type ra...
Load Alignak configuration from the arbiter modules If module implements get_alignak_configuration, call this function :param raw_objects: raw objects we got from reading config files :type raw_objects: dict :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L873-L919
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.request_stop
def request_stop(self, message='', exit_code=0): """Stop the Arbiter daemon :return: None """ # Only a master arbiter can stop the daemons if self.is_master: # Stop the daemons self.daemons_stop(timeout=self.conf.daemons_stop_timeout) # Request t...
python
def request_stop(self, message='', exit_code=0): """Stop the Arbiter daemon :return: None """ # Only a master arbiter can stop the daemons if self.is_master: # Stop the daemons self.daemons_stop(timeout=self.conf.daemons_stop_timeout) # Request t...
Stop the Arbiter daemon :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L921-L932
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.start_daemon
def start_daemon(self, satellite): """Manage the list of detected missing daemons If the daemon does not in exist `my_daemons`, then: - prepare daemon start arguments (port, name and log file) - start the daemon - make sure it started correctly :param satellite: ...
python
def start_daemon(self, satellite): """Manage the list of detected missing daemons If the daemon does not in exist `my_daemons`, then: - prepare daemon start arguments (port, name and log file) - start the daemon - make sure it started correctly :param satellite: ...
Manage the list of detected missing daemons If the daemon does not in exist `my_daemons`, then: - prepare daemon start arguments (port, name and log file) - start the daemon - make sure it started correctly :param satellite: the satellite for which a daemon is to be star...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L934-L984
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.daemons_start
def daemons_start(self, run_daemons=True): """Manage the list of the daemons in the configuration Check if the daemon needs to be started by the Arbiter. If so, starts the daemon if `run_daemons` is True :param run_daemons: run the daemons or make a simple check :type run_daem...
python
def daemons_start(self, run_daemons=True): """Manage the list of the daemons in the configuration Check if the daemon needs to be started by the Arbiter. If so, starts the daemon if `run_daemons` is True :param run_daemons: run the daemons or make a simple check :type run_daem...
Manage the list of the daemons in the configuration Check if the daemon needs to be started by the Arbiter. If so, starts the daemon if `run_daemons` is True :param run_daemons: run the daemons or make a simple check :type run_daemons: bool :return: True if all daemons are ru...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L986-L1043
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.daemons_check
def daemons_check(self): """Manage the list of Alignak launched daemons Check if the daemon process is running :return: True if all daemons are running, else False """ # First look if it's not too early to ping start = time.time() if self.daemons_last_check \ ...
python
def daemons_check(self): """Manage the list of Alignak launched daemons Check if the daemon process is running :return: True if all daemons are running, else False """ # First look if it's not too early to ping start = time.time() if self.daemons_last_check \ ...
Manage the list of Alignak launched daemons Check if the daemon process is running :return: True if all daemons are running, else False
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L1045-L1107
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.daemons_stop
def daemons_stop(self, timeout=30, kill_children=False): """Stop the Alignak daemons Iterate over the self-launched daemons and their children list to send a TERM Wait for daemons to terminate and then send a KILL for those that are not yet stopped As a default behavior, only the la...
python
def daemons_stop(self, timeout=30, kill_children=False): """Stop the Alignak daemons Iterate over the self-launched daemons and their children list to send a TERM Wait for daemons to terminate and then send a KILL for those that are not yet stopped As a default behavior, only the la...
Stop the Alignak daemons Iterate over the self-launched daemons and their children list to send a TERM Wait for daemons to terminate and then send a KILL for those that are not yet stopped As a default behavior, only the launched daemons are killed, not their children. Each daemon ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L1109-L1170
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.daemons_reachability_check
def daemons_reachability_check(self): """Manage the list of Alignak launched daemons Check if the daemon process is running :return: True if all daemons are running, else False """ # First look if it's not too early to ping start = time.time() if self.daemons_l...
python
def daemons_reachability_check(self): """Manage the list of Alignak launched daemons Check if the daemon process is running :return: True if all daemons are running, else False """ # First look if it's not too early to ping start = time.time() if self.daemons_l...
Manage the list of Alignak launched daemons Check if the daemon process is running :return: True if all daemons are running, else False
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L1172-L1217
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.setup_new_conf
def setup_new_conf(self): # pylint: disable=too-many-locals """ Setup a new configuration received from a Master arbiter. TODO: perharps we should not accept the configuration or raise an error if we do not find our own configuration data in the data. Thus this should never happen... ...
python
def setup_new_conf(self): # pylint: disable=too-many-locals """ Setup a new configuration received from a Master arbiter. TODO: perharps we should not accept the configuration or raise an error if we do not find our own configuration data in the data. Thus this should never happen... ...
Setup a new configuration received from a Master arbiter. TODO: perharps we should not accept the configuration or raise an error if we do not find our own configuration data in the data. Thus this should never happen... :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L1219-L1342
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.wait_for_master_death
def wait_for_master_death(self): """Wait for a master timeout and take the lead if necessary :return: None """ logger.info("Waiting for master death") timeout = 1.0 self.last_master_ping = time.time() master_timeout = 300 for arbiter_link in self.conf.ar...
python
def wait_for_master_death(self): """Wait for a master timeout and take the lead if necessary :return: None """ logger.info("Waiting for master death") timeout = 1.0 self.last_master_ping = time.time() master_timeout = 300 for arbiter_link in self.conf.ar...
Wait for a master timeout and take the lead if necessary :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L1344-L1382
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.check_and_log_tp_activation_change
def check_and_log_tp_activation_change(self): """Raise log for timeperiod change (useful for debug) :return: None """ for timeperiod in self.conf.timeperiods: brok = timeperiod.check_and_log_activation_change() if brok: self.add(brok)
python
def check_and_log_tp_activation_change(self): """Raise log for timeperiod change (useful for debug) :return: None """ for timeperiod in self.conf.timeperiods: brok = timeperiod.check_and_log_activation_change() if brok: self.add(brok)
Raise log for timeperiod change (useful for debug) :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L1384-L1392
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.manage_signal
def manage_signal(self, sig, frame): """Manage signals caught by the process Specific behavior for the arbiter when it receives a sigkill or sigterm :param sig: signal caught by the process :type sig: str :param frame: current stack frame :type frame: :return: No...
python
def manage_signal(self, sig, frame): """Manage signals caught by the process Specific behavior for the arbiter when it receives a sigkill or sigterm :param sig: signal caught by the process :type sig: str :param frame: current stack frame :type frame: :return: No...
Manage signals caught by the process Specific behavior for the arbiter when it receives a sigkill or sigterm :param sig: signal caught by the process :type sig: str :param frame: current stack frame :type frame: :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L1394-L1411
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.configuration_dispatch
def configuration_dispatch(self, not_configured=None): """Monitored configuration preparation and dispatch :return: None """ if not not_configured: self.dispatcher = Dispatcher(self.conf, self.link_to_myself) # I set my own dispatched configuration as the provide...
python
def configuration_dispatch(self, not_configured=None): """Monitored configuration preparation and dispatch :return: None """ if not not_configured: self.dispatcher = Dispatcher(self.conf, self.link_to_myself) # I set my own dispatched configuration as the provide...
Monitored configuration preparation and dispatch :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L1413-L1504
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.do_before_loop
def do_before_loop(self): """Called before the main daemon loop. :return: None """ logger.info("I am the arbiter: %s", self.link_to_myself.name) # If I am a spare, I do not have anything to do here... if not self.is_master: logger.debug("Waiting for my maste...
python
def do_before_loop(self): """Called before the main daemon loop. :return: None """ logger.info("I am the arbiter: %s", self.link_to_myself.name) # If I am a spare, I do not have anything to do here... if not self.is_master: logger.debug("Waiting for my maste...
Called before the main daemon loop. :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L1506-L1545
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.do_loop_turn
def do_loop_turn(self): # pylint: disable=too-many-branches, too-many-statements, too-many-locals """Loop turn for Arbiter If not a master daemon, wait for my master death... Else, run: * Check satellites are alive * Check and dispatch (if needed) the configuration ...
python
def do_loop_turn(self): # pylint: disable=too-many-branches, too-many-statements, too-many-locals """Loop turn for Arbiter If not a master daemon, wait for my master death... Else, run: * Check satellites are alive * Check and dispatch (if needed) the configuration ...
Loop turn for Arbiter If not a master daemon, wait for my master death... Else, run: * Check satellites are alive * Check and dispatch (if needed) the configuration * Get broks and external commands from the satellites * Push broks and external commands to the satellites...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L1547-L1695
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.get_daemon_stats
def get_daemon_stats(self, details=False): # pylint: disable=too-many-branches """Increase the stats provided by the Daemon base class :return: stats dictionary :rtype: dict """ now = int(time.time()) # Call the base Daemon one res = super(Arbiter, self).get_dae...
python
def get_daemon_stats(self, details=False): # pylint: disable=too-many-branches """Increase the stats provided by the Daemon base class :return: stats dictionary :rtype: dict """ now = int(time.time()) # Call the base Daemon one res = super(Arbiter, self).get_dae...
Increase the stats provided by the Daemon base class :return: stats dictionary :rtype: dict
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L1697-L1799
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.get_monitoring_problems
def get_monitoring_problems(self): """Get the schedulers satellites problems list :return: problems dictionary :rtype: dict """ res = self.get_id() res['problems'] = {} # Report our schedulers information, but only if a dispatcher exists if getattr(self,...
python
def get_monitoring_problems(self): """Get the schedulers satellites problems list :return: problems dictionary :rtype: dict """ res = self.get_id() res['problems'] = {} # Report our schedulers information, but only if a dispatcher exists if getattr(self,...
Get the schedulers satellites problems list :return: problems dictionary :rtype: dict
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L1801-L1826
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.get_livesynthesis
def get_livesynthesis(self): """Get the schedulers satellites live synthesis :return: compiled livesynthesis dictionary :rtype: dict """ res = self.get_id() res['livesynthesis'] = { '_overall': { '_freshness': int(time.time()), ...
python
def get_livesynthesis(self): """Get the schedulers satellites live synthesis :return: compiled livesynthesis dictionary :rtype: dict """ res = self.get_id() res['livesynthesis'] = { '_overall': { '_freshness': int(time.time()), ...
Get the schedulers satellites live synthesis :return: compiled livesynthesis dictionary :rtype: dict
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L1828-L1893
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.get_alignak_status
def get_alignak_status(self, details=False): # pylint: disable=too-many-locals, too-many-branches """Push the alignak overall state as a passive check Build all the daemons overall state as a passive check that can be notified to the Alignak WS The Alignak Arbiter is considered...
python
def get_alignak_status(self, details=False): # pylint: disable=too-many-locals, too-many-branches """Push the alignak overall state as a passive check Build all the daemons overall state as a passive check that can be notified to the Alignak WS The Alignak Arbiter is considered...
Push the alignak overall state as a passive check Build all the daemons overall state as a passive check that can be notified to the Alignak WS The Alignak Arbiter is considered as an host which services are all the Alignak running daemons. An Alignak daemon is considered as a service ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L1895-L2089
Alignak-monitoring/alignak
alignak/daemons/arbiterdaemon.py
Arbiter.main
def main(self): """Main arbiter function:: * Set logger * Init daemon * Launch modules * Endless main process loop :return: None """ try: # Start the daemon if not self.verify_only and not self.do_daemon_init_and_start(): ...
python
def main(self): """Main arbiter function:: * Set logger * Init daemon * Launch modules * Endless main process loop :return: None """ try: # Start the daemon if not self.verify_only and not self.do_daemon_init_and_start(): ...
Main arbiter function:: * Set logger * Init daemon * Launch modules * Endless main process loop :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemons/arbiterdaemon.py#L2091-L2158
Alignak-monitoring/alignak
alignak/objects/service.py
Service.overall_state_id
def overall_state_id(self): """Get the service overall state. The service overall state identifier is the service status including: - the monitored state - the acknowledged state - the downtime state The overall state is (prioritized): - a service is not monitor...
python
def overall_state_id(self): """Get the service overall state. The service overall state identifier is the service status including: - the monitored state - the acknowledged state - the downtime state The overall state is (prioritized): - a service is not monitor...
Get the service overall state. The service overall state identifier is the service status including: - the monitored state - the acknowledged state - the downtime state The overall state is (prioritized): - a service is not monitored (5) - a service critical or ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L255-L294
Alignak-monitoring/alignak
alignak/objects/service.py
Service.fill_predictive_missing_parameters
def fill_predictive_missing_parameters(self): """define state with initial_state :return: None """ if self.initial_state == 'w': self.state = u'WARNING' elif self.initial_state == 'u': self.state = u'UNKNOWN' elif self.initial_state == 'c': ...
python
def fill_predictive_missing_parameters(self): """define state with initial_state :return: None """ if self.initial_state == 'w': self.state = u'WARNING' elif self.initial_state == 'u': self.state = u'UNKNOWN' elif self.initial_state == 'c': ...
define state with initial_state :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L307-L319
Alignak-monitoring/alignak
alignak/objects/service.py
Service.get_name
def get_name(self): """Accessor to service_description attribute or name if first not defined :return: service name :rtype: str """ if hasattr(self, 'service_description'): return self.service_description if hasattr(self, 'name'): return self.name...
python
def get_name(self): """Accessor to service_description attribute or name if first not defined :return: service name :rtype: str """ if hasattr(self, 'service_description'): return self.service_description if hasattr(self, 'name'): return self.name...
Accessor to service_description attribute or name if first not defined :return: service name :rtype: str
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L351-L361
Alignak-monitoring/alignak
alignak/objects/service.py
Service.get_full_name
def get_full_name(self): """Get the full name for debugging (host_name/service_description) :return: service full name :rtype: str """ if self.is_tpl(): return "tpl-%s/%s" % (getattr(self, 'host_name', 'XxX'), self.name) if hasattr(self, 'host_name') and hasa...
python
def get_full_name(self): """Get the full name for debugging (host_name/service_description) :return: service full name :rtype: str """ if self.is_tpl(): return "tpl-%s/%s" % (getattr(self, 'host_name', 'XxX'), self.name) if hasattr(self, 'host_name') and hasa...
Get the full name for debugging (host_name/service_description) :return: service full name :rtype: str
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L363-L373
Alignak-monitoring/alignak
alignak/objects/service.py
Service.get_groupnames
def get_groupnames(self, sgs): """Get servicegroups list :return: comma separated list of servicegroups :rtype: str """ return ','.join([sgs[sg].get_name() for sg in self.servicegroups])
python
def get_groupnames(self, sgs): """Get servicegroups list :return: comma separated list of servicegroups :rtype: str """ return ','.join([sgs[sg].get_name() for sg in self.servicegroups])
Get servicegroups list :return: comma separated list of servicegroups :rtype: str
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L383-L389
Alignak-monitoring/alignak
alignak/objects/service.py
Service.is_correct
def is_correct(self): """Check if this object configuration is correct :: * Check our own specific properties * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False :rtype: bool """ state = True cls = se...
python
def is_correct(self): """Check if this object configuration is correct :: * Check our own specific properties * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False :rtype: bool """ state = True cls = se...
Check if this object configuration is correct :: * Check our own specific properties * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False :rtype: bool
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L415-L455
Alignak-monitoring/alignak
alignak/objects/service.py
Service.duplicate
def duplicate(self, host): # pylint: disable=too-many-locals """For a given host, look for all copy we must create for for_each property :param host: alignak host object :type host: alignak.objects.host.Host :return: list :rtype: list """ duplicates = []...
python
def duplicate(self, host): # pylint: disable=too-many-locals """For a given host, look for all copy we must create for for_each property :param host: alignak host object :type host: alignak.objects.host.Host :return: list :rtype: list """ duplicates = []...
For a given host, look for all copy we must create for for_each property :param host: alignak host object :type host: alignak.objects.host.Host :return: list :rtype: list
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L457-L537
Alignak-monitoring/alignak
alignak/objects/service.py
Service.set_state_from_exit_status
def set_state_from_exit_status(self, status, notif_period, hosts, services): """Set the state in UP, WARNING, CRITICAL, UNKNOWN or UNREACHABLE according to the status of a check result. :param status: integer between 0 and 4 :type status: int :return: None """ no...
python
def set_state_from_exit_status(self, status, notif_period, hosts, services): """Set the state in UP, WARNING, CRITICAL, UNKNOWN or UNREACHABLE according to the status of a check result. :param status: integer between 0 and 4 :type status: int :return: None """ no...
Set the state in UP, WARNING, CRITICAL, UNKNOWN or UNREACHABLE according to the status of a check result. :param status: integer between 0 and 4 :type status: int :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L550-L619
Alignak-monitoring/alignak
alignak/objects/service.py
Service.is_state
def is_state(self, status): # pylint: disable=too-many-return-statements """Return True if status match the current service status :param status: status to compare ( "o", "c", "w", "u", "x"). Usually comes from config files :type status: str :return: True if status <=> self.stat...
python
def is_state(self, status): # pylint: disable=too-many-return-statements """Return True if status match the current service status :param status: status to compare ( "o", "c", "w", "u", "x"). Usually comes from config files :type status: str :return: True if status <=> self.stat...
Return True if status match the current service status :param status: status to compare ( "o", "c", "w", "u", "x"). Usually comes from config files :type status: str :return: True if status <=> self.status, otherwise False :rtype: bool
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L621-L643
Alignak-monitoring/alignak
alignak/objects/service.py
Service.last_time_non_ok_or_up
def last_time_non_ok_or_up(self): """Get the last time the service was in a non-OK state :return: the nearest last time the service was not ok :rtype: int """ non_ok_times = [x for x in [self.last_time_warning, self.last_time_critical, ...
python
def last_time_non_ok_or_up(self): """Get the last time the service was in a non-OK state :return: the nearest last time the service was not ok :rtype: int """ non_ok_times = [x for x in [self.last_time_warning, self.last_time_critical, ...
Get the last time the service was in a non-OK state :return: the nearest last time the service was not ok :rtype: int
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L645-L659
Alignak-monitoring/alignak
alignak/objects/service.py
Service.raise_check_result
def raise_check_result(self): """Raise ACTIVE CHECK RESULT entry Example : "ACTIVE SERVICE CHECK: server;DOWN;HARD;1;I don't know what to say..." :return: None """ if not self.__class__.log_active_checks: return log_level = 'info' if self.state in [u...
python
def raise_check_result(self): """Raise ACTIVE CHECK RESULT entry Example : "ACTIVE SERVICE CHECK: server;DOWN;HARD;1;I don't know what to say..." :return: None """ if not self.__class__.log_active_checks: return log_level = 'info' if self.state in [u...
Raise ACTIVE CHECK RESULT entry Example : "ACTIVE SERVICE CHECK: server;DOWN;HARD;1;I don't know what to say..." :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L661-L680
Alignak-monitoring/alignak
alignak/objects/service.py
Service.raise_notification_log_entry
def raise_notification_log_entry(self, notif, contact, host_ref): """Raise SERVICE NOTIFICATION entry (critical level) Format is : "SERVICE NOTIFICATION: *contact.get_name()*;*host_name*;*self.get_name()* ;*state*;*command.get_name()*;*output*" Example : "SERVICE NOTIFICATION...
python
def raise_notification_log_entry(self, notif, contact, host_ref): """Raise SERVICE NOTIFICATION entry (critical level) Format is : "SERVICE NOTIFICATION: *contact.get_name()*;*host_name*;*self.get_name()* ;*state*;*command.get_name()*;*output*" Example : "SERVICE NOTIFICATION...
Raise SERVICE NOTIFICATION entry (critical level) Format is : "SERVICE NOTIFICATION: *contact.get_name()*;*host_name*;*self.get_name()* ;*state*;*command.get_name()*;*output*" Example : "SERVICE NOTIFICATION: superadmin;server;Load;UP;notify-by-rss;no output" :param notif: n...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L738-L778
Alignak-monitoring/alignak
alignak/objects/service.py
Service.raise_event_handler_log_entry
def raise_event_handler_log_entry(self, command): """Raise SERVICE EVENT HANDLER entry (critical level) Format is : "SERVICE EVENT HANDLER: *host_name*;*self.get_name()*;*state*;*state_type* ;*attempt*;*command.get_name()*" Example : "SERVICE EVENT HANDLER: server;Load;UP;HAR...
python
def raise_event_handler_log_entry(self, command): """Raise SERVICE EVENT HANDLER entry (critical level) Format is : "SERVICE EVENT HANDLER: *host_name*;*self.get_name()*;*state*;*state_type* ;*attempt*;*command.get_name()*" Example : "SERVICE EVENT HANDLER: server;Load;UP;HAR...
Raise SERVICE EVENT HANDLER entry (critical level) Format is : "SERVICE EVENT HANDLER: *host_name*;*self.get_name()*;*state*;*state_type* ;*attempt*;*command.get_name()*" Example : "SERVICE EVENT HANDLER: server;Load;UP;HARD;1;notify-by-rss" :param command: Handler launched ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L780-L805
Alignak-monitoring/alignak
alignak/objects/service.py
Service.get_data_for_notifications
def get_data_for_notifications(self, contact, notif, host_ref): """Get data for a notification :param contact: The contact to return :type contact: :param notif: the notification to return :type notif: :return: list containing the service, the host and the given paramete...
python
def get_data_for_notifications(self, contact, notif, host_ref): """Get data for a notification :param contact: The contact to return :type contact: :param notif: the notification to return :type notif: :return: list containing the service, the host and the given paramete...
Get data for a notification :param contact: The contact to return :type contact: :param notif: the notification to return :type notif: :return: list containing the service, the host and the given parameters :rtype: list
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1028-L1040
Alignak-monitoring/alignak
alignak/objects/service.py
Service.is_blocking_notifications
def is_blocking_notifications(self, notification_period, hosts, services, n_type, t_wished): # pylint: disable=too-many-return-statements """Check if a notification is blocked by the service. Conditions are ONE of the following:: * enable_notification is False (global) * not in ...
python
def is_blocking_notifications(self, notification_period, hosts, services, n_type, t_wished): # pylint: disable=too-many-return-statements """Check if a notification is blocked by the service. Conditions are ONE of the following:: * enable_notification is False (global) * not in ...
Check if a notification is blocked by the service. Conditions are ONE of the following:: * enable_notification is False (global) * not in a notification_period * notifications_enable is False (local) * notification_options is 'n' or matches the state ('UNKNOWN' <=> 'u' ...) ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1125-L1255
Alignak-monitoring/alignak
alignak/objects/service.py
Service.get_short_status
def get_short_status(self, hosts, services): """Get the short status of this host :return: "O", "W", "C", "U', or "n/a" based on service state_id or business_rule state :rtype: str """ mapping = { 0: "O", 1: "W", 2: "C", 3: "U", ...
python
def get_short_status(self, hosts, services): """Get the short status of this host :return: "O", "W", "C", "U', or "n/a" based on service state_id or business_rule state :rtype: str """ mapping = { 0: "O", 1: "W", 2: "C", 3: "U", ...
Get the short status of this host :return: "O", "W", "C", "U', or "n/a" based on service state_id or business_rule state :rtype: str
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1257-L1273
Alignak-monitoring/alignak
alignak/objects/service.py
Service.get_status
def get_status(self, hosts, services): """Get the status of this host :return: "OK", "WARNING", "CRITICAL", "UNKNOWN" or "n/a" based on service state_id or business_rule state :rtype: str """ if self.got_business_rule: mapping = { 0:...
python
def get_status(self, hosts, services): """Get the status of this host :return: "OK", "WARNING", "CRITICAL", "UNKNOWN" or "n/a" based on service state_id or business_rule state :rtype: str """ if self.got_business_rule: mapping = { 0:...
Get the status of this host :return: "OK", "WARNING", "CRITICAL", "UNKNOWN" or "n/a" based on service state_id or business_rule state :rtype: str
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1275-L1293
Alignak-monitoring/alignak
alignak/objects/service.py
Services.add_template
def add_template(self, tpl): """ Adds and index a template into the `templates` container. This implementation takes into account that a service has two naming attribute: `host_name` and `service_description`. :param tpl: The template to add :type tpl: :return: ...
python
def add_template(self, tpl): """ Adds and index a template into the `templates` container. This implementation takes into account that a service has two naming attribute: `host_name` and `service_description`. :param tpl: The template to add :type tpl: :return: ...
Adds and index a template into the `templates` container. This implementation takes into account that a service has two naming attribute: `host_name` and `service_description`. :param tpl: The template to add :type tpl: :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1312-L1344
Alignak-monitoring/alignak
alignak/objects/service.py
Services.apply_inheritance
def apply_inheritance(self): """ For all items and templates inherit properties and custom variables. :return: None """ super(Services, self).apply_inheritance() # add_item only ensure we can build a key for services later (after explode) for item in list(se...
python
def apply_inheritance(self): """ For all items and templates inherit properties and custom variables. :return: None """ super(Services, self).apply_inheritance() # add_item only ensure we can build a key for services later (after explode) for item in list(se...
For all items and templates inherit properties and custom variables. :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1346-L1356
Alignak-monitoring/alignak
alignak/objects/service.py
Services.find_srvs_by_hostname
def find_srvs_by_hostname(self, host_name): """Get all services from a host based on a host_name :param host_name: the host name we want services :type host_name: str :return: list of services :rtype: list[alignak.objects.service.Service] """ if hasattr(self, 'ho...
python
def find_srvs_by_hostname(self, host_name): """Get all services from a host based on a host_name :param host_name: the host name we want services :type host_name: str :return: list of services :rtype: list[alignak.objects.service.Service] """ if hasattr(self, 'ho...
Get all services from a host based on a host_name :param host_name: the host name we want services :type host_name: str :return: list of services :rtype: list[alignak.objects.service.Service]
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1358-L1371
Alignak-monitoring/alignak
alignak/objects/service.py
Services.find_srv_by_name_and_hostname
def find_srv_by_name_and_hostname(self, host_name, sdescr): """Get a specific service based on a host_name and service_description :param host_name: host name linked to needed service :type host_name: str :param sdescr: service name we need :type sdescr: str :return: th...
python
def find_srv_by_name_and_hostname(self, host_name, sdescr): """Get a specific service based on a host_name and service_description :param host_name: host name linked to needed service :type host_name: str :param sdescr: service name we need :type sdescr: str :return: th...
Get a specific service based on a host_name and service_description :param host_name: host name linked to needed service :type host_name: str :param sdescr: service name we need :type sdescr: str :return: the service found or None :rtype: alignak.objects.service.Service
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1373-L1384
Alignak-monitoring/alignak
alignak/objects/service.py
Services.linkify
def linkify(self, hosts, commands, timeperiods, contacts, # pylint: disable=R0913 resultmodulations, businessimpactmodulations, escalations, servicegroups, checkmodulations, macromodulations): """Create link between objects:: * service -> host * service -> com...
python
def linkify(self, hosts, commands, timeperiods, contacts, # pylint: disable=R0913 resultmodulations, businessimpactmodulations, escalations, servicegroups, checkmodulations, macromodulations): """Create link between objects:: * service -> host * service -> com...
Create link between objects:: * service -> host * service -> command * service -> timeperiods * service -> contacts :param hosts: hosts to link :type hosts: alignak.objects.host.Hosts :param timeperiods: timeperiods to link :type timeperiods: alignak...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1386-L1436
Alignak-monitoring/alignak
alignak/objects/service.py
Services.override_properties
def override_properties(self, hosts): """Handle service_overrides property for hosts ie : override properties for relevant services :param hosts: hosts we need to apply override properties :type hosts: alignak.objects.host.Hosts :return: None """ ovr_re = re.comp...
python
def override_properties(self, hosts): """Handle service_overrides property for hosts ie : override properties for relevant services :param hosts: hosts we need to apply override properties :type hosts: alignak.objects.host.Hosts :return: None """ ovr_re = re.comp...
Handle service_overrides property for hosts ie : override properties for relevant services :param hosts: hosts we need to apply override properties :type hosts: alignak.objects.host.Hosts :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1438-L1476
Alignak-monitoring/alignak
alignak/objects/service.py
Services.linkify_s_by_hst
def linkify_s_by_hst(self, hosts): """Link services with their parent host :param hosts: Hosts to look for simple host :type hosts: alignak.objects.host.Hosts :return: None """ for serv in self: # If we do not have a host_name, we set it as # a te...
python
def linkify_s_by_hst(self, hosts): """Link services with their parent host :param hosts: Hosts to look for simple host :type hosts: alignak.objects.host.Hosts :return: None """ for serv in self: # If we do not have a host_name, we set it as # a te...
Link services with their parent host :param hosts: Hosts to look for simple host :type hosts: alignak.objects.host.Hosts :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1487-L1514
Alignak-monitoring/alignak
alignak/objects/service.py
Services.linkify_s_by_sg
def linkify_s_by_sg(self, servicegroups): """Link services with servicegroups :param servicegroups: Servicegroups :type servicegroups: alignak.objects.servicegroup.Servicegroups :return: None """ for serv in self: new_servicegroups = [] if hasattr...
python
def linkify_s_by_sg(self, servicegroups): """Link services with servicegroups :param servicegroups: Servicegroups :type servicegroups: alignak.objects.servicegroup.Servicegroups :return: None """ for serv in self: new_servicegroups = [] if hasattr...
Link services with servicegroups :param servicegroups: Servicegroups :type servicegroups: alignak.objects.servicegroup.Servicegroups :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1516-L1535
Alignak-monitoring/alignak
alignak/objects/service.py
Services.apply_implicit_inheritance
def apply_implicit_inheritance(self, hosts): """Apply implicit inheritance for special properties: contact_groups, notification_interval , notification_period So service will take info from host if necessary :param hosts: hosts list needed to look for a simple host :type hosts: ...
python
def apply_implicit_inheritance(self, hosts): """Apply implicit inheritance for special properties: contact_groups, notification_interval , notification_period So service will take info from host if necessary :param hosts: hosts list needed to look for a simple host :type hosts: ...
Apply implicit inheritance for special properties: contact_groups, notification_interval , notification_period So service will take info from host if necessary :param hosts: hosts list needed to look for a simple host :type hosts: alignak.objects.host.Hosts :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1547-L1566
Alignak-monitoring/alignak
alignak/objects/service.py
Services.apply_dependencies
def apply_dependencies(self, hosts): """Wrapper to loop over services and call Service.fill_daddy_dependency() :return: None """ for service in self: if service.host and service.host_dependency_enabled: host = hosts[service.host] if host.activ...
python
def apply_dependencies(self, hosts): """Wrapper to loop over services and call Service.fill_daddy_dependency() :return: None """ for service in self: if service.host and service.host_dependency_enabled: host = hosts[service.host] if host.activ...
Wrapper to loop over services and call Service.fill_daddy_dependency() :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1568-L1584
Alignak-monitoring/alignak
alignak/objects/service.py
Services.clean
def clean(self): """Remove services without host object linked to Note that this should not happen! :return: None """ to_del = [] for serv in self: if not serv.host: to_del.append(serv.uuid) for service_uuid in to_del: del...
python
def clean(self): """Remove services without host object linked to Note that this should not happen! :return: None """ to_del = [] for serv in self: if not serv.host: to_del.append(serv.uuid) for service_uuid in to_del: del...
Remove services without host object linked to Note that this should not happen! :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1586-L1598
Alignak-monitoring/alignak
alignak/objects/service.py
Services.explode_services_from_hosts
def explode_services_from_hosts(self, hosts, service, hnames): """ Explodes a service based on a list of hosts. :param hosts: The hosts container :type hosts: :param service: The base service to explode :type service: :param hnames: The host_name list to explode...
python
def explode_services_from_hosts(self, hosts, service, hnames): """ Explodes a service based on a list of hosts. :param hosts: The hosts container :type hosts: :param service: The base service to explode :type service: :param hnames: The host_name list to explode...
Explodes a service based on a list of hosts. :param hosts: The hosts container :type hosts: :param service: The base service to explode :type service: :param hnames: The host_name list to explode service on :type hnames: str :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1600-L1646
Alignak-monitoring/alignak
alignak/objects/service.py
Services._local_create_service
def _local_create_service(self, hosts, host_name, service): """Create a new service based on a host_name and service instance. :param hosts: The hosts items instance. :type hosts: alignak.objects.host.Hosts :param host_name: The host_name to create a new service. :type host_name...
python
def _local_create_service(self, hosts, host_name, service): """Create a new service based on a host_name and service instance. :param hosts: The hosts items instance. :type hosts: alignak.objects.host.Hosts :param host_name: The host_name to create a new service. :type host_name...
Create a new service based on a host_name and service instance. :param hosts: The hosts items instance. :type hosts: alignak.objects.host.Hosts :param host_name: The host_name to create a new service. :type host_name: str :param service: The service to be used as template. ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1649-L1670
Alignak-monitoring/alignak
alignak/objects/service.py
Services.explode_services_from_templates
def explode_services_from_templates(self, hosts, service_template): """ Explodes services from templates. All hosts holding the specified templates are bound with the service. :param hosts: The hosts container. :type hosts: alignak.objects.host.Hosts :param service_templ...
python
def explode_services_from_templates(self, hosts, service_template): """ Explodes services from templates. All hosts holding the specified templates are bound with the service. :param hosts: The hosts container. :type hosts: alignak.objects.host.Hosts :param service_templ...
Explodes services from templates. All hosts holding the specified templates are bound with the service. :param hosts: The hosts container. :type hosts: alignak.objects.host.Hosts :param service_template: The service to explode. :type service_template: alignak.objects.service.Ser...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1672-L1701
Alignak-monitoring/alignak
alignak/objects/service.py
Services.explode_services_duplicates
def explode_services_duplicates(self, hosts, service): """ Explodes services holding a `duplicate_foreach` clause. :param hosts: The hosts container :type hosts: alignak.objects.host.Hosts :param service: The service to explode :type service: alignak.objects.service.Serv...
python
def explode_services_duplicates(self, hosts, service): """ Explodes services holding a `duplicate_foreach` clause. :param hosts: The hosts container :type hosts: alignak.objects.host.Hosts :param service: The service to explode :type service: alignak.objects.service.Serv...
Explodes services holding a `duplicate_foreach` clause. :param hosts: The hosts container :type hosts: alignak.objects.host.Hosts :param service: The service to explode :type service: alignak.objects.service.Service
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1703-L1729
Alignak-monitoring/alignak
alignak/objects/service.py
Services.register_service_into_servicegroups
def register_service_into_servicegroups(service, servicegroups): """ Registers a service into the service groups declared in its `servicegroups` attribute. :param service: The service to register :type service: :param servicegroups: The servicegroups container :t...
python
def register_service_into_servicegroups(service, servicegroups): """ Registers a service into the service groups declared in its `servicegroups` attribute. :param service: The service to register :type service: :param servicegroups: The servicegroups container :t...
Registers a service into the service groups declared in its `servicegroups` attribute. :param service: The service to register :type service: :param servicegroups: The servicegroups container :type servicegroups: :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1732-L1753
Alignak-monitoring/alignak
alignak/objects/service.py
Services.register_service_dependencies
def register_service_dependencies(service, servicedependencies): """ Registers a service dependencies. :param service: The service to register :type service: :param servicedependencies: The servicedependencies container :type servicedependencies: :return: None ...
python
def register_service_dependencies(service, servicedependencies): """ Registers a service dependencies. :param service: The service to register :type service: :param servicedependencies: The servicedependencies container :type servicedependencies: :return: None ...
Registers a service dependencies. :param service: The service to register :type service: :param servicedependencies: The servicedependencies container :type servicedependencies: :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1756-L1785
Alignak-monitoring/alignak
alignak/objects/service.py
Services.explode
def explode(self, hosts, hostgroups, contactgroups, servicegroups, servicedependencies): # pylint: disable=too-many-locals """ Explodes services, from host, hostgroups, contactgroups, servicegroups and dependencies. :param hosts: The hosts container :type hosts: [alignak.object....
python
def explode(self, hosts, hostgroups, contactgroups, servicegroups, servicedependencies): # pylint: disable=too-many-locals """ Explodes services, from host, hostgroups, contactgroups, servicegroups and dependencies. :param hosts: The hosts container :type hosts: [alignak.object....
Explodes services, from host, hostgroups, contactgroups, servicegroups and dependencies. :param hosts: The hosts container :type hosts: [alignak.object.host.Host] :param hostgroups: The hosts goups container :type hostgroups: [alignak.object.hostgroup.Hostgroup] :param contactgr...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/service.py#L1788-L1856
Alignak-monitoring/alignak
alignak/objects/escalation.py
Escalation.is_eligible
def is_eligible(self, timestamp, status, notif_number, in_notif_time, interval, escal_period): # pylint: disable=too-many-return-statements """Check if the escalation is eligible (notification is escalated or not) Escalation is NOT eligible in ONE of the following condition is fulfilled:: ...
python
def is_eligible(self, timestamp, status, notif_number, in_notif_time, interval, escal_period): # pylint: disable=too-many-return-statements """Check if the escalation is eligible (notification is escalated or not) Escalation is NOT eligible in ONE of the following condition is fulfilled:: ...
Check if the escalation is eligible (notification is escalated or not) Escalation is NOT eligible in ONE of the following condition is fulfilled:: * escalation is not time based and notification number not in range [first_notification;last_notification] (if last_notif == 0, it's infinity) ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/escalation.py#L127-L187
Alignak-monitoring/alignak
alignak/objects/escalation.py
Escalation.get_next_notif_time
def get_next_notif_time(self, t_wished, status, creation_time, interval, escal_period): """Get the next notification time for the escalation Only legit for time based escalation :param t_wished: time we would like to send a new notification (usually now) :type t_wished: :param s...
python
def get_next_notif_time(self, t_wished, status, creation_time, interval, escal_period): """Get the next notification time for the escalation Only legit for time based escalation :param t_wished: time we would like to send a new notification (usually now) :type t_wished: :param s...
Get the next notification time for the escalation Only legit for time based escalation :param t_wished: time we would like to send a new notification (usually now) :type t_wished: :param status: status of the host or service :type status: :param creation_time: time the n...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/escalation.py#L189-L228
Alignak-monitoring/alignak
alignak/objects/escalation.py
Escalation.is_correct
def is_correct(self): """Check if this object configuration is correct :: * Check our own specific properties * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False :rtype: bool """ state = True # Inter...
python
def is_correct(self): """Check if this object configuration is correct :: * Check our own specific properties * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False :rtype: bool """ state = True # Inter...
Check if this object configuration is correct :: * Check our own specific properties * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False :rtype: bool
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/escalation.py#L230-L278
Alignak-monitoring/alignak
alignak/objects/escalation.py
Escalations.linkify
def linkify(self, timeperiods, contacts, services, hosts): """Create link between objects:: * escalation -> host * escalation -> service * escalation -> timeperiods * escalation -> contact :param timeperiods: timeperiods to link :type timeperiods: alignak.ob...
python
def linkify(self, timeperiods, contacts, services, hosts): """Create link between objects:: * escalation -> host * escalation -> service * escalation -> timeperiods * escalation -> contact :param timeperiods: timeperiods to link :type timeperiods: alignak.ob...
Create link between objects:: * escalation -> host * escalation -> service * escalation -> timeperiods * escalation -> contact :param timeperiods: timeperiods to link :type timeperiods: alignak.objects.timeperiod.Timeperiods :param contacts: contacts to link...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/escalation.py#L288-L309
Alignak-monitoring/alignak
alignak/objects/escalation.py
Escalations.linkify_es_by_s
def linkify_es_by_s(self, services): """Add each escalation object into service.escalation attribute :param services: service list, used to look for a specific service :type services: alignak.objects.service.Services :return: None """ for escalation in self: ...
python
def linkify_es_by_s(self, services): """Add each escalation object into service.escalation attribute :param services: service list, used to look for a specific service :type services: alignak.objects.service.Services :return: None """ for escalation in self: ...
Add each escalation object into service.escalation attribute :param services: service list, used to look for a specific service :type services: alignak.objects.service.Services :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/escalation.py#L320-L347
Alignak-monitoring/alignak
alignak/objects/escalation.py
Escalations.linkify_es_by_h
def linkify_es_by_h(self, hosts): """Add each escalation object into host.escalation attribute :param hosts: host list, used to look for a specific host :type hosts: alignak.objects.host.Hosts :return: None """ for escal in self: # If no host, no hope of havi...
python
def linkify_es_by_h(self, hosts): """Add each escalation object into host.escalation attribute :param hosts: host list, used to look for a specific host :type hosts: alignak.objects.host.Hosts :return: None """ for escal in self: # If no host, no hope of havi...
Add each escalation object into host.escalation attribute :param hosts: host list, used to look for a specific host :type hosts: alignak.objects.host.Hosts :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/escalation.py#L349-L366
Alignak-monitoring/alignak
alignak/objects/escalation.py
Escalations.explode
def explode(self, hosts, hostgroups, contactgroups): """Loop over all escalation and explode hostsgroups in host and contactgroups in contacts Call Item.explode_host_groups_into_hosts and Item.explode_contact_groups_into_contacts :param hosts: host list to explode :type hosts: ...
python
def explode(self, hosts, hostgroups, contactgroups): """Loop over all escalation and explode hostsgroups in host and contactgroups in contacts Call Item.explode_host_groups_into_hosts and Item.explode_contact_groups_into_contacts :param hosts: host list to explode :type hosts: ...
Loop over all escalation and explode hostsgroups in host and contactgroups in contacts Call Item.explode_host_groups_into_hosts and Item.explode_contact_groups_into_contacts :param hosts: host list to explode :type hosts: alignak.objects.host.Hosts :param hostgroups: hostgroup ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/escalation.py#L368-L389
Alignak-monitoring/alignak
alignak/objects/hostgroup.py
Hostgroup.get_hosts_by_explosion
def get_hosts_by_explosion(self, hostgroups): # pylint: disable=access-member-before-definition """ Get hosts of this group :param hostgroups: Hostgroup object :type hostgroups: alignak.objects.hostgroup.Hostgroups :return: list of hosts of this group :rtype: lis...
python
def get_hosts_by_explosion(self, hostgroups): # pylint: disable=access-member-before-definition """ Get hosts of this group :param hostgroups: Hostgroup object :type hostgroups: alignak.objects.hostgroup.Hostgroups :return: list of hosts of this group :rtype: lis...
Get hosts of this group :param hostgroups: Hostgroup object :type hostgroups: alignak.objects.hostgroup.Hostgroups :return: list of hosts of this group :rtype: list
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostgroup.py#L134-L167
Alignak-monitoring/alignak
alignak/objects/hostgroup.py
Hostgroups.add_member
def add_member(self, host_name, hostgroup_name): """Add a host string to a hostgroup member if the host group do not exist, create it :param host_name: host name :type host_name: str :param hostgroup_name:hostgroup name :type hostgroup_name: str :return: None ...
python
def add_member(self, host_name, hostgroup_name): """Add a host string to a hostgroup member if the host group do not exist, create it :param host_name: host name :type host_name: str :param hostgroup_name:hostgroup name :type hostgroup_name: str :return: None ...
Add a host string to a hostgroup member if the host group do not exist, create it :param host_name: host name :type host_name: str :param hostgroup_name:hostgroup name :type hostgroup_name: str :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostgroup.py#L178-L195
Alignak-monitoring/alignak
alignak/objects/hostgroup.py
Hostgroups.get_members_of_group
def get_members_of_group(self, gname): """Get all members of a group which name is given in parameter :param gname: name of the group :type gname: str :return: list of the hosts in the group :rtype: list[alignak.objects.host.Host] """ hostgroup = self.find_by_nam...
python
def get_members_of_group(self, gname): """Get all members of a group which name is given in parameter :param gname: name of the group :type gname: str :return: list of the hosts in the group :rtype: list[alignak.objects.host.Host] """ hostgroup = self.find_by_nam...
Get all members of a group which name is given in parameter :param gname: name of the group :type gname: str :return: list of the hosts in the group :rtype: list[alignak.objects.host.Host]
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostgroup.py#L197-L208
Alignak-monitoring/alignak
alignak/objects/hostgroup.py
Hostgroups.linkify
def linkify(self, hosts=None, realms=None, forced_realms_hostgroups=True): """Link hostgroups with hosts and realms :param hosts: all Hosts :type hosts: alignak.objects.host.Hosts :param realms: all Realms :type realms: alignak.objects.realm.Realms :return: None ...
python
def linkify(self, hosts=None, realms=None, forced_realms_hostgroups=True): """Link hostgroups with hosts and realms :param hosts: all Hosts :type hosts: alignak.objects.host.Hosts :param realms: all Realms :type realms: alignak.objects.realm.Realms :return: None ...
Link hostgroups with hosts and realms :param hosts: all Hosts :type hosts: alignak.objects.host.Hosts :param realms: all Realms :type realms: alignak.objects.realm.Realms :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostgroup.py#L210-L220
Alignak-monitoring/alignak
alignak/objects/hostgroup.py
Hostgroups.linkify_hostgroups_hosts
def linkify_hostgroups_hosts(self, hosts): """We just search for each hostgroup the id of the hosts and replace the names by the found identifiers :param hosts: object Hosts :type hosts: alignak.objects.host.Hosts :return: None """ for hostgroup in self: ...
python
def linkify_hostgroups_hosts(self, hosts): """We just search for each hostgroup the id of the hosts and replace the names by the found identifiers :param hosts: object Hosts :type hosts: alignak.objects.host.Hosts :return: None """ for hostgroup in self: ...
We just search for each hostgroup the id of the hosts and replace the names by the found identifiers :param hosts: object Hosts :type hosts: alignak.objects.host.Hosts :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostgroup.py#L222-L256
Alignak-monitoring/alignak
alignak/objects/hostgroup.py
Hostgroups.linkify_hostgroups_realms_hosts
def linkify_hostgroups_realms_hosts(self, realms, hosts, forced_realms_hostgroups=True): # pylint: disable=too-many-locals, too-many-nested-blocks, too-many-branches """Link between an hostgroup and a realm is already done in the configuration parsing function that defines and checks the default...
python
def linkify_hostgroups_realms_hosts(self, realms, hosts, forced_realms_hostgroups=True): # pylint: disable=too-many-locals, too-many-nested-blocks, too-many-branches """Link between an hostgroup and a realm is already done in the configuration parsing function that defines and checks the default...
Link between an hostgroup and a realm is already done in the configuration parsing function that defines and checks the default satellites, realms, hosts and hosts groups consistency. This function will only raise some alerts if hosts groups and hosts that are contained do not belong th...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostgroup.py#L258-L378
Alignak-monitoring/alignak
alignak/objects/hostgroup.py
Hostgroups.explode
def explode(self): """ Fill members with hostgroup_members :return: None """ # We do not want a same hostgroup to be exploded again and again # so we tag it for tmp_hg in list(self.items.values()): tmp_hg.already_exploded = False for hostgrou...
python
def explode(self): """ Fill members with hostgroup_members :return: None """ # We do not want a same hostgroup to be exploded again and again # so we tag it for tmp_hg in list(self.items.values()): tmp_hg.already_exploded = False for hostgrou...
Fill members with hostgroup_members :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/hostgroup.py#L380-L405
Alignak-monitoring/alignak
alignak/http/daemon.py
HTTPDaemon.run
def run(self): """Wrapper to start the CherryPy server This function throws a PortNotFree exception if any socket error is raised. :return: None """ def _started_callback(): """Callback function when Cherrypy Engine is started""" cherrypy.log("CherryPy e...
python
def run(self): """Wrapper to start the CherryPy server This function throws a PortNotFree exception if any socket error is raised. :return: None """ def _started_callback(): """Callback function when Cherrypy Engine is started""" cherrypy.log("CherryPy e...
Wrapper to start the CherryPy server This function throws a PortNotFree exception if any socket error is raised. :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/daemon.py#L163-L182
Alignak-monitoring/alignak
alignak/http/daemon.py
HTTPDaemon.stop
def stop(self): # pylint: disable=no-self-use """Wrapper to stop the CherryPy server :return: None """ cherrypy.log("Stopping CherryPy engine (current state: %s)..." % cherrypy.engine.state) try: cherrypy.engine.exit() except RuntimeWarning: pass...
python
def stop(self): # pylint: disable=no-self-use """Wrapper to stop the CherryPy server :return: None """ cherrypy.log("Stopping CherryPy engine (current state: %s)..." % cherrypy.engine.state) try: cherrypy.engine.exit() except RuntimeWarning: pass...
Wrapper to stop the CherryPy server :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/daemon.py#L184-L196
Alignak-monitoring/alignak
alignak/basemodule.py
BaseModule.create_queues
def create_queues(self, manager=None): """ Create the shared queues that will be used by alignak daemon process and this module process. But clear queues if they were already set before recreating new one. Note: If manager is None, then we are running the unit tests for ...
python
def create_queues(self, manager=None): """ Create the shared queues that will be used by alignak daemon process and this module process. But clear queues if they were already set before recreating new one. Note: If manager is None, then we are running the unit tests for ...
Create the shared queues that will be used by alignak daemon process and this module process. But clear queues if they were already set before recreating new one. Note: If manager is None, then we are running the unit tests for the modules and we must create some queues for the ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/basemodule.py#L189-L210
Alignak-monitoring/alignak
alignak/basemodule.py
BaseModule.clear_queues
def clear_queues(self, manager): """Release the resources associated to the queues of this instance :param manager: Manager() object :type manager: None | object :return: None """ for queue in (self.to_q, self.from_q): if queue is None: contin...
python
def clear_queues(self, manager): """Release the resources associated to the queues of this instance :param manager: Manager() object :type manager: None | object :return: None """ for queue in (self.to_q, self.from_q): if queue is None: contin...
Release the resources associated to the queues of this instance :param manager: Manager() object :type manager: None | object :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/basemodule.py#L212-L232
Alignak-monitoring/alignak
alignak/basemodule.py
BaseModule.start_module
def start_module(self): """Wrapper for _main function. Catch and raise any exception occurring in the main function :return: None """ try: self._main() except Exception as exp: logger.exception('%s', traceback.format_exc()) raise Excep...
python
def start_module(self): """Wrapper for _main function. Catch and raise any exception occurring in the main function :return: None """ try: self._main() except Exception as exp: logger.exception('%s', traceback.format_exc()) raise Excep...
Wrapper for _main function. Catch and raise any exception occurring in the main function :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/basemodule.py#L234-L244
Alignak-monitoring/alignak
alignak/basemodule.py
BaseModule.start
def start(self, http_daemon=None): # pylint: disable=unused-argument """Actually restart the process if the module is external Try first to stop the process and create a new Process instance with target start_module. Finally start process. :param http_daemon: Not used here but ...
python
def start(self, http_daemon=None): # pylint: disable=unused-argument """Actually restart the process if the module is external Try first to stop the process and create a new Process instance with target start_module. Finally start process. :param http_daemon: Not used here but ...
Actually restart the process if the module is external Try first to stop the process and create a new Process instance with target start_module. Finally start process. :param http_daemon: Not used here but can be used in other modules :type http_daemon: None | object :re...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/basemodule.py#L246-L276
Alignak-monitoring/alignak
alignak/basemodule.py
BaseModule.kill
def kill(self): """Sometime terminate() is not enough, we must "help" external modules to die... :return: None """ logger.info("Killing external module (pid=%d) for module %s...", self.process.pid, self.name) if os.name == 'nt': self.proc...
python
def kill(self): """Sometime terminate() is not enough, we must "help" external modules to die... :return: None """ logger.info("Killing external module (pid=%d) for module %s...", self.process.pid, self.name) if os.name == 'nt': self.proc...
Sometime terminate() is not enough, we must "help" external modules to die... :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/basemodule.py#L278-L301
Alignak-monitoring/alignak
alignak/basemodule.py
BaseModule.stop_process
def stop_process(self): """Request the module process to stop and release it :return: None """ if not self.process: return logger.info("I'm stopping module %r (pid=%d)", self.name, self.process.pid) self.kill() # Clean inner process reference ...
python
def stop_process(self): """Request the module process to stop and release it :return: None """ if not self.process: return logger.info("I'm stopping module %r (pid=%d)", self.name, self.process.pid) self.kill() # Clean inner process reference ...
Request the module process to stop and release it :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/basemodule.py#L303-L314
Alignak-monitoring/alignak
alignak/basemodule.py
BaseModule.manage_brok
def manage_brok(self, brok): """Request the module to manage the given brok. There are a lot of different possible broks to manage. The list is defined in the Brok class. An internal module may redefine this function or, easier, define only the function for the brok it is intere...
python
def manage_brok(self, brok): """Request the module to manage the given brok. There are a lot of different possible broks to manage. The list is defined in the Brok class. An internal module may redefine this function or, easier, define only the function for the brok it is intere...
Request the module to manage the given brok. There are a lot of different possible broks to manage. The list is defined in the Brok class. An internal module may redefine this function or, easier, define only the function for the brok it is interested with. Hence a module interested in ...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/basemodule.py#L327-L348
Alignak-monitoring/alignak
alignak/basemodule.py
BaseModule.manage_signal
def manage_signal(self, sig, frame): # pylint: disable=unused-argument """Generic function to handle signals Only called when the module process received SIGINT or SIGKILL. Set interrupted attribute to True, self.process to None and returns :param sig: signal sent :type sig: ...
python
def manage_signal(self, sig, frame): # pylint: disable=unused-argument """Generic function to handle signals Only called when the module process received SIGINT or SIGKILL. Set interrupted attribute to True, self.process to None and returns :param sig: signal sent :type sig: ...
Generic function to handle signals Only called when the module process received SIGINT or SIGKILL. Set interrupted attribute to True, self.process to None and returns :param sig: signal sent :type sig: :param frame: frame before catching signal :type frame: :re...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/basemodule.py#L350-L371
Alignak-monitoring/alignak
alignak/basemodule.py
BaseModule.set_signal_handler
def set_signal_handler(self, sigs=None): """Set the signal handler to manage_signal (defined in this class) Only set handlers for: - signal.SIGTERM, signal.SIGINT - signal.SIGUSR1, signal.SIGUSR2 - signal.SIGHUP :return: None """ if sigs is None: ...
python
def set_signal_handler(self, sigs=None): """Set the signal handler to manage_signal (defined in this class) Only set handlers for: - signal.SIGTERM, signal.SIGINT - signal.SIGUSR1, signal.SIGUSR2 - signal.SIGHUP :return: None """ if sigs is None: ...
Set the signal handler to manage_signal (defined in this class) Only set handlers for: - signal.SIGTERM, signal.SIGINT - signal.SIGUSR1, signal.SIGUSR2 - signal.SIGHUP :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/basemodule.py#L374-L397
Alignak-monitoring/alignak
alignak/basemodule.py
BaseModule._main
def _main(self): """module "main" method. Only used by external modules. :return: None """ self.set_proctitle(self.name) self.set_signal_handler() logger.info("process for module %s is now running (pid=%d)", self.name, os.getpid()) # Will block here! tr...
python
def _main(self): """module "main" method. Only used by external modules. :return: None """ self.set_proctitle(self.name) self.set_signal_handler() logger.info("process for module %s is now running (pid=%d)", self.name, os.getpid()) # Will block here! tr...
module "main" method. Only used by external modules. :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/basemodule.py#L435-L457
Alignak-monitoring/alignak
alignak/action.py
no_block_read
def no_block_read(output): """Try to read a file descriptor in a non blocking mode If the fcntl is available (unix only) we try to read in a asynchronous mode, so we won't block the PIPE at 64K buffer (deadlock...) :param output: file or socket to read from :type output: file :return: data...
python
def no_block_read(output): """Try to read a file descriptor in a non blocking mode If the fcntl is available (unix only) we try to read in a asynchronous mode, so we won't block the PIPE at 64K buffer (deadlock...) :param output: file or socket to read from :type output: file :return: data...
Try to read a file descriptor in a non blocking mode If the fcntl is available (unix only) we try to read in a asynchronous mode, so we won't block the PIPE at 64K buffer (deadlock...) :param output: file or socket to read from :type output: file :return: data read from fd :rtype: str
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/action.py#L106-L130
Alignak-monitoring/alignak
alignak/action.py
ActionBase.get_local_environnement
def get_local_environnement(self): """ Mix the environment and the environment variables into a new local environment dictionary Note: We cannot just update the global os.environ because this would effect all other checks. :return: local environment variables :r...
python
def get_local_environnement(self): """ Mix the environment and the environment variables into a new local environment dictionary Note: We cannot just update the global os.environ because this would effect all other checks. :return: local environment variables :r...
Mix the environment and the environment variables into a new local environment dictionary Note: We cannot just update the global os.environ because this would effect all other checks. :return: local environment variables :rtype: dict
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/action.py#L245-L262
Alignak-monitoring/alignak
alignak/action.py
ActionBase.execute
def execute(self): """Start this action command in a subprocess. :raise: ActionError 'toomanyopenfiles' if too many opened files on the system 'no_process_launched' if arguments parsing failed 'process_launch_failed': if the process launch failed :return: re...
python
def execute(self): """Start this action command in a subprocess. :raise: ActionError 'toomanyopenfiles' if too many opened files on the system 'no_process_launched' if arguments parsing failed 'process_launch_failed': if the process launch failed :return: re...
Start this action command in a subprocess. :raise: ActionError 'toomanyopenfiles' if too many opened files on the system 'no_process_launched' if arguments parsing failed 'process_launch_failed': if the process launch failed :return: reference to the started process...
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/action.py#L264-L295
Alignak-monitoring/alignak
alignak/action.py
ActionBase.get_outputs
def get_outputs(self, out, max_plugins_output_length): """Get check outputs from single output (split perfdata etc). Updates output, perf_data and long_output attributes. :param out: output data of a check :type out: str :param max_output: max plugin data length :type m...
python
def get_outputs(self, out, max_plugins_output_length): """Get check outputs from single output (split perfdata etc). Updates output, perf_data and long_output attributes. :param out: output data of a check :type out: str :param max_output: max plugin data length :type m...
Get check outputs from single output (split perfdata etc). Updates output, perf_data and long_output attributes. :param out: output data of a check :type out: str :param max_output: max plugin data length :type max_output: int :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/action.py#L297-L365
Alignak-monitoring/alignak
alignak/action.py
ActionBase.check_finished
def check_finished(self, max_plugins_output_length): # pylint: disable=too-many-branches """Handle action if it is finished (get stdout, stderr, exit code...) :param max_plugins_output_length: max plugin data length :type max_plugins_output_length: int :return: None """ ...
python
def check_finished(self, max_plugins_output_length): # pylint: disable=too-many-branches """Handle action if it is finished (get stdout, stderr, exit code...) :param max_plugins_output_length: max plugin data length :type max_plugins_output_length: int :return: None """ ...
Handle action if it is finished (get stdout, stderr, exit code...) :param max_plugins_output_length: max plugin data length :type max_plugins_output_length: int :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/action.py#L367-L505
Alignak-monitoring/alignak
alignak/action.py
ActionBase.copy_shell__
def copy_shell__(self, new_i): """Create all attributes listed in 'ONLY_COPY_PROP' and return `self` with these attributes. :param new_i: object to :type new_i: object :return: object with new properties added :rtype: object """ for prop in ONLY_COPY_PROP: ...
python
def copy_shell__(self, new_i): """Create all attributes listed in 'ONLY_COPY_PROP' and return `self` with these attributes. :param new_i: object to :type new_i: object :return: object with new properties added :rtype: object """ for prop in ONLY_COPY_PROP: ...
Create all attributes listed in 'ONLY_COPY_PROP' and return `self` with these attributes. :param new_i: object to :type new_i: object :return: object with new properties added :rtype: object
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/action.py#L507-L517
Alignak-monitoring/alignak
alignak/objects/contactgroup.py
Contactgroup.get_contacts_by_explosion
def get_contacts_by_explosion(self, contactgroups): # pylint: disable=access-member-before-definition """ Get contacts of this group :param contactgroups: Contactgroups object, use to look for a specific one :type contactgroups: alignak.objects.contactgroup.Contactgroups ...
python
def get_contacts_by_explosion(self, contactgroups): # pylint: disable=access-member-before-definition """ Get contacts of this group :param contactgroups: Contactgroups object, use to look for a specific one :type contactgroups: alignak.objects.contactgroup.Contactgroups ...
Get contacts of this group :param contactgroups: Contactgroups object, use to look for a specific one :type contactgroups: alignak.objects.contactgroup.Contactgroups :return: list of contact of this group :rtype: list[alignak.objects.contact.Contact]
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/contactgroup.py#L110-L148
Alignak-monitoring/alignak
alignak/objects/contactgroup.py
Contactgroups.add_member
def add_member(self, contact_name, contactgroup_name): """Add a contact string to a contact member if the contact group do not exist, create it :param contact_name: contact name :type contact_name: str :param contactgroup_name: contact group name :type contactgroup_name:...
python
def add_member(self, contact_name, contactgroup_name): """Add a contact string to a contact member if the contact group do not exist, create it :param contact_name: contact name :type contact_name: str :param contactgroup_name: contact group name :type contactgroup_name:...
Add a contact string to a contact member if the contact group do not exist, create it :param contact_name: contact name :type contact_name: str :param contactgroup_name: contact group name :type contactgroup_name: str :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/contactgroup.py#L159-L176
Alignak-monitoring/alignak
alignak/objects/contactgroup.py
Contactgroups.get_members_of_group
def get_members_of_group(self, gname): """Get all members of a group which name is given in parameter :param gname: name of the group :type gname: str :return: list of contacts in the group :rtype: list[alignak.objects.contact.Contact] """ contactgroup = self.fin...
python
def get_members_of_group(self, gname): """Get all members of a group which name is given in parameter :param gname: name of the group :type gname: str :return: list of contacts in the group :rtype: list[alignak.objects.contact.Contact] """ contactgroup = self.fin...
Get all members of a group which name is given in parameter :param gname: name of the group :type gname: str :return: list of contacts in the group :rtype: list[alignak.objects.contact.Contact]
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/contactgroup.py#L178-L189
Alignak-monitoring/alignak
alignak/objects/contactgroup.py
Contactgroups.linkify_contactgroups_contacts
def linkify_contactgroups_contacts(self, contacts): """Link the contacts with contactgroups :param contacts: realms object to link with :type contacts: alignak.objects.contact.Contacts :return: None """ for contactgroup in self: mbrs = contactgroup.get_contac...
python
def linkify_contactgroups_contacts(self, contacts): """Link the contacts with contactgroups :param contacts: realms object to link with :type contacts: alignak.objects.contact.Contacts :return: None """ for contactgroup in self: mbrs = contactgroup.get_contac...
Link the contacts with contactgroups :param contacts: realms object to link with :type contacts: alignak.objects.contact.Contacts :return: None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/contactgroup.py#L212-L239
Alignak-monitoring/alignak
alignak/objects/contactgroup.py
Contactgroups.explode
def explode(self): """ Fill members with contactgroup_members :return:None """ # We do not want a same hg to be explode again and again # so we tag it for tmp_cg in list(self.items.values()): tmp_cg.already_exploded = False for contactgroup i...
python
def explode(self): """ Fill members with contactgroup_members :return:None """ # We do not want a same hg to be explode again and again # so we tag it for tmp_cg in list(self.items.values()): tmp_cg.already_exploded = False for contactgroup i...
Fill members with contactgroup_members :return:None
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/contactgroup.py#L241-L266