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/itemgroup.py | Itemgroup.add_unknown_members | def add_unknown_members(self, members):
"""Add a new member to the unknown members list
:param member: member name
:type member: str
:return: None
"""
if not isinstance(members, list):
members = [members]
if not hasattr(self, 'unknown_members'):
... | python | def add_unknown_members(self, members):
"""Add a new member to the unknown members list
:param member: member name
:type member: str
:return: None
"""
if not isinstance(members, list):
members = [members]
if not hasattr(self, 'unknown_members'):
... | Add a new member to the unknown members list
:param member: member name
:type member: str
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/itemgroup.py#L159-L172 |
Alignak-monitoring/alignak | alignak/objects/itemgroup.py | Itemgroup.is_correct | def is_correct(self):
"""
Check if a group is valid.
Valid mean all members exists, so list of unknown_members is empty
:return: True if group is correct, otherwise False
:rtype: bool
"""
state = True
# Make members unique, remove duplicates
if s... | python | def is_correct(self):
"""
Check if a group is valid.
Valid mean all members exists, so list of unknown_members is empty
:return: True if group is correct, otherwise False
:rtype: bool
"""
state = True
# Make members unique, remove duplicates
if s... | Check if a group is valid.
Valid mean all members exists, so list of unknown_members is empty
:return: True if group is correct, otherwise False
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/itemgroup.py#L174-L196 |
Alignak-monitoring/alignak | alignak/objects/itemgroup.py | Itemgroup.get_initial_status_brok | def get_initial_status_brok(self, extra=None):
"""
Get a brok with the group properties
`members` contains a list of uuid which we must provide the names. Thus we will replace
the default provided uuid with the members short name. The `extra` parameter, if present,
is containin... | python | def get_initial_status_brok(self, extra=None):
"""
Get a brok with the group properties
`members` contains a list of uuid which we must provide the names. Thus we will replace
the default provided uuid with the members short name. The `extra` parameter, if present,
is containin... | Get a brok with the group properties
`members` contains a list of uuid which we must provide the names. Thus we will replace
the default provided uuid with the members short name. The `extra` parameter, if present,
is containing the Items to search for...
:param extra: monitoring item... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/itemgroup.py#L198-L219 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.check_dir | def check_dir(self, dirname):
"""Check and create directory
:param dirname: file name
:type dirname; str
:return: None
"""
try:
os.makedirs(dirname)
dir_stat = os.stat(dirname)
print("Created the directory: %s, stat: %s" % (dirname, d... | python | def check_dir(self, dirname):
"""Check and create directory
:param dirname: file name
:type dirname; str
:return: None
"""
try:
os.makedirs(dirname)
dir_stat = os.stat(dirname)
print("Created the directory: %s, stat: %s" % (dirname, d... | Check and create directory
:param dirname: file name
:type dirname; str
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L789-L828 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.do_stop | def do_stop(self):
"""Execute the stop of this daemon:
- request the daemon to stop
- request the http thread to stop, else force stop the thread
- Close the http socket
- Shutdown the manager
- Stop and join all started "modules"
:return: None
"""
... | python | def do_stop(self):
"""Execute the stop of this daemon:
- request the daemon to stop
- request the http thread to stop, else force stop the thread
- Close the http socket
- Shutdown the manager
- Stop and join all started "modules"
:return: None
"""
... | Execute the stop of this daemon:
- request the daemon to stop
- request the http thread to stop, else force stop the thread
- Close the http socket
- Shutdown the manager
- Stop and join all started "modules"
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L830-L872 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.request_stop | def request_stop(self, message='', exit_code=0):
"""Remove pid and stop daemon
:return: None
"""
# Log an error message if exit code is not 0
# Force output to stderr
if exit_code:
if message:
logger.error(message)
try:
... | python | def request_stop(self, message='', exit_code=0):
"""Remove pid and stop daemon
:return: None
"""
# Log an error message if exit code is not 0
# Force output to stderr
if exit_code:
if message:
logger.error(message)
try:
... | Remove pid and stop daemon
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L874-L901 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.get_links_of_type | def get_links_of_type(self, s_type=''):
"""Return the `s_type` satellite list (eg. schedulers)
If s_type is None, returns a dictionary of all satellites, else returns the dictionary
of the s_type satellites
The returned dict is indexed with the satellites uuid.
:param s_type: ... | python | def get_links_of_type(self, s_type=''):
"""Return the `s_type` satellite list (eg. schedulers)
If s_type is None, returns a dictionary of all satellites, else returns the dictionary
of the s_type satellites
The returned dict is indexed with the satellites uuid.
:param s_type: ... | Return the `s_type` satellite list (eg. schedulers)
If s_type is None, returns a dictionary of all satellites, else returns the dictionary
of the s_type satellites
The returned dict is indexed with the satellites uuid.
:param s_type: satellite type
:type s_type: str
:r... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L903-L935 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.daemon_connection_init | def daemon_connection_init(self, s_link, set_wait_new_conf=False):
"""Initialize a connection with the daemon for the provided satellite link
Initialize the connection (HTTP client) to the daemon and get its running identifier.
Returns True if it succeeds else if any error occur or the daemon i... | python | def daemon_connection_init(self, s_link, set_wait_new_conf=False):
"""Initialize a connection with the daemon for the provided satellite link
Initialize the connection (HTTP client) to the daemon and get its running identifier.
Returns True if it succeeds else if any error occur or the daemon i... | Initialize a connection with the daemon for the provided satellite link
Initialize the connection (HTTP client) to the daemon and get its running identifier.
Returns True if it succeeds else if any error occur or the daemon is inactive
it returns False.
Assume the daemon should be reac... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L937-L987 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.do_main_loop | def do_main_loop(self):
# pylint: disable=too-many-branches, too-many-statements, too-many-locals
"""Main loop for an Alignak daemon
:return: None
"""
# Increased on each loop turn
if self.loop_count is None:
self.loop_count = 0
# Daemon start timest... | python | def do_main_loop(self):
# pylint: disable=too-many-branches, too-many-statements, too-many-locals
"""Main loop for an Alignak daemon
:return: None
"""
# Increased on each loop turn
if self.loop_count is None:
self.loop_count = 0
# Daemon start timest... | Main loop for an Alignak daemon
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1010-L1177 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.do_load_modules | def do_load_modules(self, modules):
"""Wrapper for calling load_and_init method of modules_manager attribute
:param modules: list of modules that should be loaded by the daemon
:return: None
"""
_ts = time.time()
logger.info("Loading modules...")
if self.modules... | python | def do_load_modules(self, modules):
"""Wrapper for calling load_and_init method of modules_manager attribute
:param modules: list of modules that should be loaded by the daemon
:return: None
"""
_ts = time.time()
logger.info("Loading modules...")
if self.modules... | Wrapper for calling load_and_init method of modules_manager attribute
:param modules: list of modules that should be loaded by the daemon
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1179-L1203 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.dump_environment | def dump_environment(self):
""" Try to dump memory
Not currently implemented feature
:return: None
"""
# Dump the Alignak configuration to a temporary ini file
path = os.path.join(tempfile.gettempdir(),
'dump-env-%s-%s-%d.ini' % (self.type, s... | python | def dump_environment(self):
""" Try to dump memory
Not currently implemented feature
:return: None
"""
# Dump the Alignak configuration to a temporary ini file
path = os.path.join(tempfile.gettempdir(),
'dump-env-%s-%s-%d.ini' % (self.type, s... | Try to dump memory
Not currently implemented feature
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1215-L1230 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.change_to_workdir | def change_to_workdir(self):
"""Change working directory to working attribute
:return: None
"""
logger.info("Changing working directory to: %s", self.workdir)
self.check_dir(self.workdir)
try:
os.chdir(self.workdir)
except OSError as exp:
... | python | def change_to_workdir(self):
"""Change working directory to working attribute
:return: None
"""
logger.info("Changing working directory to: %s", self.workdir)
self.check_dir(self.workdir)
try:
os.chdir(self.workdir)
except OSError as exp:
... | Change working directory to working attribute
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1243-L1259 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.unlink | def unlink(self):
"""Remove the daemon's pid file
:return: None
"""
logger.debug("Unlinking %s", self.pid_filename)
try:
os.unlink(self.pid_filename)
except OSError as exp:
logger.debug("Got an error unlinking our pid file: %s", exp) | python | def unlink(self):
"""Remove the daemon's pid file
:return: None
"""
logger.debug("Unlinking %s", self.pid_filename)
try:
os.unlink(self.pid_filename)
except OSError as exp:
logger.debug("Got an error unlinking our pid file: %s", exp) | Remove the daemon's pid file
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1261-L1270 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.check_shm | def check_shm():
""" Check /dev/shm right permissions
:return: None
"""
import stat
shm_path = '/dev/shm'
if os.name == 'posix' and os.path.exists(shm_path):
# We get the access rights, and we check them
mode = stat.S_IMODE(os.lstat(shm_path)[stat... | python | def check_shm():
""" Check /dev/shm right permissions
:return: None
"""
import stat
shm_path = '/dev/shm'
if os.name == 'posix' and os.path.exists(shm_path):
# We get the access rights, and we check them
mode = stat.S_IMODE(os.lstat(shm_path)[stat... | Check /dev/shm right permissions
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1273-L1288 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.__open_pidfile | def __open_pidfile(self, write=False):
"""Open pid file in read or write mod
:param write: boolean to open file in write mod (true = write)
:type write: bool
:return: None
"""
# if problem on opening or creating file it'll be raised to the caller:
try:
... | python | def __open_pidfile(self, write=False):
"""Open pid file in read or write mod
:param write: boolean to open file in write mod (true = write)
:type write: bool
:return: None
"""
# if problem on opening or creating file it'll be raised to the caller:
try:
... | Open pid file in read or write mod
:param write: boolean to open file in write mod (true = write)
:type write: bool
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1290-L1313 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.check_parallel_run | def check_parallel_run(self): # pragma: no cover, not with unit tests...
"""Check (in pid file) if there isn't already a daemon running.
If yes and do_replace: kill it.
Keep in self.fpid the File object to the pid file. Will be used by writepid.
:return: None
"""
# TODO... | python | def check_parallel_run(self): # pragma: no cover, not with unit tests...
"""Check (in pid file) if there isn't already a daemon running.
If yes and do_replace: kill it.
Keep in self.fpid the File object to the pid file. Will be used by writepid.
:return: None
"""
# TODO... | Check (in pid file) if there isn't already a daemon running.
If yes and do_replace: kill it.
Keep in self.fpid the File object to the pid file. Will be used by writepid.
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1315-L1376 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.write_pid | def write_pid(self, pid):
""" Write pid to the pid file
:param pid: pid of the process
:type pid: None | int
:return: None
"""
self.fpid.seek(0)
self.fpid.truncate()
self.fpid.write("%d" % pid)
self.fpid.close()
del self.fpid | python | def write_pid(self, pid):
""" Write pid to the pid file
:param pid: pid of the process
:type pid: None | int
:return: None
"""
self.fpid.seek(0)
self.fpid.truncate()
self.fpid.write("%d" % pid)
self.fpid.close()
del self.fpid | Write pid to the pid file
:param pid: pid of the process
:type pid: None | int
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1378-L1389 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.close_fds | def close_fds(self, skip_close_fds): # pragma: no cover, not with unit tests...
"""Close all the process file descriptors.
Skip the descriptors present in the skip_close_fds list
:param skip_close_fds: list of file descriptor to preserve from closing
:type skip_close_fds: list
... | python | def close_fds(self, skip_close_fds): # pragma: no cover, not with unit tests...
"""Close all the process file descriptors.
Skip the descriptors present in the skip_close_fds list
:param skip_close_fds: list of file descriptor to preserve from closing
:type skip_close_fds: list
... | Close all the process file descriptors.
Skip the descriptors present in the skip_close_fds list
:param skip_close_fds: list of file descriptor to preserve from closing
:type skip_close_fds: list
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1391-L1414 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.daemonize | def daemonize(self): # pragma: no cover, not for unit tests...
"""Go in "daemon" mode: close unused fds, redirect stdout/err,
chdir, umask, fork-setsid-fork-writepid
Do the double fork to properly go daemon
This is 'almost' as recommended by PEP3143 but it would be better to rewrite th... | python | def daemonize(self): # pragma: no cover, not for unit tests...
"""Go in "daemon" mode: close unused fds, redirect stdout/err,
chdir, umask, fork-setsid-fork-writepid
Do the double fork to properly go daemon
This is 'almost' as recommended by PEP3143 but it would be better to rewrite th... | Go in "daemon" mode: close unused fds, redirect stdout/err,
chdir, umask, fork-setsid-fork-writepid
Do the double fork to properly go daemon
This is 'almost' as recommended by PEP3143 but it would be better to rewrite this
daemonization thanks to the python-daemon library!
:ret... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1416-L1468 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.do_daemon_init_and_start | def do_daemon_init_and_start(self, set_proc_title=True):
"""Main daemon function.
Clean, allocates, initializes and starts all necessary resources to go in daemon mode.
The set_proc_title parameter is mainly useful for the Alignak unit tests.
This to avoid changing the test process name... | python | def do_daemon_init_and_start(self, set_proc_title=True):
"""Main daemon function.
Clean, allocates, initializes and starts all necessary resources to go in daemon mode.
The set_proc_title parameter is mainly useful for the Alignak unit tests.
This to avoid changing the test process name... | Main daemon function.
Clean, allocates, initializes and starts all necessary resources to go in daemon mode.
The set_proc_title parameter is mainly useful for the Alignak unit tests.
This to avoid changing the test process name!
:param set_proc_title: if set (default), the process titl... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1481-L1551 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.setup_communication_daemon | def setup_communication_daemon(self):
# pylint: disable=no-member
""" Setup HTTP server daemon to listen
for incoming HTTP requests from other Alignak daemons
:return: True if initialization is ok, else False
"""
ca_cert = ssl_cert = ssl_key = server_dh = None
#... | python | def setup_communication_daemon(self):
# pylint: disable=no-member
""" Setup HTTP server daemon to listen
for incoming HTTP requests from other Alignak daemons
:return: True if initialization is ok, else False
"""
ca_cert = ssl_cert = ssl_key = server_dh = None
#... | Setup HTTP server daemon to listen
for incoming HTTP requests from other Alignak daemons
:return: True if initialization is ok, else False | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1553-L1607 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.change_to_user_group | def change_to_user_group(self):
""" Change to configured user/group for the running program.
If user/group are not valid, we exit with code 1
If change failed we exit with code 2
:return: None
"""
# TODO: change user on nt
if os.name == 'nt': # pragma: no cover,... | python | def change_to_user_group(self):
""" Change to configured user/group for the running program.
If user/group are not valid, we exit with code 1
If change failed we exit with code 2
:return: None
"""
# TODO: change user on nt
if os.name == 'nt': # pragma: no cover,... | Change to configured user/group for the running program.
If user/group are not valid, we exit with code 1
If change failed we exit with code 2
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1619-L1681 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.manage_signal | def manage_signal(self, sig, frame): # pylint: disable=unused-argument
"""Manage signals caught by the daemon
signal.SIGUSR1 : dump_environment
signal.SIGUSR2 : dump_object (nothing)
signal.SIGTERM, signal.SIGINT : terminate process
:param sig: signal caught by daemon
:... | python | def manage_signal(self, sig, frame): # pylint: disable=unused-argument
"""Manage signals caught by the daemon
signal.SIGUSR1 : dump_environment
signal.SIGUSR2 : dump_object (nothing)
signal.SIGTERM, signal.SIGINT : terminate process
:param sig: signal caught by daemon
:... | Manage signals caught by the daemon
signal.SIGUSR1 : dump_environment
signal.SIGUSR2 : dump_object (nothing)
signal.SIGTERM, signal.SIGINT : terminate process
:param sig: signal caught by daemon
:type sig: str
:param frame: current stack frame
:type frame:
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1683-L1704 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.set_proctitle | def set_proctitle(self, daemon_name=None):
"""Set the proctitle of the daemon
:param daemon_name: daemon instance name (eg. arbiter-master). If not provided, only the
daemon type (eg. arbiter) will be used for the process title
:type daemon_name: str
:return: None
"""
... | python | def set_proctitle(self, daemon_name=None):
"""Set the proctitle of the daemon
:param daemon_name: daemon instance name (eg. arbiter-master). If not provided, only the
daemon type (eg. arbiter) will be used for the process title
:type daemon_name: str
:return: None
"""
... | Set the proctitle of the daemon
:param daemon_name: daemon instance name (eg. arbiter-master). If not provided, only the
daemon type (eg. arbiter) will be used for the process title
:type daemon_name: str
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1734-L1748 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.get_header | def get_header(self, configuration=False):
"""Get the log file header
If configuration is True, this returns the daemon configuration
:return: A string list containing project name, daemon name, version, licence etc.
:rtype: list
"""
header = [u"-----",
... | python | def get_header(self, configuration=False):
"""Get the log file header
If configuration is True, this returns the daemon configuration
:return: A string list containing project name, daemon name, version, licence etc.
:rtype: list
"""
header = [u"-----",
... | Get the log file header
If configuration is True, this returns the daemon configuration
:return: A string list containing project name, daemon name, version, licence etc.
:rtype: list | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1750-L1779 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.http_daemon_thread | def http_daemon_thread(self):
"""Main function of the http daemon thread will loop forever unless we stop the root daemon
The main thing is to have a pool of X concurrent requests for the http_daemon,
so "no_lock" calls can always be directly answer without having a "locked" version to
... | python | def http_daemon_thread(self):
"""Main function of the http daemon thread will loop forever unless we stop the root daemon
The main thing is to have a pool of X concurrent requests for the http_daemon,
so "no_lock" calls can always be directly answer without having a "locked" version to
... | Main function of the http daemon thread will loop forever unless we stop the root daemon
The main thing is to have a pool of X concurrent requests for the http_daemon,
so "no_lock" calls can always be directly answer without having a "locked" version to
finish. This is achieved thanks to the Ch... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1781-L1801 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.make_a_pause | def make_a_pause(self, timeout=0.0001, check_time_change=True):
""" Wait up to timeout and check for system time change.
This function checks if the system time changed since the last call. If so,
the difference is returned to the caller.
The duration of this call is removed from the ti... | python | def make_a_pause(self, timeout=0.0001, check_time_change=True):
""" Wait up to timeout and check for system time change.
This function checks if the system time changed since the last call. If so,
the difference is returned to the caller.
The duration of this call is removed from the ti... | Wait up to timeout and check for system time change.
This function checks if the system time changed since the last call. If so,
the difference is returned to the caller.
The duration of this call is removed from the timeout. If this duration is
greater than the required timeout, no sle... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1803-L1851 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.wait_for_initial_conf | def wait_for_initial_conf(self, timeout=1.0):
"""Wait initial configuration from the arbiter.
Basically sleep 1.0 and check if new_conf is here
:param timeout: timeout to wait
:type timeout: int
:return: None
"""
logger.info("Waiting for initial configuration")
... | python | def wait_for_initial_conf(self, timeout=1.0):
"""Wait initial configuration from the arbiter.
Basically sleep 1.0 and check if new_conf is here
:param timeout: timeout to wait
:type timeout: int
:return: None
"""
logger.info("Waiting for initial configuration")
... | Wait initial configuration from the arbiter.
Basically sleep 1.0 and check if new_conf is here
:param timeout: timeout to wait
:type timeout: int
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1885-L1904 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.watch_for_new_conf | def watch_for_new_conf(self, timeout=0):
"""Check if a new configuration was sent to the daemon
This function is called on each daemon loop turn. Basically it is a sleep...
If a new configuration was posted, this function returns True
:param timeout: timeout to wait. Default is no wai... | python | def watch_for_new_conf(self, timeout=0):
"""Check if a new configuration was sent to the daemon
This function is called on each daemon loop turn. Basically it is a sleep...
If a new configuration was posted, this function returns True
:param timeout: timeout to wait. Default is no wai... | Check if a new configuration was sent to the daemon
This function is called on each daemon loop turn. Basically it is a sleep...
If a new configuration was posted, this function returns True
:param timeout: timeout to wait. Default is no wait time.
:type timeout: float
:return... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1927-L1940 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.hook_point | def hook_point(self, hook_name, handle=None):
"""Used to call module function that may define a hook function for hook_name
Available hook points:
- `tick`, called on each daemon loop turn
- `save_retention`; called by the scheduler when live state
saving is to be done
... | python | def hook_point(self, hook_name, handle=None):
"""Used to call module function that may define a hook function for hook_name
Available hook points:
- `tick`, called on each daemon loop turn
- `save_retention`; called by the scheduler when live state
saving is to be done
... | Used to call module function that may define a hook function for hook_name
Available hook points:
- `tick`, called on each daemon loop turn
- `save_retention`; called by the scheduler when live state
saving is to be done
- `load_retention`; called by the scheduler when live ... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L1942-L1982 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.get_id | def get_id(self, details=False): # pylint: disable=unused-argument
"""Get daemon identification information
:return: A dict with the following structure
::
{
"alignak": selfAlignak instance name
"type": daemon type
"name": daemon name... | python | def get_id(self, details=False): # pylint: disable=unused-argument
"""Get daemon identification information
:return: A dict with the following structure
::
{
"alignak": selfAlignak instance name
"type": daemon type
"name": daemon name... | Get daemon identification information
:return: A dict with the following structure
::
{
"alignak": selfAlignak instance name
"type": daemon type
"name": daemon name
"version": Alignak version
}
:rtype: dict | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L2005-L2026 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.get_daemon_stats | def get_daemon_stats(self, details=False): # pylint: disable=unused-argument
"""Get state of modules and create a scheme for stats data of daemon
This may be overridden in subclasses (and it is...)
:return: A dict with the following structure
::
{
'modules':... | python | def get_daemon_stats(self, details=False): # pylint: disable=unused-argument
"""Get state of modules and create a scheme for stats data of daemon
This may be overridden in subclasses (and it is...)
:return: A dict with the following structure
::
{
'modules':... | Get state of modules and create a scheme for stats data of daemon
This may be overridden in subclasses (and it is...)
:return: A dict with the following structure
::
{
'modules': {
'internal': {'name': "MYMODULE1", 'state': 'ok'},
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L2028-L2073 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.exit_ok | def exit_ok(self, message, exit_code=None):
"""Log a message and exit
:param exit_code: if not None, exit with the provided value as exit code
:type exit_code: int
:param message: message for the exit reason
:type message: str
:return: None
"""
logger.inf... | python | def exit_ok(self, message, exit_code=None):
"""Log a message and exit
:param exit_code: if not None, exit with the provided value as exit code
:type exit_code: int
:param message: message for the exit reason
:type message: str
:return: None
"""
logger.inf... | Log a message and exit
:param exit_code: if not None, exit with the provided value as exit code
:type exit_code: int
:param message: message for the exit reason
:type message: str
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L2075-L2093 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.exit_on_error | def exit_on_error(self, message, exit_code=1):
# pylint: disable=no-self-use
"""Log generic message when getting an error and exit
:param exit_code: if not None, exit with the provided value as exit code
:type exit_code: int
:param message: message for the exit reason
:t... | python | def exit_on_error(self, message, exit_code=1):
# pylint: disable=no-self-use
"""Log generic message when getting an error and exit
:param exit_code: if not None, exit with the provided value as exit code
:type exit_code: int
:param message: message for the exit reason
:t... | Log generic message when getting an error and exit
:param exit_code: if not None, exit with the provided value as exit code
:type exit_code: int
:param message: message for the exit reason
:type message: str
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L2095-L2114 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.exit_on_exception | def exit_on_exception(self, raised_exception, message='', exit_code=99):
"""Log generic message when getting an unrecoverable error
:param raised_exception: raised Exception
:type raised_exception: Exception
:param message: message for the exit reason
:type message: str
... | python | def exit_on_exception(self, raised_exception, message='', exit_code=99):
"""Log generic message when getting an unrecoverable error
:param raised_exception: raised Exception
:type raised_exception: Exception
:param message: message for the exit reason
:type message: str
... | Log generic message when getting an unrecoverable error
:param raised_exception: raised Exception
:type raised_exception: Exception
:param message: message for the exit reason
:type message: str
:param exit_code: exit with the provided value as exit code
:type exit_code:... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L2116-L2132 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.get_objects_from_from_queues | def get_objects_from_from_queues(self):
""" Get objects from "from" queues and add them.
:return: True if we got something in the queue, False otherwise.
:rtype: bool
"""
_t0 = time.time()
had_some_objects = False
for module in self.modules_manager.get_external_i... | python | def get_objects_from_from_queues(self):
""" Get objects from "from" queues and add them.
:return: True if we got something in the queue, False otherwise.
:rtype: bool
"""
_t0 = time.time()
had_some_objects = False
for module in self.modules_manager.get_external_i... | Get objects from "from" queues and add them.
:return: True if we got something in the queue, False otherwise.
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L2134-L2166 |
Alignak-monitoring/alignak | alignak/daemon.py | Daemon.setup_alignak_logger | def setup_alignak_logger(self):
""" Setup alignak logger:
- with the daemon log configuration properties
- configure the global daemon handler (root logger)
- log the daemon Alignak header
- configure the global Alignak monitoring log
This function is called very early ... | python | def setup_alignak_logger(self):
""" Setup alignak logger:
- with the daemon log configuration properties
- configure the global daemon handler (root logger)
- log the daemon Alignak header
- configure the global Alignak monitoring log
This function is called very early ... | Setup alignak logger:
- with the daemon log configuration properties
- configure the global daemon handler (root logger)
- log the daemon Alignak header
- configure the global Alignak monitoring log
This function is called very early on daemon start. The daemon is not yet forke... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daemon.py#L2168-L2232 |
Alignak-monitoring/alignak | alignak/downtime.py | Downtime.enter | def enter(self, timeperiods, hosts, services):
"""Set ref in scheduled downtime and raise downtime log entry (start)
:param hosts: hosts objects to get item ref
:type hosts: alignak.objects.host.Hosts
:param services: services objects to get item ref
:type services: alignak.obje... | python | def enter(self, timeperiods, hosts, services):
"""Set ref in scheduled downtime and raise downtime log entry (start)
:param hosts: hosts objects to get item ref
:type hosts: alignak.objects.host.Hosts
:param services: services objects to get item ref
:type services: alignak.obje... | Set ref in scheduled downtime and raise downtime log entry (start)
:param hosts: hosts objects to get item ref
:type hosts: alignak.objects.host.Hosts
:param services: services objects to get item ref
:type services: alignak.objects.service.Services
:return: broks
:rtype... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/downtime.py#L174-L227 |
Alignak-monitoring/alignak | alignak/downtime.py | Downtime.exit | def exit(self, timeperiods, hosts, services):
"""Remove ref in scheduled downtime and raise downtime log entry (exit)
:param hosts: hosts objects to get item ref
:type hosts: alignak.objects.host.Hosts
:param services: services objects to get item ref
:type services: alignak.obj... | python | def exit(self, timeperiods, hosts, services):
"""Remove ref in scheduled downtime and raise downtime log entry (exit)
:param hosts: hosts objects to get item ref
:type hosts: alignak.objects.host.Hosts
:param services: services objects to get item ref
:type services: alignak.obj... | Remove ref in scheduled downtime and raise downtime log entry (exit)
:param hosts: hosts objects to get item ref
:type hosts: alignak.objects.host.Hosts
:param services: services objects to get item ref
:type services: alignak.objects.service.Services
:return: [], always | None
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/downtime.py#L229-L277 |
Alignak-monitoring/alignak | alignak/downtime.py | Downtime.cancel | def cancel(self, timeperiods, hosts, services):
"""Remove ref in scheduled downtime and raise downtime log entry (cancel)
:param hosts: hosts objects to get item ref
:type hosts: alignak.objects.host.Hosts
:param services: services objects to get item ref
:type services: alignak... | python | def cancel(self, timeperiods, hosts, services):
"""Remove ref in scheduled downtime and raise downtime log entry (cancel)
:param hosts: hosts objects to get item ref
:type hosts: alignak.objects.host.Hosts
:param services: services objects to get item ref
:type services: alignak... | Remove ref in scheduled downtime and raise downtime log entry (cancel)
:param hosts: hosts objects to get item ref
:type hosts: alignak.objects.host.Hosts
:param services: services objects to get item ref
:type services: alignak.objects.service.Services
:return: [], always
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/downtime.py#L279-L311 |
Alignak-monitoring/alignak | alignak/downtime.py | Downtime.add_automatic_comment | def add_automatic_comment(self, ref):
"""Add comment on ref for downtime
:param ref: the host/service we want to link a comment to
:type ref: alignak.objects.schedulingitem.SchedulingItem
:return: None
"""
if self.fixed is True:
text = (DOWNTIME_FIXED_MESSAG... | python | def add_automatic_comment(self, ref):
"""Add comment on ref for downtime
:param ref: the host/service we want to link a comment to
:type ref: alignak.objects.schedulingitem.SchedulingItem
:return: None
"""
if self.fixed is True:
text = (DOWNTIME_FIXED_MESSAG... | Add comment on ref for downtime
:param ref: the host/service we want to link a comment to
:type ref: alignak.objects.schedulingitem.SchedulingItem
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/downtime.py#L313-L349 |
Alignak-monitoring/alignak | alignak/downtime.py | Downtime.get_raise_brok | def get_raise_brok(self, host_name, service_name=''):
"""Get a start downtime brok
:param host_name: host concerned by the downtime
:type host_name
:param service_name: service concerned by the downtime
:type service_name
:return: brok with wanted data
:rtype: al... | python | def get_raise_brok(self, host_name, service_name=''):
"""Get a start downtime brok
:param host_name: host concerned by the downtime
:type host_name
:param service_name: service concerned by the downtime
:type service_name
:return: brok with wanted data
:rtype: al... | Get a start downtime brok
:param host_name: host concerned by the downtime
:type host_name
:param service_name: service concerned by the downtime
:type service_name
:return: brok with wanted data
:rtype: alignak.brok.Brok | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/downtime.py#L379-L394 |
Alignak-monitoring/alignak | alignak/downtime.py | Downtime.get_expire_brok | def get_expire_brok(self, host_name, service_name=''):
"""Get an expire downtime brok
:param host_name: host concerned by the downtime
:type host_name
:param service_name: service concerned by the downtime
:type service_name
:return: brok with wanted data
:rtype:... | python | def get_expire_brok(self, host_name, service_name=''):
"""Get an expire downtime brok
:param host_name: host concerned by the downtime
:type host_name
:param service_name: service concerned by the downtime
:type service_name
:return: brok with wanted data
:rtype:... | Get an expire downtime brok
:param host_name: host concerned by the downtime
:type host_name
:param service_name: service concerned by the downtime
:type service_name
:return: brok with wanted data
:rtype: alignak.brok.Brok | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/downtime.py#L396-L411 |
Alignak-monitoring/alignak | alignak/objects/command.py | Command.fill_data_brok_from | def fill_data_brok_from(self, data, brok_type):
"""
Add properties to data if fill_brok of these class properties
is same as brok_type
:param data: dictionnary of this command
:type data: dict
:param brok_type: type of brok
:type brok_type: str
:return: N... | python | def fill_data_brok_from(self, data, brok_type):
"""
Add properties to data if fill_brok of these class properties
is same as brok_type
:param data: dictionnary of this command
:type data: dict
:param brok_type: type of brok
:type brok_type: str
:return: N... | Add properties to data if fill_brok of these class properties
is same as brok_type
:param data: dictionnary of this command
:type data: dict
:param brok_type: type of brok
:type brok_type: str
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/command.py#L126-L144 |
Alignak-monitoring/alignak | alignak/objects/command.py | Command.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
# _inte... | 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
# _inte... | 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/command.py#L148-L191 |
Alignak-monitoring/alignak | alignak/objects/servicedependency.py | Servicedependency.get_name | def get_name(self):
"""Get name based on 4 class attributes
Each attribute is substituted by '' if attribute does not exist
:return: dependent_host_name/dependent_service_description..host_name/service_description
:rtype: str
TODO: Clean this function (use format for string)
... | python | def get_name(self):
"""Get name based on 4 class attributes
Each attribute is substituted by '' if attribute does not exist
:return: dependent_host_name/dependent_service_description..host_name/service_description
:rtype: str
TODO: Clean this function (use format for string)
... | Get name based on 4 class attributes
Each attribute is substituted by '' if attribute does not exist
:return: dependent_host_name/dependent_service_description..host_name/service_description
:rtype: str
TODO: Clean this function (use format for string) | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/servicedependency.py#L108-L119 |
Alignak-monitoring/alignak | alignak/objects/servicedependency.py | Servicedependencies.add_service_dependency | def add_service_dependency(self, dep_host_name, dep_service_description,
par_host_name, par_service_description):
"""Instantiate and add a Servicedependency object to the items dict::
* notification criteria is "u,c,w"
* inherits_parent is True
:param dep... | python | def add_service_dependency(self, dep_host_name, dep_service_description,
par_host_name, par_service_description):
"""Instantiate and add a Servicedependency object to the items dict::
* notification criteria is "u,c,w"
* inherits_parent is True
:param dep... | Instantiate and add a Servicedependency object to the items dict::
* notification criteria is "u,c,w"
* inherits_parent is True
:param dep_host_name: dependent host name
:type dep_host_name: str
:param dep_service_description: dependent service description
:type dep_ser... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/servicedependency.py#L139-L166 |
Alignak-monitoring/alignak | alignak/objects/servicedependency.py | Servicedependencies.explode_hostgroup | def explode_hostgroup(self, svc_dep, hostgroups):
# pylint: disable=too-many-locals
"""Explode a service dependency for each member of hostgroup
:param svc_dep: service dependency to explode
:type svc_dep: alignak.objects.servicedependency.Servicedependency
:param hostgroups: us... | python | def explode_hostgroup(self, svc_dep, hostgroups):
# pylint: disable=too-many-locals
"""Explode a service dependency for each member of hostgroup
:param svc_dep: service dependency to explode
:type svc_dep: alignak.objects.servicedependency.Servicedependency
:param hostgroups: us... | Explode a service dependency for each member of hostgroup
:param svc_dep: service dependency to explode
:type svc_dep: alignak.objects.servicedependency.Servicedependency
:param hostgroups: used to find hostgroup objects
:type hostgroups: alignak.objects.hostgroup.Hostgroups
:re... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/servicedependency.py#L168-L204 |
Alignak-monitoring/alignak | alignak/objects/servicedependency.py | Servicedependencies.explode | def explode(self, hostgroups):
# pylint: disable=too-many-locals, too-many-branches
"""Explode all service dependency for each member of hostgroups
Each member of dependent hostgroup or hostgroup in dependency have to get a copy of
service dependencies (quite complex to parse)
:... | python | def explode(self, hostgroups):
# pylint: disable=too-many-locals, too-many-branches
"""Explode all service dependency for each member of hostgroups
Each member of dependent hostgroup or hostgroup in dependency have to get a copy of
service dependencies (quite complex to parse)
:... | Explode all service dependency for each member of hostgroups
Each member of dependent hostgroup or hostgroup in dependency have to get a copy of
service dependencies (quite complex to parse)
:param hostgroups: used to look for hostgroup
:type hostgroups: alignak.objects.hostgroup.Hostgr... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/servicedependency.py#L206-L303 |
Alignak-monitoring/alignak | alignak/objects/servicedependency.py | Servicedependencies.linkify | def linkify(self, hosts, services, timeperiods):
"""Create link between objects::
* servicedependency -> host
* servicedependency -> service
* servicedependency -> timeperiods
:param hosts: hosts to link
:type hosts: alignak.objects.host.Hosts
:param services... | python | def linkify(self, hosts, services, timeperiods):
"""Create link between objects::
* servicedependency -> host
* servicedependency -> service
* servicedependency -> timeperiods
:param hosts: hosts to link
:type hosts: alignak.objects.host.Hosts
:param services... | Create link between objects::
* servicedependency -> host
* servicedependency -> service
* servicedependency -> timeperiods
:param hosts: hosts to link
:type hosts: alignak.objects.host.Hosts
:param services: services to link
:type services: alignak.objects.s... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/servicedependency.py#L305-L322 |
Alignak-monitoring/alignak | alignak/objects/servicedependency.py | Servicedependencies.linkify_sd_by_s | def linkify_sd_by_s(self, hosts, services):
"""Replace dependent_service_description and service_description
in service dependency by the real object
:param hosts: host list, used to look for a specific one
:type hosts: alignak.objects.host.Hosts
:param services: service list to... | python | def linkify_sd_by_s(self, hosts, services):
"""Replace dependent_service_description and service_description
in service dependency by the real object
:param hosts: host list, used to look for a specific one
:type hosts: alignak.objects.host.Hosts
:param services: service list to... | Replace dependent_service_description and service_description
in service dependency by the real object
:param hosts: host list, used to look for a specific one
:type hosts: alignak.objects.host.Hosts
:param services: service list to look for a specific one
:type services: aligna... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/servicedependency.py#L324-L379 |
Alignak-monitoring/alignak | alignak/objects/servicedependency.py | Servicedependencies.linkify_sd_by_tp | def linkify_sd_by_tp(self, timeperiods):
"""Replace dependency_period by a real object in service dependency
:param timeperiods: list of timeperiod, used to look for a specific one
:type timeperiods: alignak.objects.timeperiod.Timeperiods
:return: None
"""
for servicedep... | python | def linkify_sd_by_tp(self, timeperiods):
"""Replace dependency_period by a real object in service dependency
:param timeperiods: list of timeperiod, used to look for a specific one
:type timeperiods: alignak.objects.timeperiod.Timeperiods
:return: None
"""
for servicedep... | Replace dependency_period by a real object in service dependency
:param timeperiods: list of timeperiod, used to look for a specific one
:type timeperiods: alignak.objects.timeperiod.Timeperiods
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/servicedependency.py#L381-L397 |
Alignak-monitoring/alignak | alignak/objects/servicedependency.py | Servicedependencies.linkify_s_by_sd | def linkify_s_by_sd(self, services):
"""Add dependency in service objects
:return: None
"""
for servicedep in self:
# Only used for debugging purpose when loops are detected
setattr(servicedep, "service_description_string", "undefined")
setattr(servic... | python | def linkify_s_by_sd(self, services):
"""Add dependency in service objects
:return: None
"""
for servicedep in self:
# Only used for debugging purpose when loops are detected
setattr(servicedep, "service_description_string", "undefined")
setattr(servic... | Add dependency in service objects
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/servicedependency.py#L399-L429 |
Alignak-monitoring/alignak | alignak/objects/servicedependency.py | Servicedependencies.is_correct | def is_correct(self):
"""Check if this servicedependency 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
... | python | def is_correct(self):
"""Check if this servicedependency 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
... | Check if this servicedependency 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/servicedependency.py#L431-L463 |
Alignak-monitoring/alignak | alignak/modules/inner_metrics.py | get_instance | def get_instance(mod_conf):
"""
Return a module instance for the modules manager
:param mod_conf: the module properties as defined globally in this file
:return:
"""
logger.info("Giving an instance of %s for alias: %s",
mod_conf.python_name, mod_conf.module_alias)
return In... | python | def get_instance(mod_conf):
"""
Return a module instance for the modules manager
:param mod_conf: the module properties as defined globally in this file
:return:
"""
logger.info("Giving an instance of %s for alias: %s",
mod_conf.python_name, mod_conf.module_alias)
return In... | Return a module instance for the modules manager
:param mod_conf: the module properties as defined globally in this file
:return: | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modules/inner_metrics.py#L53-L63 |
Alignak-monitoring/alignak | alignak/modules/inner_metrics.py | InnerMetrics.init | def init(self): # pylint: disable=too-many-branches
"""Called by the daemon broker to initialize the module"""
if not self.enabled:
logger.info(" the module is disabled.")
return True
try:
connections = self.test_connection()
except Exception as exp:... | python | def init(self): # pylint: disable=too-many-branches
"""Called by the daemon broker to initialize the module"""
if not self.enabled:
logger.info(" the module is disabled.")
return True
try:
connections = self.test_connection()
except Exception as exp:... | Called by the daemon broker to initialize the module | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modules/inner_metrics.py#L235-L294 |
Alignak-monitoring/alignak | alignak/modules/inner_metrics.py | InnerMetrics.get_metrics_from_perfdata | def get_metrics_from_perfdata(self, service, perf_data):
"""Decode the performance data to build a metrics list"""
result = []
metrics = PerfDatas(perf_data)
for metric in metrics:
logger.debug("service: %s, metric: %s (%s)", service, metric, metric.__dict__)
if... | python | def get_metrics_from_perfdata(self, service, perf_data):
"""Decode the performance data to build a metrics list"""
result = []
metrics = PerfDatas(perf_data)
for metric in metrics:
logger.debug("service: %s, metric: %s (%s)", service, metric, metric.__dict__)
if... | Decode the performance data to build a metrics list | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modules/inner_metrics.py#L364-L402 |
Alignak-monitoring/alignak | alignak/modules/inner_metrics.py | InnerMetrics.flush | def flush(self, log=False): # pylint:disable=too-many-branches, too-many-nested-blocks
"""Send inner stored metrics to the configured Graphite or InfluxDB
Returns False if the sending failed with a warning log if log parameter is set
:param log: to log information or not
:type log: bo... | python | def flush(self, log=False): # pylint:disable=too-many-branches, too-many-nested-blocks
"""Send inner stored metrics to the configured Graphite or InfluxDB
Returns False if the sending failed with a warning log if log parameter is set
:param log: to log information or not
:type log: bo... | Send inner stored metrics to the configured Graphite or InfluxDB
Returns False if the sending failed with a warning log if log parameter is set
:param log: to log information or not
:type log: bool
:return: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modules/inner_metrics.py#L412-L544 |
Alignak-monitoring/alignak | alignak/modules/inner_metrics.py | InnerMetrics.send_to_tsdb | def send_to_tsdb(self, realm, host, service, metrics, ts, path):
"""Send performance data to time series database
Indeed this function stores metrics in the internal cache and checks if the flushing
is necessary and then flushes.
:param realm: concerned realm
:type: string
... | python | def send_to_tsdb(self, realm, host, service, metrics, ts, path):
"""Send performance data to time series database
Indeed this function stores metrics in the internal cache and checks if the flushing
is necessary and then flushes.
:param realm: concerned realm
:type: string
... | Send performance data to time series database
Indeed this function stores metrics in the internal cache and checks if the flushing
is necessary and then flushes.
:param realm: concerned realm
:type: string
:param host: concerned host
:type: string
:param service... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modules/inner_metrics.py#L546-L592 |
Alignak-monitoring/alignak | alignak/modules/inner_metrics.py | InnerMetrics.manage_initial_service_status_brok | def manage_initial_service_status_brok(self, b):
"""Prepare the known services cache"""
host_name = b.data['host_name']
service_description = b.data['service_description']
service_id = host_name+"/"+service_description
logger.debug("got initial service status: %s", service_id)
... | python | def manage_initial_service_status_brok(self, b):
"""Prepare the known services cache"""
host_name = b.data['host_name']
service_description = b.data['service_description']
service_id = host_name+"/"+service_description
logger.debug("got initial service status: %s", service_id)
... | Prepare the known services cache | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modules/inner_metrics.py#L594-L611 |
Alignak-monitoring/alignak | alignak/modules/inner_metrics.py | InnerMetrics.manage_initial_host_status_brok | def manage_initial_host_status_brok(self, b):
"""Prepare the known hosts cache"""
host_name = b.data['host_name']
logger.debug("got initial host status: %s", host_name)
self.hosts_cache[host_name] = {
'realm_name':
sanitize_name(b.data.get('realm_name', b.dat... | python | def manage_initial_host_status_brok(self, b):
"""Prepare the known hosts cache"""
host_name = b.data['host_name']
logger.debug("got initial host status: %s", host_name)
self.hosts_cache[host_name] = {
'realm_name':
sanitize_name(b.data.get('realm_name', b.dat... | Prepare the known hosts cache | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modules/inner_metrics.py#L613-L627 |
Alignak-monitoring/alignak | alignak/modules/inner_metrics.py | InnerMetrics.manage_service_check_result_brok | def manage_service_check_result_brok(self, b): # pylint: disable=too-many-branches
"""A service check result brok has just arrived ..."""
host_name = b.data.get('host_name', None)
service_description = b.data.get('service_description', None)
if not host_name or not service_description:
... | python | def manage_service_check_result_brok(self, b): # pylint: disable=too-many-branches
"""A service check result brok has just arrived ..."""
host_name = b.data.get('host_name', None)
service_description = b.data.get('service_description', None)
if not host_name or not service_description:
... | A service check result brok has just arrived ... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modules/inner_metrics.py#L629-L688 |
Alignak-monitoring/alignak | alignak/modules/inner_metrics.py | InnerMetrics.manage_host_check_result_brok | def manage_host_check_result_brok(self, b): # pylint: disable=too-many-branches
"""An host check result brok has just arrived..."""
host_name = b.data.get('host_name', None)
if not host_name:
return
logger.debug("host check result: %s", host_name)
# If host initial ... | python | def manage_host_check_result_brok(self, b): # pylint: disable=too-many-branches
"""An host check result brok has just arrived..."""
host_name = b.data.get('host_name', None)
if not host_name:
return
logger.debug("host check result: %s", host_name)
# If host initial ... | An host check result brok has just arrived... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/modules/inner_metrics.py#L690-L740 |
Alignak-monitoring/alignak | alignak/comment.py | Comment.get_comment_brok | def get_comment_brok(self, host_name, service_name=''):
"""Get a comment brok
:param host_name:
:param service_name:
:return: brok with wanted data
:rtype: alignak.brok.Brok
"""
data = self.serialize()
data['host'] = host_name
if service_name:
... | python | def get_comment_brok(self, host_name, service_name=''):
"""Get a comment brok
:param host_name:
:param service_name:
:return: brok with wanted data
:rtype: alignak.brok.Brok
"""
data = self.serialize()
data['host'] = host_name
if service_name:
... | Get a comment brok
:param host_name:
:param service_name:
:return: brok with wanted data
:rtype: alignak.brok.Brok | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/comment.py#L124-L137 |
Alignak-monitoring/alignak | alignak/bin/alignak_scheduler.py | main | def main():
"""Parse args and run main daemon function
:return: None
"""
try:
args = parse_daemon_args()
daemon = Alignak(**args.__dict__)
daemon.main()
except Exception as exp: # pylint: disable=broad-except
sys.stderr.write("*** Daemon exited because: %s" % str(ex... | python | def main():
"""Parse args and run main daemon function
:return: None
"""
try:
args = parse_daemon_args()
daemon = Alignak(**args.__dict__)
daemon.main()
except Exception as exp: # pylint: disable=broad-except
sys.stderr.write("*** Daemon exited because: %s" % str(ex... | Parse args and run main daemon function
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/bin/alignak_scheduler.py#L94-L106 |
Alignak-monitoring/alignak | alignak/objects/notificationway.py | NotificationWay.want_service_notification | def want_service_notification(self, timeperiods, timestamp, state, n_type,
business_impact, cmd=None):
# pylint: disable=too-many-return-statements
"""Check if notification options match the state of the service
Notification is NOT wanted in ONE of the following... | python | def want_service_notification(self, timeperiods, timestamp, state, n_type,
business_impact, cmd=None):
# pylint: disable=too-many-return-statements
"""Check if notification options match the state of the service
Notification is NOT wanted in ONE of the following... | Check if notification options match the state of the service
Notification is NOT wanted in ONE of the following case::
* service notifications are disabled
* cmd is not in service_notification_commands
* business_impact < self.min_business_impact
* service_notification_period is... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/notificationway.py#L144-L206 |
Alignak-monitoring/alignak | alignak/objects/notificationway.py | NotificationWay.want_host_notification | def want_host_notification(self, timperiods, timestamp,
state, n_type, business_impact, cmd=None):
# pylint: disable=too-many-return-statements
"""Check if notification options match the state of the host
Notification is NOT wanted in ONE of the following case::
... | python | def want_host_notification(self, timperiods, timestamp,
state, n_type, business_impact, cmd=None):
# pylint: disable=too-many-return-statements
"""Check if notification options match the state of the host
Notification is NOT wanted in ONE of the following case::
... | Check if notification options match the state of the host
Notification is NOT wanted in ONE of the following case::
* host notifications are disabled
* cmd is not in host_notification_commands
* business_impact < self.min_business_impact
* host_notification_period is not valid
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/notificationway.py#L208-L268 |
Alignak-monitoring/alignak | alignak/objects/notificationway.py | NotificationWay.get_notification_commands | def get_notification_commands(self, o_type):
"""Get notification commands for object type
:param o_type: object type (host or service)
:type o_type: str
:return: command list
:rtype: list[alignak.objects.command.Command]
"""
# service_notification_commands for se... | python | def get_notification_commands(self, o_type):
"""Get notification commands for object type
:param o_type: object type (host or service)
:type o_type: str
:return: command list
:rtype: list[alignak.objects.command.Command]
"""
# service_notification_commands for se... | Get notification commands for object type
:param o_type: object type (host or service)
:type o_type: str
:return: command list
:rtype: list[alignak.objects.command.Command] | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/notificationway.py#L270-L281 |
Alignak-monitoring/alignak | alignak/objects/notificationway.py | NotificationWay.is_correct | def is_correct(self):
# pylint: disable=too-many-branches
"""Check if this object configuration is correct ::
* Check our own specific properties
* Call our parent class is_correct checker
:return: True if the configuration is correct, otherwise False
:rtype: bool
... | python | def is_correct(self):
# pylint: disable=too-many-branches
"""Check if this object configuration is correct ::
* Check our own specific properties
* Call our parent class is_correct checker
:return: True if the configuration is correct, otherwise False
:rtype: bool
... | 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/notificationway.py#L283-L362 |
Alignak-monitoring/alignak | alignak/objects/notificationway.py | NotificationWays.linkify | def linkify(self, timeperiods, commands):
"""Create link between objects::
* notificationways -> timeperiods
* notificationways -> commands
:param timeperiods: timeperiods to link
:type timeperiods: alignak.objects.timeperiod.Timeperiods
:param commands: commands to l... | python | def linkify(self, timeperiods, commands):
"""Create link between objects::
* notificationways -> timeperiods
* notificationways -> commands
:param timeperiods: timeperiods to link
:type timeperiods: alignak.objects.timeperiod.Timeperiods
:param commands: commands to l... | Create link between objects::
* notificationways -> timeperiods
* notificationways -> commands
:param timeperiods: timeperiods to link
:type timeperiods: alignak.objects.timeperiod.Timeperiods
:param commands: commands to link
:type commands: alignak.objects.command.C... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/notificationway.py#L372-L387 |
Alignak-monitoring/alignak | alignak/objects/notificationway.py | NotificationWays.new_inner_member | def new_inner_member(self, name, params):
"""Create new instance of NotificationWay with given name and parameters
and add it to the item list
:param name: notification way name
:type name: str
:param params: notification wat parameters
:type params: dict
:return... | python | def new_inner_member(self, name, params):
"""Create new instance of NotificationWay with given name and parameters
and add it to the item list
:param name: notification way name
:type name: str
:param params: notification wat parameters
:type params: dict
:return... | Create new instance of NotificationWay with given name and parameters
and add it to the item list
:param name: notification way name
:type name: str
:param params: notification wat parameters
:type params: dict
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/notificationway.py#L389-L400 |
Alignak-monitoring/alignak | alignak/objects/macromodulation.py | MacroModulation.is_correct | def is_correct(self):
"""
Check if this object configuration is correct ::
* Call our parent class is_correct checker
:return: True if the configuration is correct, otherwise False
:rtype: bool
"""
state = True
# Ok just put None as modulation_period, m... | python | def is_correct(self):
"""
Check if this object configuration is correct ::
* Call our parent class is_correct checker
:return: True if the configuration is correct, otherwise False
:rtype: bool
"""
state = True
# Ok just put None as modulation_period, m... | Check if this object configuration is correct ::
* 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/macromodulation.py#L107-L127 |
Alignak-monitoring/alignak | alignak/misc/serialization.py | serialize | def serialize(obj, no_dump=False):
"""
Serialize an object.
Returns a dict containing an `_error` property if a MemoryError happens during the
object serialization. See #369.
:param obj: the object to serialize
:type obj: alignak.objects.item.Item | dict | list | str
:param no_dump: if Tru... | python | def serialize(obj, no_dump=False):
"""
Serialize an object.
Returns a dict containing an `_error` property if a MemoryError happens during the
object serialization. See #369.
:param obj: the object to serialize
:type obj: alignak.objects.item.Item | dict | list | str
:param no_dump: if Tru... | Serialize an object.
Returns a dict containing an `_error` property if a MemoryError happens during the
object serialization. See #369.
:param obj: the object to serialize
:type obj: alignak.objects.item.Item | dict | list | str
:param no_dump: if True return dict, otherwise return a json
:typ... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/misc/serialization.py#L31-L78 |
Alignak-monitoring/alignak | alignak/misc/serialization.py | unserialize | def unserialize(j_obj, no_load=False):
"""
Un-serialize object. If we have __sys_python_module__ we try to safely get the alignak class
Then we re-instantiate the alignak object
:param j_obj: json object, dict
:type j_obj: str (before loads)
:param no_load: if True, j_obj is a dict, otherwise i... | python | def unserialize(j_obj, no_load=False):
"""
Un-serialize object. If we have __sys_python_module__ we try to safely get the alignak class
Then we re-instantiate the alignak object
:param j_obj: json object, dict
:type j_obj: str (before loads)
:param no_load: if True, j_obj is a dict, otherwise i... | Un-serialize object. If we have __sys_python_module__ we try to safely get the alignak class
Then we re-instantiate the alignak object
:param j_obj: json object, dict
:type j_obj: str (before loads)
:param no_load: if True, j_obj is a dict, otherwise it's a json and need loads it
:type no_load: boo... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/misc/serialization.py#L81-L118 |
Alignak-monitoring/alignak | alignak/misc/serialization.py | get_alignak_class | def get_alignak_class(python_path):
""" Get the alignak class the in safest way I could imagine.
Return None if (cumulative conditions) ::
* the module does not start with alignak
* above is false and the module is not is sys.modules
* above is false and the module does not have the wanted class
... | python | def get_alignak_class(python_path):
""" Get the alignak class the in safest way I could imagine.
Return None if (cumulative conditions) ::
* the module does not start with alignak
* above is false and the module is not is sys.modules
* above is false and the module does not have the wanted class
... | Get the alignak class the in safest way I could imagine.
Return None if (cumulative conditions) ::
* the module does not start with alignak
* above is false and the module is not is sys.modules
* above is false and the module does not have the wanted class
* above is false and the class in not a Cl... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/misc/serialization.py#L121-L159 |
Alignak-monitoring/alignak | alignak/brok.py | Brok.get_event | def get_event(self):
"""This function returns an Event from a Brok
If the type is monitoring_log then the Brok contains a monitoring event
(alert, notification, ...) information. This function will return a tuple
with the creation time, the level and message information
:return... | python | def get_event(self):
"""This function returns an Event from a Brok
If the type is monitoring_log then the Brok contains a monitoring event
(alert, notification, ...) information. This function will return a tuple
with the creation time, the level and message information
:return... | This function returns an Event from a Brok
If the type is monitoring_log then the Brok contains a monitoring event
(alert, notification, ...) information. This function will return a tuple
with the creation time, the level and message information
:return: tuple with date, level and mes... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/brok.py#L116-L127 |
Alignak-monitoring/alignak | alignak/brok.py | Brok.serialize | def serialize(self):
"""This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here we directly return all attributes
:return: json representation of a Brok
:rtype: dict
"""
return {
... | python | def serialize(self):
"""This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here we directly return all attributes
:return: json representation of a Brok
:rtype: dict
"""
return {
... | This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here we directly return all attributes
:return: json representation of a Brok
:rtype: dict | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/brok.py#L129-L142 |
Alignak-monitoring/alignak | alignak/brok.py | Brok.prepare | def prepare(self):
"""Un-serialize data from data attribute and add instance_id key if necessary
:return: None
"""
# Maybe the Brok is a old daemon one or was already prepared
# if so, the data is already ok
if hasattr(self, 'prepared') and not self.prepared:
... | python | def prepare(self):
"""Un-serialize data from data attribute and add instance_id key if necessary
:return: None
"""
# Maybe the Brok is a old daemon one or was already prepared
# if so, the data is already ok
if hasattr(self, 'prepared') and not self.prepared:
... | Un-serialize data from data attribute and add instance_id key if necessary
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/brok.py#L144-L155 |
Alignak-monitoring/alignak | alignak/complexexpression.py | ComplexExpressionNode.resolve_elements | def resolve_elements(self):
"""Get element of this node recursively
Compute rules with OR or AND rule then NOT rules.
:return: set of element
:rtype: set
"""
# If it's a leaf, we just need to dump a set with the content of the node
if self.leaf:
if no... | python | def resolve_elements(self):
"""Get element of this node recursively
Compute rules with OR or AND rule then NOT rules.
:return: set of element
:rtype: set
"""
# If it's a leaf, we just need to dump a set with the content of the node
if self.leaf:
if no... | Get element of this node recursively
Compute rules with OR or AND rule then NOT rules.
:return: set of element
:rtype: set | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/complexexpression.py#L72-L114 |
Alignak-monitoring/alignak | alignak/complexexpression.py | ComplexExpressionFactory.eval_cor_pattern | def eval_cor_pattern(self, pattern): # pylint:disable=too-many-branches
"""Parse and build recursively a tree of ComplexExpressionNode from pattern
:param pattern: pattern to parse
:type pattern: str
:return: root node of parsed tree
:type: alignak.complexexpression.ComplexExpr... | python | def eval_cor_pattern(self, pattern): # pylint:disable=too-many-branches
"""Parse and build recursively a tree of ComplexExpressionNode from pattern
:param pattern: pattern to parse
:type pattern: str
:return: root node of parsed tree
:type: alignak.complexexpression.ComplexExpr... | Parse and build recursively a tree of ComplexExpressionNode from pattern
:param pattern: pattern to parse
:type pattern: str
:return: root node of parsed tree
:type: alignak.complexexpression.ComplexExpressionNode | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/complexexpression.py#L147-L261 |
Alignak-monitoring/alignak | alignak/complexexpression.py | ComplexExpressionFactory.find_object | def find_object(self, pattern):
"""Get a list of host corresponding to the pattern regarding the context
:param pattern: pattern to find
:type pattern: str
:return: Host list matching pattern (hostgroup name, template, all)
:rtype: list[alignak.objects.host.Host]
"""
... | python | def find_object(self, pattern):
"""Get a list of host corresponding to the pattern regarding the context
:param pattern: pattern to find
:type pattern: str
:return: Host list matching pattern (hostgroup name, template, all)
:rtype: list[alignak.objects.host.Host]
"""
... | Get a list of host corresponding to the pattern regarding the context
:param pattern: pattern to find
:type pattern: str
:return: Host list matching pattern (hostgroup name, template, all)
:rtype: list[alignak.objects.host.Host] | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/complexexpression.py#L263-L303 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.reset | def reset(self):
# pylint: disable=not-context-manager
"""Reset scheduler::
* Remove waiting results
* Clear checks and actions lists
:return: None
"""
logger.info("Scheduling loop reset")
with self.waiting_results.mutex:
self.waiting_results... | python | def reset(self):
# pylint: disable=not-context-manager
"""Reset scheduler::
* Remove waiting results
* Clear checks and actions lists
:return: None
"""
logger.info("Scheduling loop reset")
with self.waiting_results.mutex:
self.waiting_results... | Reset scheduler::
* Remove waiting results
* Clear checks and actions lists
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L250-L263 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.all_my_hosts_and_services | def all_my_hosts_and_services(self):
"""Create an iterator for all my known hosts and services
:return: None
"""
for what in (self.hosts, self.services):
for item in what:
yield item | python | def all_my_hosts_and_services(self):
"""Create an iterator for all my known hosts and services
:return: None
"""
for what in (self.hosts, self.services):
for item in what:
yield item | Create an iterator for all my known hosts and services
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L265-L272 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.load_conf | def load_conf(self, instance_id, instance_name, conf):
"""Load configuration received from Arbiter and pushed by our Scheduler daemon
:param instance_name: scheduler instance name
:type instance_name: str
:param instance_id: scheduler instance id
:type instance_id: str
:... | python | def load_conf(self, instance_id, instance_name, conf):
"""Load configuration received from Arbiter and pushed by our Scheduler daemon
:param instance_name: scheduler instance name
:type instance_name: str
:param instance_id: scheduler instance id
:type instance_id: str
:... | Load configuration received from Arbiter and pushed by our Scheduler daemon
:param instance_name: scheduler instance name
:type instance_name: str
:param instance_id: scheduler instance id
:type instance_id: str
:param conf: configuration to load
:type conf: alignak.obje... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L274-L329 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.update_recurrent_works_tick | def update_recurrent_works_tick(self, conf):
"""Modify the tick value for the scheduler recurrent work
A tick is an amount of loop of the scheduler before executing the recurrent work
The provided configuration may contain some tick-function_name keys that contain
a tick value to be up... | python | def update_recurrent_works_tick(self, conf):
"""Modify the tick value for the scheduler recurrent work
A tick is an amount of loop of the scheduler before executing the recurrent work
The provided configuration may contain some tick-function_name keys that contain
a tick value to be up... | Modify the tick value for the scheduler recurrent work
A tick is an amount of loop of the scheduler before executing the recurrent work
The provided configuration may contain some tick-function_name keys that contain
a tick value to be updated. Those parameters are defined in the alignak envir... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L331-L364 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.dump_objects | def dump_objects(self):
"""Dump scheduler objects into a dump (temp) file
:return: None
"""
path = os.path.join(tempfile.gettempdir(),
'dump-obj-scheduler-%s-%d.json' % (self.name, int(time.time())))
logger.info('Dumping scheduler objects to: %s', pa... | python | def dump_objects(self):
"""Dump scheduler objects into a dump (temp) file
:return: None
"""
path = os.path.join(tempfile.gettempdir(),
'dump-obj-scheduler-%s-%d.json' % (self.name, int(time.time())))
logger.info('Dumping scheduler objects to: %s', pa... | Dump scheduler objects into a dump (temp) file
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L382-L419 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.dump_config | def dump_config(self):
"""Dump scheduler configuration into a temporary file
The dumped content is JSON formatted
:return: None
"""
path = os.path.join(tempfile.gettempdir(),
'dump-cfg-scheduler-%s-%d.json' % (self.name, int(time.time())))
t... | python | def dump_config(self):
"""Dump scheduler configuration into a temporary file
The dumped content is JSON formatted
:return: None
"""
path = os.path.join(tempfile.gettempdir(),
'dump-cfg-scheduler-%s-%d.json' % (self.name, int(time.time())))
t... | Dump scheduler configuration into a temporary file
The dumped content is JSON formatted
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L421-L435 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.run_external_commands | def run_external_commands(self, cmds):
"""Run external commands Arbiter/Receiver sent
:param cmds: commands to run
:type cmds: list
:return: None
"""
if not self.external_commands_manager:
return
try:
_t0 = time.time()
logger.... | python | def run_external_commands(self, cmds):
"""Run external commands Arbiter/Receiver sent
:param cmds: commands to run
:type cmds: list
:return: None
"""
if not self.external_commands_manager:
return
try:
_t0 = time.time()
logger.... | Run external commands Arbiter/Receiver sent
:param cmds: commands to run
:type cmds: list
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L437-L465 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.add_brok | def add_brok(self, brok, broker_uuid=None):
"""Add a brok into brokers list
It can be for a specific one, all brokers or none (startup)
:param brok: brok to add
:type brok: alignak.brok.Brok
:param broker_uuid: broker uuid for the brok
:type broker_uuid: str
:ret... | python | def add_brok(self, brok, broker_uuid=None):
"""Add a brok into brokers list
It can be for a specific one, all brokers or none (startup)
:param brok: brok to add
:type brok: alignak.brok.Brok
:param broker_uuid: broker uuid for the brok
:type broker_uuid: str
:ret... | Add a brok into brokers list
It can be for a specific one, all brokers or none (startup)
:param brok: brok to add
:type brok: alignak.brok.Brok
:param broker_uuid: broker uuid for the brok
:type broker_uuid: str
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L467-L501 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.add_notification | def add_notification(self, notification):
"""Add a notification into actions list
:param notification: notification to add
:type notification: alignak.notification.Notification
:return: None
"""
if notification.uuid in self.actions:
logger.warning("Already ex... | python | def add_notification(self, notification):
"""Add a notification into actions list
:param notification: notification to add
:type notification: alignak.notification.Notification
:return: None
"""
if notification.uuid in self.actions:
logger.warning("Already ex... | Add a notification into actions list
:param notification: notification to add
:type notification: alignak.notification.Notification
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L503-L520 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.add_check | def add_check(self, check):
"""Add a check into the scheduler checks list
:param check: check to add
:type check: alignak.check.Check
:return: None
"""
if check is None:
return
if check.uuid in self.checks:
logger.debug("Already existing c... | python | def add_check(self, check):
"""Add a check into the scheduler checks list
:param check: check to add
:type check: alignak.check.Check
:return: None
"""
if check is None:
return
if check.uuid in self.checks:
logger.debug("Already existing c... | Add a check into the scheduler checks list
:param check: check to add
:type check: alignak.check.Check
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L522-L544 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.add_event_handler | def add_event_handler(self, action):
"""Add a event handler into actions list
:param action: event handler to add
:type action: alignak.eventhandler.EventHandler
:return: None
"""
if action.uuid in self.actions:
logger.info("Already existing event handler: %s... | python | def add_event_handler(self, action):
"""Add a event handler into actions list
:param action: event handler to add
:type action: alignak.eventhandler.EventHandler
:return: None
"""
if action.uuid in self.actions:
logger.info("Already existing event handler: %s... | Add a event handler into actions list
:param action: event handler to add
:type action: alignak.eventhandler.EventHandler
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L546-L558 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.add | def add(self, elt):
"""Generic function to add objects into the scheduler daemon internal lists::
Brok -> self.broks
Check -> self.checks
Notification -> self.actions
EventHandler -> self.actions
For an ExternalCommand, tries to resolve the command
:param elt: e... | python | def add(self, elt):
"""Generic function to add objects into the scheduler daemon internal lists::
Brok -> self.broks
Check -> self.checks
Notification -> self.actions
EventHandler -> self.actions
For an ExternalCommand, tries to resolve the command
:param elt: e... | Generic function to add objects into the scheduler daemon internal lists::
Brok -> self.broks
Check -> self.checks
Notification -> self.actions
EventHandler -> self.actions
For an ExternalCommand, tries to resolve the command
:param elt: element to add
:type elt... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L570-L590 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.hook_point | def hook_point(self, hook_name):
"""Generic function to call modules methods if such method is avalaible
:param hook_name: function name to call
:type hook_name: str
:return:None
"""
self.my_daemon.hook_point(hook_name=hook_name, handle=self) | python | def hook_point(self, hook_name):
"""Generic function to call modules methods if such method is avalaible
:param hook_name: function name to call
:type hook_name: str
:return:None
"""
self.my_daemon.hook_point(hook_name=hook_name, handle=self) | Generic function to call modules methods if such method is avalaible
:param hook_name: function name to call
:type hook_name: str
:return:None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L600-L607 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.clean_queues | def clean_queues(self):
# pylint: disable=too-many-locals
"""Reduces internal list size to max allowed
* checks and broks : 5 * length of hosts + services
* actions : 5 * length of hosts + services + contacts
:return: None
"""
# If we set the interval at 0, we b... | python | def clean_queues(self):
# pylint: disable=too-many-locals
"""Reduces internal list size to max allowed
* checks and broks : 5 * length of hosts + services
* actions : 5 * length of hosts + services + contacts
:return: None
"""
# If we set the interval at 0, we b... | Reduces internal list size to max allowed
* checks and broks : 5 * length of hosts + services
* actions : 5 * length of hosts + services + contacts
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L609-L680 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.update_business_values | def update_business_values(self):
"""Iter over host and service and update business_impact
:return: None
"""
for elt in self.all_my_hosts_and_services():
if not elt.is_problem:
was = elt.business_impact
elt.update_business_impact_value(self.ho... | python | def update_business_values(self):
"""Iter over host and service and update business_impact
:return: None
"""
for elt in self.all_my_hosts_and_services():
if not elt.is_problem:
was = elt.business_impact
elt.update_business_impact_value(self.ho... | Iter over host and service and update business_impact
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L716-L744 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.scatter_master_notifications | def scatter_master_notifications(self):
"""Generate children notifications from a master notification
Also update notification number
Master notification are raised when a notification must be sent out. They are not
launched by reactionners (only children are) but they are used to build... | python | def scatter_master_notifications(self):
"""Generate children notifications from a master notification
Also update notification number
Master notification are raised when a notification must be sent out. They are not
launched by reactionners (only children are) but they are used to build... | Generate children notifications from a master notification
Also update notification number
Master notification are raised when a notification must be sent out. They are not
launched by reactionners (only children are) but they are used to build the
children notifications.
From ... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L746-L828 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.get_to_run_checks | def get_to_run_checks(self, do_checks=False, do_actions=False,
poller_tags=None, reactionner_tags=None,
worker_name='none', module_types=None):
# pylint: disable=too-many-branches
"""Get actions/checks for reactionner/poller
Called by the poll... | python | def get_to_run_checks(self, do_checks=False, do_actions=False,
poller_tags=None, reactionner_tags=None,
worker_name='none', module_types=None):
# pylint: disable=too-many-branches
"""Get actions/checks for reactionner/poller
Called by the poll... | Get actions/checks for reactionner/poller
Called by the poller to get checks (do_checks=True) and
by the reactionner (do_actions=True) to get actions
:param do_checks: do we get checks ?
:type do_checks: bool
:param do_actions: do we get actions ?
:type do_actions: bool... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L830-L978 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.manage_results | def manage_results(self, action): # pylint: disable=too-many-branches,too-many-statements
"""Get result from pollers/reactionners (actives ones)
:param action: check / action / event handler to handle
:type action:
:return: None
"""
logger.debug('manage_results: %s ', a... | python | def manage_results(self, action): # pylint: disable=too-many-branches,too-many-statements
"""Get result from pollers/reactionners (actives ones)
:param action: check / action / event handler to handle
:type action:
:return: None
"""
logger.debug('manage_results: %s ', a... | Get result from pollers/reactionners (actives ones)
:param action: check / action / event handler to handle
:type action:
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L980-L1125 |
Alignak-monitoring/alignak | alignak/scheduler.py | Scheduler.push_actions_to_passive_satellites | def push_actions_to_passive_satellites(self):
"""Send actions/checks to passive poller/reactionners
:return: None
"""
# We loop for our passive pollers or reactionners
for satellites in [self.my_daemon.pollers, self.my_daemon.reactionners]:
s_type = 'poller'
... | python | def push_actions_to_passive_satellites(self):
"""Send actions/checks to passive poller/reactionners
:return: None
"""
# We loop for our passive pollers or reactionners
for satellites in [self.my_daemon.pollers, self.my_daemon.reactionners]:
s_type = 'poller'
... | Send actions/checks to passive poller/reactionners
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/scheduler.py#L1127-L1156 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.