alignak.objects package
Submodules
alignak.objects.arbiterlink module
This module provide ArbiterLink and ArbiterLinks classes used to manage link
with Arbiter daemon
-
class alignak.objects.arbiterlink.ArbiterLink(*args, **kwargs)[source]
Bases: alignak.objects.satellitelink.SatelliteLink
Class to manage the link to Arbiter daemon.
With it, arbiter can see if a Arbiter daemon is alive, and can send it new configuration
-
do_not_run()[source]
Check if satellite running or not
If not, try to run
Returns: | true if satellite not running |
Return type: | bool |
-
get_all_states()[source]
Get states of all satellites
Returns: | list of all states |
Return type: | list | None |
-
get_config()[source]
Get the config of the arbiter
Returns: | the config |
Return type: | object |
-
get_objects_properties(table, properties=[])[source]
Get properties of objects
Parameters: |
- table (str) – name of table
- properties (list) – list of properties
|
Returns: | list of objects
|
Return type: | list | None
|
-
get_satellite_list(daemon_type)[source]
Get list of satellites
Parameters: | daemon_type (str) – name of daemon to check |
Returns: | list of satellites |
Return type: | list |
-
get_satellite_status(daemon_type, name)[source]
Get the status of a satellite
Parameters: |
- daemon_type (str) – type of daemon
- name (str) – Name of daemon
|
Returns: | dictionary of status
|
Return type: | dict
|
-
give_satellite_cfg()[source]
Get the config of this satellite
Returns: | dictionary with information of the satellite |
Return type: | dict |
-
is_me(lookup_name)[source]
Check if parameter name if same than name of this object
Parameters: | lookup_name (str) – name of arbiter to check |
Returns: | true if parameter name if same than this name |
Return type: | bool |
-
my_type = 'arbiter'
-
properties = {'check_interval': <alignak.property.IntegerProp object at 0x7fd17a6c1610>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'hard_ssl_name_check': <alignak.property.BoolProp object at 0x7fd17a6c1950>, 'use_timezone': <alignak.property.StringProp object at 0x7fd17a6c17d0>, 'spare': <alignak.property.BoolProp object at 0x7fd17a6c1690>, 'address': <alignak.property.StringProp object at 0x7fd17a6c1510>, 'use_ssl': <alignak.property.BoolProp object at 0x7fd17a6c1910>, 'manage_arbiters': <alignak.property.BoolProp object at 0x7fd17a6c1710>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'passive': <alignak.property.BoolProp object at 0x7fd17a6c1990>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'realm': <alignak.property.StringProp object at 0x7fd17a6c1810>, 'data_timeout': <alignak.property.IntegerProp object at 0x7fd17a6c15d0>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'modules': <alignak.property.ListProp object at 0x7fd17a6c1750>, 'port': <alignak.property.IntegerProp object at 0x7fd17a6c1c10>, 'manage_sub_realms': <alignak.property.BoolProp object at 0x7fd17a6c16d0>, 'satellitemap': <alignak.property.DictProp object at 0x7fd17a6c1850>, 'host_name': <alignak.property.StringProp object at 0x7fd17a6c1bd0>, 'timeout': <alignak.property.IntegerProp object at 0x7fd17a6c1590>, 'polling_interval': <alignak.property.IntegerProp object at 0x7fd17a6c1790>, 'max_check_attempts': <alignak.property.IntegerProp object at 0x7fd17a6c1650>, 'arbiter_name': <alignak.property.StringProp object at 0x7fd17a6c1490>}
-
class alignak.objects.arbiterlink.ArbiterLinks(items, index_items=True)[source]
Bases: alignak.objects.satellitelink.SatelliteLinks
Class to manage list of ArbiterLink.
ArbiterLinks is used to regroup all links with Arbiter daemon
-
inner_class
alias of ArbiterLink
-
linkify(modules)[source]
Link modules to Arbiter
Parameters: | modules (list) – list of modules |
Returns: | None |
-
name_property = 'arbiter_name'
alignak.objects.brokerlink module
This module provide BrokerLink and BrokerLinks classes used to manage brokers
-
class alignak.objects.brokerlink.BrokerLink(*args, **kwargs)[source]
Bases: alignak.objects.satellitelink.SatelliteLink
Class to manage the broker information
-
my_type = 'broker'
-
properties = {'broker_name': <alignak.property.StringProp object at 0x7fd17a6cd450>, 'check_interval': <alignak.property.IntegerProp object at 0x7fd17a6c1610>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'hard_ssl_name_check': <alignak.property.BoolProp object at 0x7fd17a6c1950>, 'use_timezone': <alignak.property.StringProp object at 0x7fd17a6c17d0>, 'spare': <alignak.property.BoolProp object at 0x7fd17a6c1690>, 'address': <alignak.property.StringProp object at 0x7fd17a6c1510>, 'use_ssl': <alignak.property.BoolProp object at 0x7fd17a6c1910>, 'manage_arbiters': <alignak.property.BoolProp object at 0x7fd17a6c1710>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'passive': <alignak.property.BoolProp object at 0x7fd17a6c1990>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'realm': <alignak.property.StringProp object at 0x7fd17a6c1810>, 'data_timeout': <alignak.property.IntegerProp object at 0x7fd17a6c15d0>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'modules': <alignak.property.ListProp object at 0x7fd17a6c1750>, 'port': <alignak.property.IntegerProp object at 0x7fd17a6cd4d0>, 'manage_sub_realms': <alignak.property.BoolProp object at 0x7fd17a6c16d0>, 'satellitemap': <alignak.property.DictProp object at 0x7fd17a6c1850>, 'timeout': <alignak.property.IntegerProp object at 0x7fd17a6c1590>, 'polling_interval': <alignak.property.IntegerProp object at 0x7fd17a6c1790>, 'max_check_attempts': <alignak.property.IntegerProp object at 0x7fd17a6c1650>}
-
register_to_my_realm()[source]
Add this broker to the realm
-
class alignak.objects.brokerlink.BrokerLinks(items, index_items=True)[source]
Bases: alignak.objects.satellitelink.SatelliteLinks
Class to manage list of BrokerLink.
BrokerLinks is used to regroup all brokers
-
inner_class
alias of BrokerLink
-
name_property = 'broker_name'
alignak.objects.businessimpactmodulation module
This module provide Businessimpactmodulation and Businessimpactmodulations classes used to describe
the modulation of a business impact. Modulation occurs on a modulation period (Timeperiod)
-
class alignak.objects.businessimpactmodulation.Businessimpactmodulation(params={})[source]
Bases: alignak.objects.item.Item
Businessimpactmodulation class is simply a modulation of the business impact value
(of a Host/Service) during a modulation period.
-
get_name()[source]
Accessor to business_impact_modulation_name attribute
Returns: | business impact modulation name |
Return type: | str |
-
my_type = 'businessimpactmodulation'
-
properties = {'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'modulation_period': <alignak.property.StringProp object at 0x7fd17a70fa90>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'business_impact_modulation_name': <alignak.property.StringProp object at 0x7fd17a70f9d0>, 'business_impact': <alignak.property.IntegerProp object at 0x7fd17a70fa50>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>}
-
class alignak.objects.businessimpactmodulation.Businessimpactmodulations(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Businessimpactmodulations class allowed to handle easily several Businessimpactmodulation objects
-
inner_class
alias of Businessimpactmodulation
-
linkify(timeperiods)[source]
Wrapper for Businessimpactmodulations.linkify_cm_by_tp(timeperiods)
-
linkify_cm_by_tp(timeperiods)[source]
Replace modulation period by real Timeperiod object into each Businessimpactmodulation
-
name_property = 'business_impact_modulation_name'
alignak.objects.checkmodulation module
This module provide CheckModulation and CheckModulations classes used to describe
the modulation of a check command. Modulation occurs on a check period (Timeperiod)
-
class alignak.objects.checkmodulation.CheckModulation(params={})[source]
Bases: alignak.objects.item.Item
CheckModulation class is simply a modulation of the check command (of a Host/Service)
during a check_period.
-
get_check_command(t_to_go)[source]
Get the check_command if we are in the check period modulation
Parameters: | t_to_go – time to check if we are in the timeperiod |
Returns: | A check command if we are in the check period, None otherwise |
Return type: | alignak.objects.command.Command |
-
get_name()[source]
Accessor to checkmodulation_name attribute
Returns: | check modulation name |
Return type: | str |
-
is_correct()[source]
Check if the CheckModulation definition is correct:
* Check for required attribute
* Raise previous configuration errors
Returns: | True if the definition is correct, False otherwise |
Return type: | bool |
-
macros = {}
-
my_type = 'checkmodulation'
-
properties = {'check_period': <alignak.property.StringProp object at 0x7fd17a731190>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'check_command': <alignak.property.StringProp object at 0x7fd17a731150>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'checkmodulation_name': <alignak.property.StringProp object at 0x7fd17a7310d0>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>}
-
running_properties = {'configuration_errors': <alignak.property.ListProp object at 0x7fd17a819690>, 'configuration_warnings': <alignak.property.ListProp object at 0x7fd17a819650>, 'tags': <alignak.property.ListProp object at 0x7fd17a8196d0>}
-
class alignak.objects.checkmodulation.CheckModulations(items, index_items=True)[source]
Bases: alignak.objects.item.Items
CheckModulations class allowed to handle easily several CheckModulation objects
-
inner_class
alias of CheckModulation
-
linkify(timeperiods, commands)[source]
Replace check_period by real Timeperiod object into each CheckModulation
Replace check_command by real Command object into each CheckModulation
-
name_property = 'checkmodulation_name'
-
new_inner_member(name=None, params={})[source]
Create a CheckModulation object and add it to items
Parameters: |
- name (str) – CheckModulation name
- params (dict) – parameters to init CheckModulation
|
Returns: | None
|
TODO: Remove this default mutable argument. Usually result in unexpected behavior
alignak.objects.command module
This module provide Command class used to define external commands to
check if something is ok or not
-
class alignak.objects.command.Command(params={})[source]
Bases: alignak.objects.item.Item
Class to manage a command
A command is an external command the poller module run to
see if something is ok or not
-
command_line
-
command_name
-
definition_order
-
enable_environment_macros
-
fill_data_brok_from(data, brok_type)[source]
Add properties to data if fill_brok of these class properties
is same as brok_type
Parameters: |
- data (dict) – dictionnary of this command
- brok_type (str) – type of brok
|
Returns: | None
|
-
get_name()[source]
Get the name of the command
Returns: | the command name string |
Return type: | str |
-
imported_from
-
module_type
-
my_type = 'command'
-
name
-
poller_tag
-
properties = {'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'command_line': <alignak.property.StringProp object at 0x7fd17a794290>, 'poller_tag': <alignak.property.StringProp object at 0x7fd17a7942d0>, 'reactionner_tag': <alignak.property.StringProp object at 0x7fd17a794310>, 'module_type': <alignak.property.StringProp object at 0x7fd17a794350>, 'timeout': <alignak.property.IntegerProp object at 0x7fd17a794390>, 'enable_environment_macros': <alignak.property.BoolProp object at 0x7fd17a7943d0>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'command_name': <alignak.property.StringProp object at 0x7fd17a794210>}
-
reactionner_tag
-
register
-
timeout
-
use
-
class alignak.objects.command.Commands(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Class to manage all commands
A command is an external command the poller module run to
see if something is ok or not
-
inner_class
alias of Command
-
name_property = 'command_name'
-
class alignak.objects.command.DummyCommand[source]
Bases: object
Class used to set __autoslots__ because can’t set it
in same class you use
alignak.objects.config module
Config is the class to read, load and manipulate the user
configuration. It read a main cfg (alignak.cfg) and get all informations
from it. It create objects, make link between them, clean them, and cut
them into independent parts. The main user of this is Arbiter, but schedulers
use it too (but far less)
-
class alignak.objects.config.Config[source]
Bases: alignak.objects.item.Item
Config is the class to read, load and manipulate the user
configuration. It read a main cfg (alignak.cfg) and get all informations
from it. It create objects, make link between them, clean them, and cut
them into independent parts. The main user of this is Arbiter, but schedulers
use it too (but far less)
-
add_error(txt)[source]
- Add an error in the configuration error list so we can print them
- all in one place
Parameters: | txt (str) – Text error |
Returns: | None |
-
add_ghost_objects(raw_objects)[source]
Add fake command objects for internal processing ; bp_rule, _internal_host_up, _echo
Parameters: | raw_objects (dict) – Raw config objects dict |
Returns: | raw_objects with 3 extras commands |
Return type: | dict |
-
apply_dependencies()[source]
Creates dependencies links between elements.
-
apply_implicit_inheritance()[source]
Wrapper for calling apply_implicit_inheritance method of services attributes
Implicit inheritance is between host and service (like notification parameters etc)
:return:None
-
apply_inheritance()[source]
Apply inheritance over templates
Template can be used in the following objects:
* hosts
* contacts
* services
* servicedependencies
* hostdependencies
* timeperiods
* hostsextinfo
* servicesextinfo
* serviceescalations
* hostescalations
* escalations
-
cache_path = 'objects.cache'
-
check_error_on_hard_unmanaged_parameters()[source]
Some parameters are just not managed like O*HP commands and regexp capabilities
Returns: | True if we encounter an error, otherwise False |
Return type: | bool |
-
clean()[source]
Wrapper for calling the clean method of services attribute
-
clean_params(params)[source]
Convert a list of parameters (key=value) into a dict
Parameters: | params (list) – parameters list |
Returns: | dict with key and value. Log error if malformed |
Return type: | dict |
-
configuration_types = ['void', 'timeperiod', 'command', 'contactgroup', 'hostgroup', 'contact', 'notificationway', 'checkmodulation', 'macromodulation', 'host', 'service', 'servicegroup', 'servicedependency', 'hostdependency', 'arbiter', 'scheduler', 'reactionner', 'broker', 'receiver', 'poller', 'realm', 'module', 'resultmodulation', 'escalation', 'serviceescalation', 'hostescalation', 'businessimpactmodulation', 'hostextinfo', 'serviceextinfo']
-
create_business_rules()[source]
Create business rules for hosts and services
-
create_business_rules_dependencies()[source]
Create business rules dependencies for hosts and services
-
create_objects(raw_objects)[source]
Create real ‘object’ from dicts of prop/value
Parameters: | raw_objects (dict) – dict with all object with str values |
Returns: | None |
-
create_objects_for_type(raw_objects, o_type)[source]
Generic function to create object regarding the o_type
Parameters: |
- raw_objects (dict) – Raw object we need to instantiate objects
- o_type – the object type we want to create
|
Returns: | None
|
-
create_packs(nb_packs)[source]
Create packs of hosts and services (all dependencies are resolved)
It create a graph. All hosts are connected to their
parents, and hosts without parent are connected to host ‘root’.
services are link to the host. Dependencies are managed
REF: doc/pack-creation.pn
Parameters: | nb_packs (int) – the number of packs to create (number of scheduler basically) |
Returns: | None |
-
cut_into_parts()[source]
Cut conf into part for scheduler dispatch.
Basically it provide a set of host/services for each scheduler that
have no dependencies between them
:return:None
-
dump(f=None)[source]
Dump configuration to a file in a JSON format
Parameters: | f (file) – the file to dump |
Returns: | None |
-
early_arbiter_linking()[source]
Prepare the arbiter for early operations
-
early_created_types = ['arbiter', 'module']
-
explode()[source]
Use to fill groups values on hosts and create new services
(for host group ones)
-
explode_global_conf()[source]
Explode parameters like cached_service_check_horizon in the
Service class in a cached_check_horizon manner, o*hp commands etc
-
fill_default()[source]
Fill objects properties with default value if necessary
-
fill_default_realm()[source]
Check if a realm is defined, if not
Create a new one (default) and tag everyone that do not have
a realm prop to be put in this realm
-
fill_default_satellites()[source]
If a satellite is missing, we add them in the localhost
with defaults values
-
fill_predictive_missing_parameters()[source]
Wrapper for calling fill_predictive_missing_parameters method of hosts attribute
Here is a special functions to fill some special
properties that are not filled and should be like
address for host (if not set, put host_name)
-
fill_resource_macros_names_macros()[source]
fill the macro dict will all value
from self.resource_macros_names
-
get_name()[source]
Get config name
Returns: | Hard-coded value ‘global configuration file’ |
Return type: | str |
-
got_arbiter_module_type_defined(mod_type)[source]
Check if a module type is defined in one of the arbiters
Also check the module_name
Parameters: | mod_type (str) – module type to search |
Returns: | True if mod_type is found else False |
Return type: | bool |
TODO: Factorize it with got_broker_module_type_defined:
-
got_broker_module_type_defined(mod_type)[source]
Check if a module type is defined in one of the brokers
Parameters: | mod_type (str) – module type to search |
Returns: | True if mod_type is found else False |
Return type: | bool |
-
got_scheduler_module_type_defined(mod_type)[source]
Check if a module type is defined in one of the schedulers
Parameters: | mod_type (str) – module type to search |
Returns: | True if mod_type is found else False |
Return type: | bool |
TODO: Factorize it with got_broker_module_type_defined
-
hack_old_nagios_parameters()[source]
Create some ‘modules’ from all nagios parameters if they are set and
the modules are not created
-
hack_old_nagios_parameters_for_arbiter()[source]
Create some ‘modules’ from all nagios parameters if they are set and
the modules are not created
This one is only for arbiter
TODO: Factorize with hack_old_nagios_parameters
-
is_correct()[source]
Check if all elements got a good configuration
Returns: | True if the configuration is correct else False |
Return type: | bool |
-
linkify()[source]
Make ‘links’ between elements, like a host got a services list
with all it’s services in it
-
linkify_templates()[source]
Like for normal object, we link templates with each others
-
load_packs()[source]
Load all packs .pack files from all packs_dirs
-
load_params(params)[source]
Load parameters from main configuration file
Parameters: | params – parameters list (converted right at the beginning) |
Returns: | None |
-
load_triggers()[source]
Load all triggers .trig files from all triggers_dir
-
macros = {'USER235': '$USER235$', 'USER87': '$USER87$', 'USER86': '$USER86$', 'USER85': '$USER85$', 'USER84': '$USER84$', 'USER83': '$USER83$', 'USER82': '$USER82$', 'USER81': '$USER81$', 'USER80': '$USER80$', 'DOWNTIMEDATAFILE': '', 'USER89': '$USER89$', 'USER88': '$USER88$', 'USER174': '$USER174$', 'USER175': '$USER175$', 'USER176': '$USER176$', 'USER177': '$USER177$', 'USER170': '$USER170$', 'MAINCONFIGFILE': '', 'USER172': '$USER172$', 'USER173': '$USER173$', 'USER229': '$USER229$', 'USER178': '$USER178$', 'USER179': '$USER179$', 'USER206': '$USER206$', 'TEMPPATH': '', 'USER207': '$USER207$', 'USER225': '$USER225$', 'RETENTIONDATAFILE': '', 'USER142': '$USER142$', 'USER221': '$USER221$', 'USER141': '$USER141$', 'USER140': '$USER140$', 'USER143': '$USER143$', 'USER62': '$USER62$', 'USER145': '$USER145$', 'USER144': '$USER144$', 'USER147': '$USER147$', 'USER128': '$USER128$', 'USER149': '$USER149$', 'USER148': '$USER148$', 'RESOURCEFILE': '', 'USER146': '$USER146$', 'USER78': '$USER78$', 'USER79': '$USER79$', 'USER72': '$USER72$', 'USER73': '$USER73$', 'USER70': '$USER70$', 'USER71': '$USER71$', 'USER76': '$USER76$', 'USER77': '$USER77$', 'COMMENTDATAFILE': '', 'USER75': '$USER75$', 'STATUSDATAFILE': '', 'USER237': '$USER237$', 'USER205': '$USER205$', 'USER255': '$USER255$', 'USER254': '$USER254$', 'USER251': '$USER251$', 'USER250': '$USER250$', 'USER253': '$USER253$', 'USER252': '$USER252$', 'USER234': '$USER234$', 'USER158': '$USER158$', 'USER159': '$USER159$', 'USER156': '$USER156$', 'USER157': '$USER157$', 'USER154': '$USER154$', 'USER155': '$USER155$', 'USER152': '$USER152$', 'USER153': '$USER153$', 'USER150': '$USER150$', 'USER151': '$USER151$', 'USER69': '$USER69$', 'USER68': '$USER68$', 'USER61': '$USER61$', 'USER60': '$USER60$', 'USER63': '$USER63$', 'LOGFILE': '', 'USER65': '$USER65$', 'USER64': '$USER64$', 'USER67': '$USER67$', 'USER66': '$USER66$', 'USER138': '$USER138$', 'USER139': '$USER139$', 'USER132': '$USER132$', 'COMMANDFILE': 'command_file', 'USER242': '$USER242$', 'USER243': '$USER243$', 'USER240': '$USER240$', 'USER203': '$USER203$', 'USER246': '$USER246$', 'USER247': '$USER247$', 'USER244': '$USER244$', 'USER245': '$USER245$', 'USER233': '$USER233$', 'USER248': '$USER248$', 'USER249': '$USER249$', 'USER171': '$USER171$', 'USER54': '$USER54$', 'USER55': '$USER55$', 'USER56': '$USER56$', 'USER57': '$USER57$', 'USER50': '$USER50$', 'USER51': '$USER51$', 'USER52': '$USER52$', 'USER53': '$USER53$', 'TEMPFILE': '', 'USER122': '$USER122$', 'USER121': '$USER121$', 'USER120': '$USER120$', 'USER58': '$USER58$', 'USER59': '$USER59$', 'USER125': '$USER125$', 'USER124': '$USER124$', 'USER241': '$USER241$', 'SERVICEPERFDATAFILE': '', 'USER230': '$USER230$', 'USER123': '$USER123$', 'USER133': '$USER133$', 'USER201': '$USER201$', 'USER200': '$USER200$', 'USER202': '$USER202$', 'USER239': '$USER239$', 'USER238': '$USER238$', 'ADMINEMAIL': '', 'USER43': '$USER43$', 'USER42': '$USER42$', 'USER41': '$USER41$', 'USER40': '$USER40$', 'USER47': '$USER47$', 'USER46': '$USER46$', 'USER45': '$USER45$', 'USER44': '$USER44$', 'USER130': '$USER130$', 'USER131': '$USER131$', 'USER49': '$USER49$', 'USER48': '$USER48$', 'USER134': '$USER134$', 'USER135': '$USER135$', 'USER136': '$USER136$', 'USER137': '$USER137$', 'USER193': '$USER193$', 'USER167': '$USER167$', 'USER231': '$USER231$', 'USER189': '$USER189$', 'USER188': '$USER188$', 'USER166': '$USER166$', 'USER185': '$USER185$', 'USER184': '$USER184$', 'USER187': '$USER187$', 'USER186': '$USER186$', 'USER181': '$USER181$', 'USER129': '$USER129$', 'USER183': '$USER183$', 'USER182': '$USER182$', 'USER105': '$USER105$', 'USER104': '$USER104$', 'USER107': '$USER107$', 'USER106': '$USER106$', 'USER101': '$USER101$', 'USER100': '$USER100$', 'USER103': '$USER103$', 'USER102': '$USER102$', 'USER195': '$USER195$', 'USER109': '$USER109$', 'USER108': '$USER108$', 'USER224': '$USER224$', 'HOSTPERFDATAFILE': '', 'USER226': '$USER226$', 'USER227': '$USER227$', 'USER220': '$USER220$', 'USER208': '$USER208$', 'USER222': '$USER222$', 'USER223': '$USER223$', 'USER169': '$USER169$', 'USER209': '$USER209$', 'USER228': '$USER228$', 'USER110': '$USER110$', 'USER36': '$USER36$', 'USER37': '$USER37$', 'USER34': '$USER34$', 'USER35': '$USER35$', 'USER32': '$USER32$', 'USER33': '$USER33$', 'USER30': '$USER30$', 'USER31': '$USER31$', 'USER236': '$USER236$', 'USER116': '$USER116$', 'USER204': '$USER204$', 'USER38': '$USER38$', 'USER39': '$USER39$', 'USER198': '$USER198$', 'USER199': '$USER199$', 'USER180': '$USER180$', 'USER168': '$USER168$', 'USER192': '$USER192$', 'USER127': '$USER127$', 'USER190': '$USER190$', 'USER191': '$USER191$', 'USER196': '$USER196$', 'USER197': '$USER197$', 'USER194': '$USER194$', 'USER126': '$USER126$', 'USER112': '$USER112$', 'USER113': '$USER113$', 'PREFIX': 'prefix', 'USER111': '$USER111$', 'ADMINPAGER': '', 'USER117': '$USER117$', 'USER114': '$USER114$', 'USER115': '$USER115$', 'USER118': '$USER118$', 'USER119': '$USER119$', 'USER211': '$USER211$', 'USER210': '$USER210$', 'USER213': '$USER213$', 'USER212': '$USER212$', 'USER215': '$USER215$', 'USER214': '$USER214$', 'USER217': '$USER217$', 'USER216': '$USER216$', 'USER219': '$USER219$', 'USER218': '$USER218$', 'USER25': '$USER25$', 'USER24': '$USER24$', 'USER27': '$USER27$', 'USER26': '$USER26$', 'USER21': '$USER21$', 'USER20': '$USER20$', 'USER23': '$USER23$', 'USER22': '$USER22$', 'USER29': '$USER29$', 'USER28': '$USER28$', 'USER6': '$USER6$', 'USER7': '$USER7$', 'USER4': '$USER4$', 'USER5': '$USER5$', 'USER2': '$USER2$', 'USER3': '$USER3$', 'USER1': '$USER1$', 'OBJECTCACHEFILE': '', 'USER74': '$USER74$', 'USER8': '$USER8$', 'USER9': '$USER9$', 'USER232': '$USER232$', 'USER98': '$USER98$', 'USER99': '$USER99$', 'USER165': '$USER165$', 'USER164': '$USER164$', 'USER163': '$USER163$', 'USER162': '$USER162$', 'USER161': '$USER161$', 'USER160': '$USER160$', 'USER90': '$USER90$', 'USER91': '$USER91$', 'USER92': '$USER92$', 'USER93': '$USER93$', 'USER94': '$USER94$', 'USER95': '$USER95$', 'USER96': '$USER96$', 'USER97': '$USER97$', 'USER10': '$USER10$', 'USER11': '$USER11$', 'USER12': '$USER12$', 'USER13': '$USER13$', 'USER14': '$USER14$', 'USER15': '$USER15$', 'USER16': '$USER16$', 'USER17': '$USER17$', 'USER18': '$USER18$', 'USER19': '$USER19$'}
-
my_type = 'config'
-
notice_about_useless_parameters()[source]
Used to warn about useless parameter and print why it’s not use.
-
old_properties = {'nagios_group': 'alignak_group', 'modulesdir': 'modules_dir', 'nagios_user': 'alignak_user'}
-
override_properties()[source]
Wrapper for calling override_properties method of services attribute
-
prepare_for_sending()[source]
Some properties are dangerous to be send like that
like realms linked in hosts. Realms are too big to send (too linked)
We are also pre-serializing the confs so the sending phase will
be quicker.
-
propagate_timezone_option()[source]
Set our timezone value and give it too to unset satellites
-
properties = {'status_update_interval': <alignak.property.UnusedProp object at 0x7fd17a6cde10>, 'enable_predictive_service_dependency_checks': <alignak.property.BoolProp object at 0x7fd17a6d7cd0>, '$USER107$': <alignak.property.StringProp object at 0x7fd17a6f1f10>, '$USER160$': <alignak.property.StringProp object at 0x7fd17a67dc90>, '$USER69$': <alignak.property.StringProp object at 0x7fd17a6f1590>, 'statsd_prefix': <alignak.property.StringProp object at 0x7fd17a6e6390>, '$USER192$': <alignak.property.StringProp object at 0x7fd17a6864d0>, '$USER186$': <alignak.property.StringProp object at 0x7fd17a686350>, 'retained_contact_service_attribute_mask': <alignak.property.UnusedProp object at 0x7fd17a6d7550>, 'prefix': <alignak.property.StringProp object at 0x7fd17a6cd890>, 'local_log': <alignak.property.StringProp object at 0x7fd17a6cdc50>, '$USER124$': <alignak.property.StringProp object at 0x7fd17a67d390>, '$USER137$': <alignak.property.StringProp object at 0x7fd17a67d6d0>, '$USER36$': <alignak.property.StringProp object at 0x7fd17a6e6d10>, 'host_perfdata_file_processing_interval': <alignak.property.IntegerProp object at 0x7fd17a6df590>, 'alignak_user': <alignak.property.StringProp object at 0x7fd17a6cde50>, 'log_initial_states': <alignak.property.BoolProp object at 0x7fd17a6d76d0>, 'log_host_retries': <alignak.property.BoolProp object at 0x7fd17a6d7650>, '$USER74$': <alignak.property.StringProp object at 0x7fd17a6f16d0>, '$USER147$': <alignak.property.StringProp object at 0x7fd17a67d950>, '$USER188$': <alignak.property.StringProp object at 0x7fd17a6863d0>, '$USER21$': <alignak.property.StringProp object at 0x7fd17a6e6950>, '$USER252$': <alignak.property.StringProp object at 0x7fd17a690410>, 'notification_timeout': <alignak.property.IntegerProp object at 0x7fd17a6df150>, 'daemon_enabled': <alignak.property.BoolProp object at 0x7fd17a6dfcd0>, 'execute_service_checks': <alignak.property.BoolProp object at 0x7fd17a6cdf10>, 'disable_old_nagios_parameters_whining': <alignak.property.BoolProp object at 0x7fd17a6dfe50>, '$USER96$': <alignak.property.StringProp object at 0x7fd17a6f1c50>, '$USER152$': <alignak.property.StringProp object at 0x7fd17a67da90>, '$USER4$': <alignak.property.StringProp object at 0x7fd17a6e6510>, 'lock_file': <alignak.property.StringProp object at 0x7fd17a6d7290>, 'command_check_interval': <alignak.property.UnusedProp object at 0x7fd17a6d7150>, '$USER120$': <alignak.property.StringProp object at 0x7fd17a67d290>, 'max_host_check_spread': <alignak.property.IntegerProp object at 0x7fd17a6d7a90>, '$USER215$': <alignak.property.StringProp object at 0x7fd17a686a90>, '$USER244$': <alignak.property.StringProp object at 0x7fd17a690210>, '$USER175$': <alignak.property.StringProp object at 0x7fd17a686090>, 'timeout_exit_status': <alignak.property.IntegerProp object at 0x7fd17a6df0d0>, '$USER84$': <alignak.property.StringProp object at 0x7fd17a6f1950>, 'log_external_commands': <alignak.property.BoolProp object at 0x7fd17a6d7710>, 'retained_process_service_attribute_mask': <alignak.property.UnusedProp object at 0x7fd17a6d74d0>, '$USER56$': <alignak.property.StringProp object at 0x7fd17a6f1250>, '$USER119$': <alignak.property.StringProp object at 0x7fd17a67d250>, '$USER218$': <alignak.property.StringProp object at 0x7fd17a686b50>, 'debug_verbosity': <alignak.property.UnusedProp object at 0x7fd17a6dfbd0>, 'host_perfdata_file_template': <alignak.property.StringProp object at 0x7fd17a6df490>, 'log_archive_path': <alignak.property.StringProp object at 0x7fd17a6d70d0>, '$USER168$': <alignak.property.StringProp object at 0x7fd17a67de90>, 'check_for_orphaned_hosts': <alignak.property.BoolProp object at 0x7fd17a6df6d0>, '$USER99$': <alignak.property.StringProp object at 0x7fd17a6f1d10>, '$USER28$': <alignak.property.StringProp object at 0x7fd17a6e6b10>, 'ocsp_timeout': <alignak.property.IntegerProp object at 0x7fd17a6df190>, '$USER16$': <alignak.property.StringProp object at 0x7fd17a6e6810>, '$USER158$': <alignak.property.StringProp object at 0x7fd17a67dc10>, '$USER194$': <alignak.property.StringProp object at 0x7fd17a686550>, '$USER144$': <alignak.property.StringProp object at 0x7fd17a67d890>, '$USER110$': <alignak.property.StringProp object at 0x7fd17a6f1fd0>, '$USER199$': <alignak.property.StringProp object at 0x7fd17a686690>, '$USER30$': <alignak.property.StringProp object at 0x7fd17a6e6b90>, '$USER142$': <alignak.property.StringProp object at 0x7fd17a67d810>, '$USER135$': <alignak.property.StringProp object at 0x7fd17a67d650>, 'use_ssl': <alignak.property.BoolProp object at 0x7fd17a6dff10>, '$USER208$': <alignak.property.StringProp object at 0x7fd17a6868d0>, '$USER105$': <alignak.property.StringProp object at 0x7fd17a6f1e90>, 'max_check_result_file_age': <alignak.property.UnusedProp object at 0x7fd17a6d7a10>, '$USER145$': <alignak.property.StringProp object at 0x7fd17a67d8d0>, '$USER76$': <alignak.property.StringProp object at 0x7fd17a6f1750>, '$USER151$': <alignak.property.StringProp object at 0x7fd17a67da50>, '$USER60$': <alignak.property.StringProp object at 0x7fd17a6f1350>, 'enable_notifications': <alignak.property.BoolProp object at 0x7fd17a6cded0>, '$USER181$': <alignak.property.StringProp object at 0x7fd17a686210>, '$USER212$': <alignak.property.StringProp object at 0x7fd17a6869d0>, '$USER129$': <alignak.property.StringProp object at 0x7fd17a67d4d0>, 'broker_module': <alignak.property.StringProp object at 0x7fd17a6dfb10>, '$USER246$': <alignak.property.StringProp object at 0x7fd17a690290>, '$USER173$': <alignak.property.StringProp object at 0x7fd17a67dfd0>, '$USER122$': <alignak.property.StringProp object at 0x7fd17a67d310>, '$USER2$': <alignak.property.StringProp object at 0x7fd17a6e6490>, '$USER86$': <alignak.property.StringProp object at 0x7fd17a6f19d0>, 'log_rotation_method': <alignak.property.CharProp object at 0x7fd17a6d7090>, 'use_multiprocesses_serializer': <alignak.property.BoolProp object at 0x7fd17a6e6210>, '$USER230$': <alignak.property.StringProp object at 0x7fd17a686e50>, '$USER78$': <alignak.property.StringProp object at 0x7fd17a6f17d0>, 'perfdata_timeout': <alignak.property.IntegerProp object at 0x7fd17a6df210>, '$USER203$': <alignak.property.StringProp object at 0x7fd17a686790>, '$USER54$': <alignak.property.StringProp object at 0x7fd17a6f11d0>, '$USER221$': <alignak.property.StringProp object at 0x7fd17a686c10>, '$USER163$': <alignak.property.StringProp object at 0x7fd17a67dd50>, 'use_local_log': <alignak.property.BoolProp object at 0x7fd17a6cdbd0>, '$USER41$': <alignak.property.StringProp object at 0x7fd17a6e6e50>, '$USER11$': <alignak.property.StringProp object at 0x7fd17a6e66d0>, '$USER94$': <alignak.property.StringProp object at 0x7fd17a6f1bd0>, '$USER191$': <alignak.property.StringProp object at 0x7fd17a686490>, 'low_host_flap_threshold': <alignak.property.IntegerProp object at 0x7fd17a6d7f50>, 'obsess_over_services': <alignak.property.BoolProp object at 0x7fd17a6df250>, '$USER50$': <alignak.property.StringProp object at 0x7fd17a6f10d0>, 'config_base_dir': <alignak.property.StringProp object at 0x7fd17a6cdb50>, 'cached_service_check_horizon': <alignak.property.IntegerProp object at 0x7fd17a6d7d50>, 'host_freshness_check_interval': <alignak.property.IntegerProp object at 0x7fd17a6df7d0>, 'resource_file': <alignak.property.StringProp object at 0x7fd17a6cdd50>, '$USER14$': <alignak.property.StringProp object at 0x7fd17a6e6790>, '$USER127$': <alignak.property.StringProp object at 0x7fd17a67d450>, 'sleep_time': <alignak.property.UnusedProp object at 0x7fd17a6d7810>, '$USER196$': <alignak.property.StringProp object at 0x7fd17a6865d0>, 'service_freshness_check_interval': <alignak.property.IntegerProp object at 0x7fd17a6df750>, '$USER143$': <alignak.property.StringProp object at 0x7fd17a67d850>, '$USER164$': <alignak.property.StringProp object at 0x7fd17a67dd90>, 'high_service_flap_threshold': <alignak.property.IntegerProp object at 0x7fd17a6d7f10>, 'runners_timeout': <alignak.property.IntegerProp object at 0x7fd17a6e60d0>, '$USER140$': <alignak.property.StringProp object at 0x7fd17a67d790>, 'use_embedded_perl_implicitly': <alignak.property.BoolProp object at 0x7fd17a6df890>, '$USER71$': <alignak.property.StringProp object at 0x7fd17a6f1610>, 'bare_update_checks': <alignak.property.UnusedProp object at 0x7fd17a6d7250>, '$USER162$': <alignak.property.StringProp object at 0x7fd17a67dd10>, 'service_inter_check_delay_method': <alignak.property.UnusedProp object at 0x7fd17a6d7850>, '$USER239$': <alignak.property.StringProp object at 0x7fd17a6900d0>, '$USER153$': <alignak.property.StringProp object at 0x7fd17a67dad0>, 'check_external_commands': <alignak.property.BoolProp object at 0x7fd17a6d7110>, '$USER66$': <alignak.property.StringProp object at 0x7fd17a6f14d0>, '$USER9$': <alignak.property.StringProp object at 0x7fd17a6e6650>, 'secret': <alignak.property.StringProp object at 0x7fd17a6e6290>, 'resource_macros_names': <alignak.property.ListProp object at 0x7fd17a6dfed0>, '$USER241$': <alignak.property.StringProp object at 0x7fd17a690150>, '$USER12$': <alignak.property.StringProp object at 0x7fd17a6e6710>, '$USER39$': <alignak.property.StringProp object at 0x7fd17a6e6dd0>, 'server_cert': <alignak.property.StringProp object at 0x7fd17a6dff90>, '$USER80$': <alignak.property.StringProp object at 0x7fd17a6f1850>, '$USER149$': <alignak.property.StringProp object at 0x7fd17a67d9d0>, '$USER29$': <alignak.property.StringProp object at 0x7fd17a6e6b50>, 'log_passive_checks': <alignak.property.BoolProp object at 0x7fd17a6d7750>, '$USER77$': <alignak.property.StringProp object at 0x7fd17a6f1790>, 'check_service_freshness': <alignak.property.BoolProp object at 0x7fd17a6df710>, '$USER224$': <alignak.property.StringProp object at 0x7fd17a686cd0>, 'check_result_path': <alignak.property.UnusedProp object at 0x7fd17a6d79d0>, '$USER251$': <alignak.property.StringProp object at 0x7fd17a6903d0>, 'use_retained_program_state': <alignak.property.UnusedProp object at 0x7fd17a6d7390>, 'service_check_timeout': <alignak.property.IntegerProp object at 0x7fd17a6df050>, '$USER43$': <alignak.property.StringProp object at 0x7fd17a6e6ed0>, '$USER219$': <alignak.property.StringProp object at 0x7fd17a686b90>, 'free_child_process_memory': <alignak.property.UnusedProp object at 0x7fd17a6d7dd0>, '$USER171$': <alignak.property.StringProp object at 0x7fd17a67df50>, 'high_host_flap_threshold': <alignak.property.IntegerProp object at 0x7fd17a6d7f90>, 'server_key': <alignak.property.StringProp object at 0x7fd17a6dffd0>, '$USER48$': <alignak.property.StringProp object at 0x7fd17a6f1050>, '$USER89$': <alignak.property.StringProp object at 0x7fd17a6f1a90>, '$USER32$': <alignak.property.StringProp object at 0x7fd17a6e6c10>, 'accept_passive_host_checks': <alignak.property.BoolProp object at 0x7fd17a6cdfd0>, '$USER22$': <alignak.property.StringProp object at 0x7fd17a6e6990>, 'enable_event_handlers': <alignak.property.BoolProp object at 0x7fd17a6d7050>, '$USER46$': <alignak.property.StringProp object at 0x7fd17a6e6f90>, '$USER229$': <alignak.property.StringProp object at 0x7fd17a686e10>, 'no_event_handlers_during_downtimes': <alignak.property.BoolProp object at 0x7fd17a6dfdd0>, 'log_service_retries': <alignak.property.BoolProp object at 0x7fd17a6d7610>, 'retention_update_interval': <alignak.property.IntegerProp object at 0x7fd17a6d7350>, '$USER220$': <alignak.property.StringProp object at 0x7fd17a686bd0>, '$USER114$': <alignak.property.StringProp object at 0x7fd17a67d110>, '$USER254$': <alignak.property.StringProp object at 0x7fd17a690490>, 'cached_host_check_horizon': <alignak.property.IntegerProp object at 0x7fd17a6d7d10>, '$USER166$': <alignak.property.StringProp object at 0x7fd17a67de10>, '$USER161$': <alignak.property.StringProp object at 0x7fd17a67dcd0>, 'check_for_updates': <alignak.property.UnusedProp object at 0x7fd17a6d7210>, '$USER93$': <alignak.property.StringProp object at 0x7fd17a6f1b90>, '$USER101$': <alignak.property.StringProp object at 0x7fd17a6f1d90>, 'use_timezone': <alignak.property.StringProp object at 0x7fd17a6df910>, 'host_perfdata_file': <alignak.property.StringProp object at 0x7fd17a6df410>, '$USER63$': <alignak.property.StringProp object at 0x7fd17a6f1410>, '$USER154$': <alignak.property.StringProp object at 0x7fd17a67db10>, '$USER18$': <alignak.property.StringProp object at 0x7fd17a6e6890>, 'global_host_event_handler': <alignak.property.StringProp object at 0x7fd17a6d7790>, '$USER125$': <alignak.property.StringProp object at 0x7fd17a67d3d0>, 'flap_history': <alignak.property.IntegerProp object at 0x7fd17a6dfd50>, '$USER64$': <alignak.property.StringProp object at 0x7fd17a6f1450>, 'log_level': <alignak.property.LogLevelProp object at 0x7fd17a6cdc10>, '$USER13$': <alignak.property.StringProp object at 0x7fd17a6e6750>, '$USER52$': <alignak.property.StringProp object at 0x7fd17a6f1150>, 'max_concurrent_checks': <alignak.property.UnusedProp object at 0x7fd17a6d7910>, '$USER198$': <alignak.property.StringProp object at 0x7fd17a686650>, 'use_syslog': <alignak.property.BoolProp object at 0x7fd17a6d7590>, 'ochp_timeout': <alignak.property.IntegerProp object at 0x7fd17a6df1d0>, '$USER243$': <alignak.property.StringProp object at 0x7fd17a6901d0>, '$USER7$': <alignak.property.StringProp object at 0x7fd17a6e65d0>, '$USER204$': <alignak.property.StringProp object at 0x7fd17a6867d0>, 'obsess_over_hosts': <alignak.property.BoolProp object at 0x7fd17a6df2d0>, 'workdir': <alignak.property.StringProp object at 0x7fd17a6cdb10>, 'use_large_installation_tweaks': <alignak.property.UnusedProp object at 0x7fd17a6d7d90>, '$USER182$': <alignak.property.StringProp object at 0x7fd17a686250>, 'admin_pager': <alignak.property.UnusedProp object at 0x7fd17a6dfa90>, 'service_perfdata_file_template': <alignak.property.StringProp object at 0x7fd17a6df4d0>, 'retained_contact_host_attribute_mask': <alignak.property.UnusedProp object at 0x7fd17a6d7510>, 'enable_flap_detection': <alignak.property.BoolProp object at 0x7fd17a6d7e90>, '$USER98$': <alignak.property.StringProp object at 0x7fd17a6f1cd0>, 'max_check_result_reaper_time': <alignak.property.UnusedProp object at 0x7fd17a6d7990>, '$USER82$': <alignak.property.StringProp object at 0x7fd17a6f18d0>, '$USER130$': <alignak.property.StringProp object at 0x7fd17a67d510>, '$USER35$': <alignak.property.StringProp object at 0x7fd17a6e6cd0>, '$USER178$': <alignak.property.StringProp object at 0x7fd17a686150>, 'service_perfdata_file': <alignak.property.StringProp object at 0x7fd17a6df450>, '$USER146$': <alignak.property.StringProp object at 0x7fd17a67d910>, '$USER73$': <alignak.property.StringProp object at 0x7fd17a6f1690>, 'command_file': <alignak.property.StringProp object at 0x7fd17a6d7190>, '$USER193$': <alignak.property.StringProp object at 0x7fd17a686510>, 'use_regexp_matching': <alignak.property.BoolProp object at 0x7fd17a6df9d0>, '$USER213$': <alignak.property.StringProp object at 0x7fd17a686a10>, 'service_perfdata_file_mode': <alignak.property.CharProp object at 0x7fd17a6df550>, 'event_broker_options': <alignak.property.UnusedProp object at 0x7fd17a6dfad0>, 'service_perfdata_file_processing_command': <alignak.property.StringProp object at 0x7fd17a6df650>, '$USER37$': <alignak.property.StringProp object at 0x7fd17a6e6d50>, 'modules_dir': <alignak.property.StringProp object at 0x7fd17a6cdb90>, 'enable_problem_impacts_states_change': <alignak.property.BoolProp object at 0x7fd17a6dfe90>, '$USER88$': <alignak.property.StringProp object at 0x7fd17a6f1a50>, '$USER91$': <alignak.property.StringProp object at 0x7fd17a6f1b10>, '$USER185$': <alignak.property.StringProp object at 0x7fd17a686310>, '$USER245$': <alignak.property.StringProp object at 0x7fd17a690250>, 'log_notifications': <alignak.property.BoolProp object at 0x7fd17a6d75d0>, 'http_proxy': <alignak.property.StringProp object at 0x7fd17a6e62d0>, '$USER85$': <alignak.property.StringProp object at 0x7fd17a6f1990>, '$USER176$': <alignak.property.StringProp object at 0x7fd17a6860d0>, '$USER214$': <alignak.property.StringProp object at 0x7fd17a686a50>, 'webui_port': <alignak.property.IntegerProp object at 0x7fd17a6e6190>, 'debug_level': <alignak.property.UnusedProp object at 0x7fd17a6dfb90>, '$USER61$': <alignak.property.StringProp object at 0x7fd17a6f1390>, 'statsd_host': <alignak.property.StringProp object at 0x7fd17a6e6310>, '$USER209$': <alignak.property.StringProp object at 0x7fd17a686910>, '$USER116$': <alignak.property.StringProp object at 0x7fd17a67d190>, '$USER59$': <alignak.property.StringProp object at 0x7fd17a6f1310>, '$USER226$': <alignak.property.StringProp object at 0x7fd17a686d50>, 'check_for_orphaned_services': <alignak.property.BoolProp object at 0x7fd17a6df690>, 'human_timestamp_log': <alignak.property.BoolProp object at 0x7fd17a6e6090>, '$USER216$': <alignak.property.StringProp object at 0x7fd17a686ad0>, 'use_true_regexp_matching': <alignak.property.BoolProp object at 0x7fd17a6dfa10>, '$USER206$': <alignak.property.StringProp object at 0x7fd17a686850>, '$USER248$': <alignak.property.StringProp object at 0x7fd17a690310>, 'enable_embedded_perl': <alignak.property.BoolProp object at 0x7fd17a6df850>, '$USER5$': <alignak.property.StringProp object at 0x7fd17a6e6550>, '$USER180$': <alignak.property.StringProp object at 0x7fd17a6861d0>, '$USER189$': <alignak.property.StringProp object at 0x7fd17a686410>, '$USER159$': <alignak.property.StringProp object at 0x7fd17a67dc50>, '$USER104$': <alignak.property.StringProp object at 0x7fd17a6f1e50>, 'webui_lock_file': <alignak.property.StringProp object at 0x7fd17a6e6150>, '$USER68$': <alignak.property.StringProp object at 0x7fd17a6f1550>, '$USER51$': <alignak.property.StringProp object at 0x7fd17a6f1110>, '$USER195$': <alignak.property.StringProp object at 0x7fd17a686590>, 'host_perfdata_file_mode': <alignak.property.CharProp object at 0x7fd17a6df510>, 'hard_ssl_name_check': <alignak.property.BoolProp object at 0x7fd17a6e6050>, '$USER111$': <alignak.property.StringProp object at 0x7fd17a67d050>, 'host_perfdata_command': <alignak.property.StringProp object at 0x7fd17a6df390>, 'ocsp_command': <alignak.property.StringProp object at 0x7fd17a6df290>, 'state_retention_file': <alignak.property.StringProp object at 0x7fd17a6d7310>, '$USER136$': <alignak.property.StringProp object at 0x7fd17a67d690>, '$USER27$': <alignak.property.StringProp object at 0x7fd17a6e6ad0>, 'idontcareaboutsecurity': <alignak.property.BoolProp object at 0x7fd17a6dfc90>, '$USER42$': <alignak.property.StringProp object at 0x7fd17a6e6e90>, 'object_cache_file': <alignak.property.UnusedProp object at 0x7fd17a6cdcd0>, '$USER139$': <alignak.property.StringProp object at 0x7fd17a67d750>, 'statsd_enabled': <alignak.property.BoolProp object at 0x7fd17a6e63d0>, '$USER20$': <alignak.property.StringProp object at 0x7fd17a6e6910>, '$USER75$': <alignak.property.StringProp object at 0x7fd17a6f1710>, '$USER156$': <alignak.property.StringProp object at 0x7fd17a67db90>, 'retained_service_attribute_mask': <alignak.property.UnusedProp object at 0x7fd17a6d7450>, 'child_processes_fork_twice': <alignak.property.UnusedProp object at 0x7fd17a6d7e10>, '$USER128$': <alignak.property.StringProp object at 0x7fd17a67d490>, '$USER24$': <alignak.property.StringProp object at 0x7fd17a6e6a10>, 'use_retained_scheduling_info': <alignak.property.UnusedProp object at 0x7fd17a6d73d0>, '$USER97$': <alignak.property.StringProp object at 0x7fd17a6f1c90>, '$USER174$': <alignak.property.StringProp object at 0x7fd17a686050>, '$USER121$': <alignak.property.StringProp object at 0x7fd17a67d2d0>, 'process_performance_data': <alignak.property.BoolProp object at 0x7fd17a6df350>, '$USER87$': <alignak.property.StringProp object at 0x7fd17a6f1a10>, '$USER237$': <alignak.property.StringProp object at 0x7fd17a690050>, '$USER247$': <alignak.property.StringProp object at 0x7fd17a6902d0>, '$USER118$': <alignak.property.StringProp object at 0x7fd17a67d210>, '$USER57$': <alignak.property.StringProp object at 0x7fd17a6f1290>, 'max_plugins_output_length': <alignak.property.IntegerProp object at 0x7fd17a6dfd90>, '$USER238$': <alignak.property.StringProp object at 0x7fd17a690090>, '$USER103$': <alignak.property.StringProp object at 0x7fd17a6f1e10>, '$USER106$': <alignak.property.StringProp object at 0x7fd17a6f1ed0>, '$USER201$': <alignak.property.StringProp object at 0x7fd17a686710>, '$USER169$': <alignak.property.StringProp object at 0x7fd17a67ded0>, '$USER47$': <alignak.property.StringProp object at 0x7fd17a6e6fd0>, 'log_event_handlers': <alignak.property.BoolProp object at 0x7fd17a6d7690>, '$USER200$': <alignak.property.StringProp object at 0x7fd17a6866d0>, '$USER236$': <alignak.property.StringProp object at 0x7fd17a686fd0>, '$USER227$': <alignak.property.StringProp object at 0x7fd17a686d90>, '$USER17$': <alignak.property.StringProp object at 0x7fd17a6e6850>, 'enable_predictive_host_dependency_checks': <alignak.property.BoolProp object at 0x7fd17a6d7c90>, '$USER222$': <alignak.property.StringProp object at 0x7fd17a686c50>, 'ochp_command': <alignak.property.StringProp object at 0x7fd17a6df310>, 'service_perfdata_file_processing_interval': <alignak.property.IntegerProp object at 0x7fd17a6df5d0>, '$USER148$': <alignak.property.StringProp object at 0x7fd17a67d990>, '$USER197$': <alignak.property.StringProp object at 0x7fd17a686610>, '$USER113$': <alignak.property.StringProp object at 0x7fd17a67d0d0>, 'host_perfdata_file_processing_command': <alignak.property.StringProp object at 0x7fd17a6df610>, '$USER134$': <alignak.property.StringProp object at 0x7fd17a67d610>, 'check_host_freshness': <alignak.property.BoolProp object at 0x7fd17a6df790>, '$USER31$': <alignak.property.StringProp object at 0x7fd17a6e6bd0>, '$USER70$': <alignak.property.StringProp object at 0x7fd17a6f15d0>, 'passive_host_checks_are_soft': <alignak.property.BoolProp object at 0x7fd17a6d7c50>, '$USER250$': <alignak.property.StringProp object at 0x7fd17a690390>, '$USER102$': <alignak.property.StringProp object at 0x7fd17a6f1dd0>, '$USER25$': <alignak.property.StringProp object at 0x7fd17a6e6a50>, '$USER45$': <alignak.property.StringProp object at 0x7fd17a6e6f50>, 'max_service_check_spread': <alignak.property.IntegerProp object at 0x7fd17a6d7890>, '$USER67$': <alignak.property.StringProp object at 0x7fd17a6f1510>, 'execute_host_checks': <alignak.property.BoolProp object at 0x7fd17a6cdf90>, '$USER150$': <alignak.property.StringProp object at 0x7fd17a67da10>, '$USER187$': <alignak.property.StringProp object at 0x7fd17a686390>, 'debug_file': <alignak.property.UnusedProp object at 0x7fd17a6dfb50>, 'api_key': <alignak.property.StringProp object at 0x7fd17a6e6250>, '$USER255$': <alignak.property.StringProp object at 0x7fd17a6904d0>, '$USER38$': <alignak.property.StringProp object at 0x7fd17a6e6d90>, 'temp_file': <alignak.property.UnusedProp object at 0x7fd17a6cdd90>, '$USER81$': <alignak.property.StringProp object at 0x7fd17a6f1890>, '$USER172$': <alignak.property.StringProp object at 0x7fd17a67df90>, 'accept_passive_service_checks': <alignak.property.BoolProp object at 0x7fd17a6cdf50>, '$USER133$': <alignak.property.StringProp object at 0x7fd17a67d5d0>, '$USER202$': <alignak.property.StringProp object at 0x7fd17a686750>, '$USER1$': <alignak.property.StringProp object at 0x7fd17a6e6450>, '$USER231$': <alignak.property.StringProp object at 0x7fd17a686e90>, '$USER126$': <alignak.property.StringProp object at 0x7fd17a67d410>, '$USER79$': <alignak.property.StringProp object at 0x7fd17a6f1810>, '$USER95$': <alignak.property.StringProp object at 0x7fd17a6f1c10>, '$USER123$': <alignak.property.StringProp object at 0x7fd17a67d350>, '$USER40$': <alignak.property.StringProp object at 0x7fd17a6e6e10>, '$USER49$': <alignak.property.StringProp object at 0x7fd17a6f1090>, '$USER112$': <alignak.property.StringProp object at 0x7fd17a67d090>, '$USER3$': <alignak.property.StringProp object at 0x7fd17a6e64d0>, '$USER249$': <alignak.property.StringProp object at 0x7fd17a690350>, 'alignak_group': <alignak.property.StringProp object at 0x7fd17a6cde90>, '$USER15$': <alignak.property.StringProp object at 0x7fd17a6e67d0>, '$USER225$': <alignak.property.StringProp object at 0x7fd17a686d10>, 'low_service_flap_threshold': <alignak.property.IntegerProp object at 0x7fd17a6d7ed0>, '$USER228$': <alignak.property.StringProp object at 0x7fd17a686dd0>, 'host_inter_check_delay_method': <alignak.property.UnusedProp object at 0x7fd17a6d7a50>, 'daemon_thread_pool_size': <alignak.property.IntegerProp object at 0x7fd17a6dfd10>, '$USER115$': <alignak.property.StringProp object at 0x7fd17a67d150>, '$USER232$': <alignak.property.StringProp object at 0x7fd17a686ed0>, 'retained_process_host_attribute_mask': <alignak.property.UnusedProp object at 0x7fd17a6d7490>, 'service_perfdata_command': <alignak.property.StringProp object at 0x7fd17a6df3d0>, '$USER92$': <alignak.property.StringProp object at 0x7fd17a6f1b50>, '$USER183$': <alignak.property.StringProp object at 0x7fd17a686290>, '$USER165$': <alignak.property.StringProp object at 0x7fd17a67ddd0>, '$USER23$': <alignak.property.StringProp object at 0x7fd17a6e69d0>, '$USER72$': <alignak.property.StringProp object at 0x7fd17a6f1650>, '$USER155$': <alignak.property.StringProp object at 0x7fd17a67db50>, '$USER100$': <alignak.property.StringProp object at 0x7fd17a6f1d50>, '$USER184$': <alignak.property.StringProp object at 0x7fd17a6862d0>, 'additional_freshness_latency': <alignak.property.IntegerProp object at 0x7fd17a6df810>, '$USER44$': <alignak.property.StringProp object at 0x7fd17a6e6f10>, 'date_format': <alignak.property.StringProp object at 0x7fd17a6df8d0>, 'service_interleave_factor': <alignak.property.UnusedProp object at 0x7fd17a6d78d0>, '$USER210$': <alignak.property.StringProp object at 0x7fd17a686950>, 'cleaning_queues_interval': <alignak.property.IntegerProp object at 0x7fd17a6dfe10>, '$USER65$': <alignak.property.StringProp object at 0x7fd17a6f1490>, 'webui_host': <alignak.property.StringProp object at 0x7fd17a6e61d0>, 'statsd_port': <alignak.property.IntegerProp object at 0x7fd17a6e6350>, 'translate_passive_host_checks': <alignak.property.BoolProp object at 0x7fd17a6d7c10>, '$USER55$': <alignak.property.StringProp object at 0x7fd17a6f1210>, '$USER211$': <alignak.property.StringProp object at 0x7fd17a686990>, 'auto_rescheduling_interval': <alignak.property.IntegerProp object at 0x7fd17a6d7b50>, '$USER8$': <alignak.property.StringProp object at 0x7fd17a6e6610>, 'admin_email': <alignak.property.UnusedProp object at 0x7fd17a6dfa50>, '$USER205$': <alignak.property.StringProp object at 0x7fd17a686810>, '$USER233$': <alignak.property.StringProp object at 0x7fd17a686f10>, '$USER131$': <alignak.property.StringProp object at 0x7fd17a67d550>, 'soft_state_dependencies': <alignak.property.BoolProp object at 0x7fd17a6d7fd0>, '$USER109$': <alignak.property.StringProp object at 0x7fd17a6f1f90>, '$USER223$': <alignak.property.StringProp object at 0x7fd17a686c90>, '$USER207$': <alignak.property.StringProp object at 0x7fd17a686890>, '$USER235$': <alignak.property.StringProp object at 0x7fd17a686f90>, 'illegal_object_name_chars': <alignak.property.StringProp object at 0x7fd17a6df950>, '$USER170$': <alignak.property.StringProp object at 0x7fd17a67df10>, 'auto_reschedule_checks': <alignak.property.BoolProp object at 0x7fd17a6d7b10>, '$USER34$': <alignak.property.StringProp object at 0x7fd17a6e6c90>, 'interval_length': <alignak.property.IntegerProp object at 0x7fd17a6d7ad0>, '$USER83$': <alignak.property.StringProp object at 0x7fd17a6f1910>, 'host_check_timeout': <alignak.property.IntegerProp object at 0x7fd17a6df090>, 'modified_attributes': <alignak.property.IntegerProp object at 0x7fd17a6dfc50>, '$USER253$': <alignak.property.StringProp object at 0x7fd17a690450>, '$USER132$': <alignak.property.StringProp object at 0x7fd17a67d590>, 'retain_state_information': <alignak.property.UnusedProp object at 0x7fd17a6d72d0>, '$USER179$': <alignak.property.StringProp object at 0x7fd17a686190>, 'auto_rescheduling_window': <alignak.property.IntegerProp object at 0x7fd17a6d7b90>, '$USER33$': <alignak.property.StringProp object at 0x7fd17a6e6c50>, 'external_command_buffer_slots': <alignak.property.UnusedProp object at 0x7fd17a6d71d0>, '$USER141$': <alignak.property.StringProp object at 0x7fd17a67d7d0>, 'event_handler_timeout': <alignak.property.IntegerProp object at 0x7fd17a6df110>, '$USER240$': <alignak.property.StringProp object at 0x7fd17a690110>, '$USER190$': <alignak.property.StringProp object at 0x7fd17a686450>, '$USER26$': <alignak.property.StringProp object at 0x7fd17a6e6a90>, 'enable_environment_macros': <alignak.property.BoolProp object at 0x7fd17a6d7e50>, 'global_service_event_handler': <alignak.property.StringProp object at 0x7fd17a6d77d0>, 'max_debug_file_size': <alignak.property.UnusedProp object at 0x7fd17a6dfc10>, '$USER167$': <alignak.property.StringProp object at 0x7fd17a67de50>, 'ca_cert': <alignak.property.StringProp object at 0x7fd17a6dff50>, 'precached_object_file': <alignak.property.UnusedProp object at 0x7fd17a6cdd10>, '$USER90$': <alignak.property.StringProp object at 0x7fd17a6f1ad0>, '$USER242$': <alignak.property.StringProp object at 0x7fd17a690190>, '$USER177$': <alignak.property.StringProp object at 0x7fd17a686110>, 'pack_distribution_file': <alignak.property.StringProp object at 0x7fd17a6e6110>, '$USER157$': <alignak.property.StringProp object at 0x7fd17a67dbd0>, 'check_result_reaper_frequency': <alignak.property.UnusedProp object at 0x7fd17a6d7950>, '$USER19$': <alignak.property.StringProp object at 0x7fd17a6e68d0>, '$USER62$': <alignak.property.StringProp object at 0x7fd17a6f13d0>, 'status_file': <alignak.property.UnusedProp object at 0x7fd17a6cddd0>, '$USER108$': <alignak.property.StringProp object at 0x7fd17a6f1f50>, '$USER58$': <alignak.property.StringProp object at 0x7fd17a6f12d0>, '$USER117$': <alignak.property.StringProp object at 0x7fd17a67d1d0>, '$USER10$': <alignak.property.StringProp object at 0x7fd17a6e6690>, 'log_file': <alignak.property.UnusedProp object at 0x7fd17a6cdc90>, 'illegal_macro_output_chars': <alignak.property.StringProp object at 0x7fd17a6df990>, 'use_aggressive_host_checking': <alignak.property.BoolProp object at 0x7fd17a6d7bd0>, '$USER53$': <alignak.property.StringProp object at 0x7fd17a6f1190>, '$USER217$': <alignak.property.StringProp object at 0x7fd17a686b10>, '$USER138$': <alignak.property.StringProp object at 0x7fd17a67d710>, '$USER234$': <alignak.property.StringProp object at 0x7fd17a686f50>, '$USER6$': <alignak.property.StringProp object at 0x7fd17a6e6590>, 'retained_host_attribute_mask': <alignak.property.UnusedProp object at 0x7fd17a6d7410>}
-
read_config(files)[source]
Read and parse main configuration files
(specified with -c option to the Arbiter)
and put them into a StringIO object
Parameters: | files (list) – list of file to read |
Returns: | a buffer containing all files |
Return type: | str |
-
read_config_buf(buf)[source]
The config buffer (previously returned by Config.read_config())
Parameters: | buf (str) – buffer containing all data from config files |
Returns: | dict of alignak objects with the following structure |
- { type1 : [{key: value, ..}, {..}],
- type2 : [ ... ]
}
Example
{ 'host' : [{'host_name': 'myhostname', ..}, {..}],
‘service’ : [ ... ]
}
Values are all str for now. It is pythonized at object creation
-
read_config_silent = 0
-
remove_exclusions()[source]
Removes service exceptions based on host configuration
:return:None
-
remove_templates()[source]
Clean useless elements like templates because they are not needed anymore
-
show_errors()[source]
Loop over configuration_errors and log them
-
types_creations = {'macromodulation': (<class 'alignak.objects.macromodulation.MacroModulation'>, <class 'alignak.objects.macromodulation.MacroModulations'>, 'macromodulations', True), 'escalation': (<class 'alignak.objects.escalation.Escalation'>, <class 'alignak.objects.escalation.Escalations'>, 'escalations', True), 'notificationway': (<class 'alignak.objects.notificationway.NotificationWay'>, <class 'alignak.objects.notificationway.NotificationWays'>, 'notificationways', True), 'module': (<class 'alignak.objects.module.Module'>, <class 'alignak.objects.module.Modules'>, 'modules', True), 'hostextinfo': (<class 'alignak.objects.hostextinfo.HostExtInfo'>, <class 'alignak.objects.hostextinfo.HostsExtInfo'>, 'hostsextinfo', True), 'serviceescalation': (<class 'alignak.objects.serviceescalation.Serviceescalation'>, <class 'alignak.objects.serviceescalation.Serviceescalations'>, 'serviceescalations', False), 'resultmodulation': (<class 'alignak.objects.resultmodulation.Resultmodulation'>, <class 'alignak.objects.resultmodulation.Resultmodulations'>, 'resultmodulations', True), 'businessimpactmodulation': (<class 'alignak.objects.businessimpactmodulation.Businessimpactmodulation'>, <class 'alignak.objects.businessimpactmodulation.Businessimpactmodulations'>, 'businessimpactmodulations', True), 'poller': (<class 'alignak.objects.pollerlink.PollerLink'>, <class 'alignak.objects.pollerlink.PollerLinks'>, 'pollers', True), 'servicegroup': (<class 'alignak.objects.servicegroup.Servicegroup'>, <class 'alignak.objects.servicegroup.Servicegroups'>, 'servicegroups', True), 'servicedependency': (<class 'alignak.objects.servicedependency.Servicedependency'>, <class 'alignak.objects.servicedependency.Servicedependencies'>, 'servicedependencies', True), 'realm': (<class 'alignak.objects.realm.Realm'>, <class 'alignak.objects.realm.Realms'>, 'realms', True), 'service': (<class 'alignak.objects.service.Service'>, <class 'alignak.objects.service.Services'>, 'services', False), 'contactgroup': (<class 'alignak.objects.contactgroup.Contactgroup'>, <class 'alignak.objects.contactgroup.Contactgroups'>, 'contactgroups', True), 'reactionner': (<class 'alignak.objects.reactionnerlink.ReactionnerLink'>, <class 'alignak.objects.reactionnerlink.ReactionnerLinks'>, 'reactionners', True), 'serviceextinfo': (<class 'alignak.objects.serviceextinfo.ServiceExtInfo'>, <class 'alignak.objects.serviceextinfo.ServicesExtInfo'>, 'servicesextinfo', True), 'timeperiod': (<class 'alignak.objects.timeperiod.Timeperiod'>, <class 'alignak.objects.timeperiod.Timeperiods'>, 'timeperiods', True), 'hostescalation': (<class 'alignak.objects.hostescalation.Hostescalation'>, <class 'alignak.objects.hostescalation.Hostescalations'>, 'hostescalations', False), 'hostdependency': (<class 'alignak.objects.hostdependency.Hostdependency'>, <class 'alignak.objects.hostdependency.Hostdependencies'>, 'hostdependencies', True), 'broker': (<class 'alignak.objects.brokerlink.BrokerLink'>, <class 'alignak.objects.brokerlink.BrokerLinks'>, 'brokers', True), 'host': (<class 'alignak.objects.host.Host'>, <class 'alignak.objects.host.Hosts'>, 'hosts', True), 'arbiter': (<class 'alignak.objects.arbiterlink.ArbiterLink'>, <class 'alignak.objects.arbiterlink.ArbiterLinks'>, 'arbiters', True), 'checkmodulation': (<class 'alignak.objects.checkmodulation.CheckModulation'>, <class 'alignak.objects.checkmodulation.CheckModulations'>, 'checkmodulations', True), 'scheduler': (<class 'alignak.objects.schedulerlink.SchedulerLink'>, <class 'alignak.objects.schedulerlink.SchedulerLinks'>, 'schedulers', True), 'hostgroup': (<class 'alignak.objects.hostgroup.Hostgroup'>, <class 'alignak.objects.hostgroup.Hostgroups'>, 'hostgroups', True), 'contact': (<class 'alignak.objects.contact.Contact'>, <class 'alignak.objects.contact.Contacts'>, 'contacts', True), 'command': (<class 'alignak.objects.command.Command'>, <class 'alignak.objects.command.Commands'>, 'commands', True), 'receiver': (<class 'alignak.objects.receiverlink.ReceiverLink'>, <class 'alignak.objects.receiverlink.ReceiverLinks'>, 'receivers', True)}
-
warn_about_unmanaged_parameters()[source]
used to raise warning if the user got parameter
that we do not manage from now
alignak.objects.escalation module
This module provides Escalation and Escalations classes that
implements escalation for notification. Basically used for parsing.
-
class alignak.objects.escalation.Escalation(params={})[source]
Bases: alignak.objects.item.Item
Escalation class is used to implement notification escalation
-
get_name()[source]
Accessor to escalation_name attribute
Returns: | escalation name |
Return type: | str |
-
get_next_notif_time(t_wished, status, creation_time, interval)[source]
Get the next notification time for the escalation
Only legit for time based escalation
Parameters: |
- t_wished – time we would like to send a new notification (usually now)
- status – status of the host or service
- creation_time – time the notification was created
- interval (int) – time interval length
|
Returns: | timestamp for next notification or None
|
Return type: | int | None
|
-
is_correct()[source]
Check if all elements got a good configuration
Returns: | True if the configuration is correct, otherwise False |
Return type: | bool |
-
is_eligible(timestamp, status, notif_number, in_notif_time, interval)[source]
Check if the escalation is eligible (notification is escalated or not)
Escalation is NOT eligible in ONE of the following condition is fulfilled:
* escalation is not time based and notification number not in range
[first_notification;last_notification] (if last_notif == 0, it’s infinity)
- escalation is time based and notification time not in range
[first_notification_time;last_notification_time] (if last_notif_time == 0, it’s infinity)
- status does not matches escalation_options (‘WARNING’ <=> ‘w’ ...)
- escalation_period is not legit for this time (now usually)
Parameters: |
- timestamp (int) – timestamp to check if timeperiod is valid
- status (str) – item status (one of the small_states key)
- notif_number (int) – current notification number
- in_notif_time (int) – current notification time
- interval (int) – time interval length
|
Returns: | True if no condition has been fulfilled, otherwise False
|
Return type: | bool
|
-
my_type = 'escalation'
-
properties = {'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'last_notification': <alignak.property.IntegerProp object at 0x7fd17a794ad0>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'contacts': <alignak.property.ListProp object at 0x7fd17a794c50>, 'last_notification_time': <alignak.property.IntegerProp object at 0x7fd17a794b50>, 'escalation_options': <alignak.property.ListProp object at 0x7fd17a794c10>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'contact_groups': <alignak.property.ListProp object at 0x7fd17a794c90>, 'escalation_name': <alignak.property.StringProp object at 0x7fd17a794a10>, 'escalation_period': <alignak.property.StringProp object at 0x7fd17a794bd0>, 'first_notification_time': <alignak.property.IntegerProp object at 0x7fd17a794b10>, 'first_notification': <alignak.property.IntegerProp object at 0x7fd17a794a90>, 'notification_interval': <alignak.property.IntegerProp object at 0x7fd17a794b90>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>}
-
running_properties = {'configuration_errors': <alignak.property.ListProp object at 0x7fd17a819690>, 'time_based': <alignak.property.BoolProp object at 0x7fd17a794cd0>, 'configuration_warnings': <alignak.property.ListProp object at 0x7fd17a819650>, 'tags': <alignak.property.ListProp object at 0x7fd17a8196d0>}
-
special_properties = ('contacts', 'contact_groups', 'first_notification_time', 'last_notification_time')
-
special_properties_time_based = ('contacts', 'contact_groups', 'first_notification', 'last_notification')
-
class alignak.objects.escalation.Escalations(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Escalations manage a list of Escalation objects, used for parsing configuration
-
add_escalation(escalation)[source]
Wrapper for add_item method
-
explode(hosts, hostgroups, contactgroups)[source]
Loop over all escalation and explode hostsgroups in host
and contactgroups in contacts
Call Item.explode_host_groups_into_hosts and Item.explode_contact_groups_into_contacts
-
inner_class
alias of Escalation
-
linkify(timeperiods, contacts, services, hosts)[source]
Create link between objects:
* escalation -> host
* escalation -> service
* escalation -> timeperiods
* escalation -> contact
-
linkify_es_by_h(hosts)[source]
Add each escalation object into host.escalation attribute
-
linkify_es_by_s(services)[source]
Add each escalation object into service.escalation attribute
-
name_property = 'escalation_name'
alignak.objects.host module
This is the main class for the Host. In fact it’s mainly
about the configuration part. for the running one, it’s better
to look at the schedulingitem class that manage all
scheduling/consume check smart things :)
-
class alignak.objects.host.Host(params={})[source]
Bases: alignak.objects.schedulingitem.SchedulingItem
Host class implements monitoring concepts for host.
For example it defines parents, check_interval, check_command etc.
-
acknowledgement
-
acknowledgement_type
-
act_depend_of
-
act_depend_of_me
-
action_url
-
actions
-
active_checks_enabled
-
add_business_rule_act_dependency(host, status, timeperiod, inherits_parent)[source]
Add business act_dependency between two hosts.
Parameters: |
- host (alignak.objects.host.Host) – other host we want to add the dependency
- status (list) – notification failure criteria, notification for a dependent host may vary
- timeperiod (alignak.objects.timeperiod.Timeperiod) – dependency period. Timeperiod for dependency may vary
- inherits_parent (bool) – if this dep will inherit from parents (timeperiod, status)
|
Returns: | None
|
TODO: Function seems to be asymmetric, (obj1.call1 , obj2.call1, obj2.call2)
-
add_host_act_dependency(host, status, timeperiod, inherits_parent)[source]
Add logical act_dependency between two hosts.
Parameters: |
- host (alignak.objects.host.Host) – other host we want to add the dependency
- status (list) – notification failure criteria, notification for a dependent host may vary
- timeperiod (alignak.objects.timeperiod.Timeperiod) – dependency period. Timeperiod for dependency may vary
- inherits_parent (bool) – if this dep will inherit from parents (timeperiod, status)
|
Returns: | None
|
- TODO: Host object should not handle other host obj.
- We should call obj.add_* on both obj.
This is ‘Java’ style
TODO: Function seems to be asymmetric, (obj1.call1 , obj2.call1, obj2.call2)
-
add_host_chk_dependency(host, status, timeperiod, inherits_parent)[source]
Add logic chk_dependency between two hosts.
Parameters: |
- host (alignak.objects.host.Host) – other host we want to add the dependency
- status (list) – notification failure criteria, notification for a dependent host may vary
- timeperiod (alignak.objects.timeperiod.Timeperiod) – dependency period. Timeperiod for dependency may vary
- inherits_parent (bool) – if this dep will inherit from parents (timeperiod, status)
|
Returns: | None
|
TODO: Function seems to be asymmetric, (obj1.call1 , obj2.call1, obj2.call2)
-
add_service_link(service)[source]
Add a service to the service list of this host
-
address
-
alias
-
attempt
-
broks
-
business_impact
-
business_impact_modulations
-
business_rule
-
business_rule_downtime_as_ack
-
business_rule_host_notification_options
-
business_rule_output_template
-
business_rule_service_notification_options
-
business_rule_smart_notifications
-
check_command
-
check_flapping_recovery_notification
-
check_freshness
-
check_interval
-
check_period
-
check_type
-
checkmodulations
-
checks_in_progress
-
child_dependencies
-
childs
-
chk_depend_of
-
chk_depend_of_me
-
configuration_errors
-
configuration_warnings
-
contact_groups
-
contacts
-
current_event_id
-
current_notification_id
-
current_notification_number
-
current_problem_id
-
custom_views
-
customs
-
definition_order
-
del_host_act_dependency(other)[source]
Remove act_dependency between two hosts.
- TODO: Host object should not handle other host obj.
- We should call obj.del_* on both obj.
This is ‘Java’ style
-
display_name
-
downtimes
-
duration_sec
-
early_timeout
-
end_time
-
escalations
-
event_handler
-
event_handler_enabled
-
execution_time
-
failure_prediction_enabled
-
fill_parents_dependency()[source]
Add network act_dependency for each parent of this host.
This dependency is always effective (No timeperiod and all states) and inherits from parent
- TODO: Host object should not handle other host obj.
- We should call obj._fun_ on both obj.
This is ‘Java’ style
-
fill_predictive_missing_parameters()[source]
Fill address with host_name if not already set
and define state with initial_state
-
find_service_by_name(service_description)[source]
Get a service object from this host
Parameters: | service_description – service_description of the service we want |
Returns: | service with service.service_description == service_description |
Return type: | alignak.objects.service.Services | None |
-
first_notification_delay
-
flap_detection_enabled
-
flap_detection_options
-
flapping_changes
-
freshness_threshold
-
get_ack_author_name()[source]
Get the author of the acknowledgement
Returns: | author |
Return type: | str |
TODO: use getattr(self.acknowledgement, “author”, ‘’) instead
TODO: Move to util or SchedulingItem class
Get the comment of the acknowledgement
Returns: | comment |
Return type: | str |
TODO: use getattr(self.acknowledgement, “comment”, ‘’) instead
-
get_check_command()[source]
Wrapper to get the name of the check_command attribute
Returns: | check_command name |
Return type: | str |
-
get_data_for_checks()[source]
Get data for a check
Returns: | list containing a single host (this one) |
Return type: | list |
-
get_data_for_event_handler()[source]
Get data for an event handler
Returns: | list containing a single host (this one) |
Return type: | list |
-
get_data_for_notifications(contact, notif)[source]
Get data for a notification
Parameters: |
- contact – The contact to return
- notif – the notification to return
|
Returns: | list containing a the host and the given parameters
|
Return type: | list
|
-
get_dbg_name()[source]
Accessor to host_name attribute
Returns: | host_name |
Return type: | str |
-
get_downtime()[source]
Accessor to scheduled_downtime_depth attribue
Returns: | scheduled downtime depth |
Return type: | str |
TODO: Move to util or SchedulingItem class
-
get_duration()[source]
Get duration formatted
Format is : “HHh MMm SSs”
Example : “10h 20m 40s”
Returns: | Formatted duration |
Return type: | str |
-
get_duration_sec()[source]
Get duration in seconds. (cast it before returning)
Returns: | duration in seconds |
Return type: | int |
TODO: Move to util or SchedulingItem class
-
get_full_name()[source]
Accessor to host_name attribute
Returns: | host_name |
Return type: | str |
-
get_groupname()[source]
Get alias of the host’s hostgroup
Returns: | host group name |
Return type: | str |
TODO: Clean this. It returns the last hostgroup encountered
-
get_groupnames()[source]
Get aliases of the host’s hostgroups
Returns: | comma separated aliases of hostgroups |
Return type: | str |
-
get_host_tags()[source]
Accessor to tags attribute
Returns: | tag list of host |
Return type: | list |
-
get_hostgroups()[source]
Accessor to hostgroups attribute
Returns: | hostgroup list object of host |
Return type: | list |
-
get_name()[source]
Get the host name.
Try several attributes before returning UNNAMED*
Returns: | The name of the host |
Return type: | str |
-
get_obsessive_compulsive_processor_command()[source]
Create action for obsessive compulsive commands if such option is enabled
-
get_realm()[source]
Accessor to realm attribute
Returns: | realm object of host |
Return type: | alignak.objects.realm.Realm |
-
get_services()[source]
Get all services for this host
Returns: | list of services |
Return type: | list |
-
get_short_status()[source]
Get the short status of this host
Returns: | “U”, “D”, “N” or “n/a” based on host state_id or business_rule state |
Return type: | str |
-
get_status()[source]
Get the status of this host
Returns: | “UP”, “DOWN”, “UNREACHABLE” or “n/a” based on host state_id or business_rule state |
Return type: | str |
-
get_total_services()[source]
Get the number of services for this host
Returns: | service list length |
Return type: | str |
-
get_total_services_critical(s)
-
get_total_services_ok(s)
-
get_total_services_unknown(s)
-
get_total_services_warning(s)
-
got_business_rule
-
got_default_realm
-
has_been_checked
-
high_flap_threshold
-
host_name
-
hostgroups
-
i = 31
-
icon_image
-
icon_image_alt
-
icon_set
-
impacts
-
imported_from
-
in_checking
-
in_hard_unknown_reach_phase
-
in_maintenance
-
in_scheduled_downtime
-
in_scheduled_downtime_during_last_check
-
initial_state
-
is_correct()[source]
Check if this host configuration is correct
* All required parameter are specified
* Go through all configuration warnings and errors that could have been raised earlier
Returns: | True if the configuration is correct, otherwise False |
Return type: | bool |
-
is_excluded_for(service)[source]
Check whether this host should have the passed service be “excluded” or “not included”.
An host can define service_includes and/or service_excludes directive to either
white-list-only or black-list some services from itself.
-
is_excluded_for_sdesc(sdesc, is_tpl=False)[source]
- Check whether this host should have the passed service description
- be “excluded” or “not included”.
Parameters: |
- sdesc – service description
- is_tpl (bool) – True if service is template, otherwise False
|
Returns: | True if service description excluded, otherwise False
|
Return type: | bool
|
-
is_flapping
-
is_impact
-
is_linked_with_host(other)[source]
Check if other is in act_depend_of host attribute
Parameters: | other (alignak.objects.host.Host) – other host to search |
Returns: | True if other in act_depend_of list, otherwise False |
Return type: | bool |
-
is_problem
-
is_state(status)[source]
Return if status match the current host status
Parameters: | status (str) – status to compare ( “o”, “d”, “u”). Usually comes from config files |
Returns: | True if status <=> self.status, otherwise False |
Return type: | bool |
-
labels
-
last_check_command
-
last_chk
-
last_event_id
-
last_hard_state
-
last_hard_state_change
-
last_hard_state_id
-
last_notification
-
last_perf_data
-
last_problem_id
-
last_snapshot
-
last_state
-
last_state_change
-
last_state_id
-
last_state_type
-
last_state_update
-
last_time_down
-
last_time_non_ok_or_up()[source]
Get the last time the host was in a non-OK state
Returns: | self.last_time_down if self.last_time_down > self.last_time_up, 0 otherwise |
Return type: | int |
-
last_time_unreachable
-
last_time_up
-
latency
-
long_output
-
low_flap_threshold
-
macromodulations
-
macros = {'HOSTPERFDATA': 'perf_data', 'HOSTGROUPNAMES': 'get_groupnames', 'HOSTCHECKCOMMAND': 'get_check_command', 'LASTHOSTSTATECHANGE': 'last_state_change', 'HOSTSTATE': 'state', 'TOTALHOSTSERVICES': 'get_total_services', 'HOSTNOTESURL': 'notes_url', 'HOSTREALM': 'get_realm', 'HOSTADDRESS30': 'address30', 'HOSTADDRESS31': 'address31', 'HOSTEVENTID': 'current_event_id', 'LASTHOSTCHECK': 'last_chk', 'HOSTPERCENTCHANGE': 'percent_state_change', 'HOSTLATENCY': 'latency', 'HOSTADDRESS6': 'address6', 'HOSTADDRESS7': 'address7', 'HOSTADDRESS4': 'address4', 'HOSTADDRESS5': 'address5', 'HOSTADDRESS2': 'address2', 'HOSTADDRESS3': 'address3', 'HOSTADDRESS0': 'address0', 'HOSTADDRESS1': 'address1', 'HOSTADDRESS17': 'address17', 'HOSTACKAUTHOR': 'get_ack_author_name', 'HOSTADDRESS8': 'address8', 'HOSTADDRESS9': 'address9', 'HOSTSTATEID': 'state_id', 'HOSTDURATION': 'get_duration', 'HOSTNAME': 'host_name', 'TOTALHOSTSERVICESUNKNOWN': 'get_total_services_unknown', 'HOSTNOTES': 'notes', 'HOSTACTIONURL': 'action_url', 'HOSTDURATIONSEC': 'get_duration_sec', 'MAXHOSTATTEMPTS': 'max_check_attempts', 'HOSTEXECUTIONTIME': 'execution_time', 'HOSTACKAUTHORALIAS': 'get_ack_author_name', 'TOTALHOSTSERVICESWARNING': 'get_total_services_warning', 'LASTHOSTEVENTID': 'last_event_id', 'SHORTSTATUS': 'get_short_status', 'HOSTPROBLEMID': 'current_problem_id', 'HOSTADDRESS18': 'address18', 'HOSTADDRESS19': 'address19', 'HOSTACKCOMMENT': 'get_ack_comment', 'HOSTADDRESS15': 'address15', 'HOSTADDRESS14': 'address14', 'LONGHOSTOUTPUT': 'long_output', 'HOSTADDRESS16': 'address16', 'HOSTOUTPUT': 'output', 'HOSTADDRESS10': 'address10', 'HOSTADDRESS11': 'address11', 'HOSTATTEMPT': 'attempt', 'HOSTADDRESS13': 'address13', 'LASTHOSTDOWN': 'last_time_down', 'HOSTALIAS': 'alias', 'TOTALHOSTSERVICESCRITICAL': 'get_total_services_critical', 'HOSTSTATETYPE': 'state_type', 'HOSTBUSINESSIMPACT': 'business_impact', 'HOSTACKAUTHORNAME': 'get_ack_author_name', 'LASTHOSTSTATEID': 'last_state_id', 'HOSTADDRESS28': 'address28', 'HOSTADDRESS12': 'address12', 'LASTHOSTUP': 'last_time_up', 'STATUS': 'get_status', 'HOSTDOWNTIME': 'get_downtime', 'HOSTADDRESS22': 'address22', 'TOTALHOSTSERVICESOK': 'get_total_services_ok', 'HOSTDISPLAYNAME': 'display_name', 'LASTHOSTPERFDATA': 'last_perf_data', 'HOSTADDRESS25': 'address25', 'HOSTADDRESS24': 'address24', 'HOSTADDRESS27': 'address27', 'HOSTADDRESS26': 'address26', 'HOSTADDRESS21': 'address21', 'HOSTADDRESS20': 'address20', 'HOSTADDRESS23': 'address23', 'LASTHOSTUNREACHABLE': 'last_time_unreachable', 'HOSTADDRESS29': 'address29', 'LASTHOSTPROBLEMID': 'last_problem_id', 'LASTHOSTSTATE': 'last_state', 'HOSTADDRESS': 'address', 'FULLNAME': 'get_full_name', 'HOSTGROUPNAME': 'get_groupname'}
-
maintenance_period
-
manage_stalking(check)[source]
Check if the host need stalking or not (immediate recheck)
If one stalking_options matches the exit_status (‘o’ <=> 0 ...) then stalk is needed
Raise a log entry (info level) if stalk is needed
Parameters: | check (alignak.check.Check) – finshed check (check.status == ‘waitconsume’) |
Returns: | None |
-
max_check_attempts
-
modified_attributes
-
my_own_business_impact
-
my_type = 'host'
-
name
-
next_chk
-
notes
-
notes_url
-
notification_interval
-
notification_is_blocked_by_contact(notif, contact)[source]
Check if the notification is blocked by this contact.
Parameters: |
|
Returns: | True if the notification is blocked, False otherwise
|
Return type: | bool
|
-
notification_is_blocked_by_item(n_type, t_wished=None)[source]
Check if a notification is blocked by the host.
Conditions are ONE of the following:
* enable_notification is False (global)
* not in a notification_period
* notifications_enable is False (local)
* notification_options is 'n' or matches the state ('DOWN' <=> 'd' ...)
(include flapping and downtimes)
- state goes ok and type is ‘ACKNOWLEDGEMENT’ (no sense)
- scheduled_downtime_depth > 0 and flapping (host is in downtime)
- scheduled_downtime_depth > 1 and not downtime end (deep downtime)
- scheduled_downtime_depth > 0 and problem or recovery (host is in downtime)
- SOFT state of a problem (we raise notification ony on HARD state)
- ACK notification when already ACK (don’t raise again ACK)
- not flapping notification in a flapping state
- business rule smart notifications is enabled and all its children have been acknowledged
or are under downtime
Parameters: |
- n_type – notification type
- t_wished (float) – the time we should like to notify the host (mostly now)
|
Returns: | True if ONE of the above condition was met, otherwise False
|
Return type: | bool
|
TODO: Refactor this, a lot of code duplication with Service.notification_is_blocked_by_item
-
notification_options
-
notification_period
-
notifications_enabled
-
notifications_in_progress
-
notified_contacts
-
obsess_over_host
-
ok_up = 'UP'
-
old_properties = {'normal_check_interval': 'check_interval', 'hostgroup': 'hostgroups', 'criticity': 'business_impact', 'retry_check_interval': 'retry_interval'}
-
output
-
pack_id
-
parent_dependencies
-
parents
-
passive_checks_enabled
-
pending_flex_downtime
-
percent_state_change
-
perf_data
-
poller_tag
-
problem_has_been_acknowledged
-
process_perf_data
-
processed_business_rule
-
properties = {'statusmap_image': <alignak.property.StringProp object at 0x7fd17a741690>, 'business_impact_modulations': <alignak.property.ListProp object at 0x7fd17a741890>, 'retry_interval': <alignak.property.IntegerProp object at 0x7fd17a7b6e90>, 'labels': <alignak.property.ListProp object at 0x7fd17a741a50>, 'action_url': <alignak.property.StringProp object at 0x7fd17a741550>, 'escalations': <alignak.property.ListProp object at 0x7fd17a7418d0>, 'low_flap_threshold': <alignak.property.IntegerProp object at 0x7fd17a741110>, 'process_perf_data': <alignak.property.BoolProp object at 0x7fd17a741210>, '2d_coords': <alignak.property.StringProp object at 0x7fd17a7416d0>, 'icon_image': <alignak.property.StringProp object at 0x7fd17a741590>, 'snapshot_interval': <alignak.property.IntegerProp object at 0x7fd17a741ed0>, 'check_period': <alignak.property.StringProp object at 0x7fd17a7b6f50>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'display_name': <alignak.property.StringProp object at 0x7fd17a7b6c90>, 'notification_interval': <alignak.property.IntegerProp object at 0x7fd17a741350>, 'failure_prediction_enabled': <alignak.property.BoolProp object at 0x7fd17a741750>, 'flap_detection_options': <alignak.property.ListProp object at 0x7fd17a7411d0>, 'snapshot_enabled': <alignak.property.BoolProp object at 0x7fd17a741dd0>, 'event_handler_enabled': <alignak.property.BoolProp object at 0x7fd17a7410d0>, 'trigger': <alignak.property.StringProp object at 0x7fd17a741c10>, 'parents': <alignak.property.ListProp object at 0x7fd17a7b6d10>, 'initial_state': <alignak.property.CharProp object at 0x7fd17a7b6dd0>, 'first_notification_delay': <alignak.property.IntegerProp object at 0x7fd17a741390>, 'notification_options': <alignak.property.ListProp object at 0x7fd17a741410>, 'host_name': <alignak.property.StringProp object at 0x7fd17a7b6bd0>, 'snapshot_period': <alignak.property.StringProp object at 0x7fd17a741e50>, 'notifications_enabled': <alignak.property.BoolProp object at 0x7fd17a741450>, 'event_handler': <alignak.property.StringProp object at 0x7fd17a741090>, 'obsess_over_host': <alignak.property.BoolProp object at 0x7fd17a7b6f90>, 'freshness_threshold': <alignak.property.IntegerProp object at 0x7fd17a741050>, 'alias': <alignak.property.StringProp object at 0x7fd17a7b6c50>, 'service_excludes': <alignak.property.ListProp object at 0x7fd17a7419d0>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'time_to_orphanage': <alignak.property.IntegerProp object at 0x7fd17a741950>, 'trigger_broker_raise_enabled': <alignak.property.BoolProp object at 0x7fd17a741c90>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'custom_views': <alignak.property.ListProp object at 0x7fd17a741d90>, 'check_command': <alignak.property.StringProp object at 0x7fd17a7b6d90>, 'passive_checks_enabled': <alignak.property.BoolProp object at 0x7fd17a7b6f10>, 'check_interval': <alignak.property.IntegerProp object at 0x7fd17a7b6e50>, 'notes': <alignak.property.StringProp object at 0x7fd17a7414d0>, 'check_freshness': <alignak.property.BoolProp object at 0x7fd17a7b6fd0>, 'active_checks_enabled': <alignak.property.BoolProp object at 0x7fd17a7b6ed0>, 'icon_image_alt': <alignak.property.StringProp object at 0x7fd17a7415d0>, 'service_includes': <alignak.property.ListProp object at 0x7fd17a741a10>, 'hostgroups': <alignak.property.ListProp object at 0x7fd17a7b6d50>, 'reactionner_tag': <alignak.property.StringProp object at 0x7fd17a741810>, 'notes_url': <alignak.property.StringProp object at 0x7fd17a741510>, 'service_overrides': <alignak.property.ListProp object at 0x7fd17a741990>, 'maintenance_period': <alignak.property.StringProp object at 0x7fd17a741910>, 'realm': <alignak.property.StringProp object at 0x7fd17a741790>, 'contacts': <alignak.property.ListProp object at 0x7fd17a7412d0>, 'notification_period': <alignak.property.StringProp object at 0x7fd17a7413d0>, 'trending_policies': <alignak.property.ListProp object at 0x7fd17a741cd0>, 'resultmodulations': <alignak.property.ListProp object at 0x7fd17a741850>, 'retain_status_information': <alignak.property.BoolProp object at 0x7fd17a741250>, 'business_rule_downtime_as_ack': <alignak.property.BoolProp object at 0x7fd17a741b10>, 'stalking_options': <alignak.property.ListProp object at 0x7fd17a741490>, 'macromodulations': <alignak.property.ListProp object at 0x7fd17a741d50>, 'flap_detection_enabled': <alignak.property.BoolProp object at 0x7fd17a741190>, 'business_rule_host_notification_options': <alignak.property.ListProp object at 0x7fd17a741b50>, 'high_flap_threshold': <alignak.property.IntegerProp object at 0x7fd17a741150>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'snapshot_criteria': <alignak.property.ListProp object at 0x7fd17a741e90>, 'retain_nonstatus_information': <alignak.property.BoolProp object at 0x7fd17a741290>, 'contact_groups': <alignak.property.ListProp object at 0x7fd17a741310>, 'business_rule_smart_notifications': <alignak.property.BoolProp object at 0x7fd17a741ad0>, 'address': <alignak.property.StringProp object at 0x7fd17a7b6cd0>, 'trigger_name': <alignak.property.StringProp object at 0x7fd17a741c50>, 'vrml_image': <alignak.property.StringProp object at 0x7fd17a741650>, '3d_coords': <alignak.property.StringProp object at 0x7fd17a741710>, 'snapshot_command': <alignak.property.StringProp object at 0x7fd17a741e10>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'checkmodulations': <alignak.property.ListProp object at 0x7fd17a741d10>, 'poller_tag': <alignak.property.StringProp object at 0x7fd17a7417d0>, 'icon_set': <alignak.property.StringProp object at 0x7fd17a741610>, 'business_impact': <alignak.property.IntegerProp object at 0x7fd17a741bd0>, 'max_check_attempts': <alignak.property.IntegerProp object at 0x7fd17a7b6e10>, 'business_rule_service_notification_options': <alignak.property.ListProp object at 0x7fd17a741b90>, 'business_rule_output_template': <alignak.property.StringProp object at 0x7fd17a741a90>}
-
raise_alert_log_entry()[source]
Raise HOST ALERT entry (critical level)
Format is : “HOST ALERT: get_name();*state*;*state_type*;*attempt*;*output*”
Example : “HOST ALERT: server;DOWN;HARD;1;I don’t know what to say...”
-
raise_cancel_downtime_log_entry()[source]
Raise HOST DOWNTIME ALERT entry (critical level)
Format is : “HOST DOWNTIME ALERT: get_name();CANCELLED;
Host has entered a period of scheduled downtime”
- Example : “HOST DOWNTIME ALERT: test_host_0;CANCELLED;
- Host has entered a period of scheduled downtime”
-
raise_enter_downtime_log_entry()[source]
Raise HOST DOWNTIME ALERT entry (critical level)
Format is : “HOST DOWNTIME ALERT: get_name();STARTED;
Host has entered a period of scheduled downtime”
- Example : “HOST DOWNTIME ALERT: test_host_0;STARTED;
- Host has entered a period of scheduled downtime”
-
raise_event_handler_log_entry(command)[source]
Raise HOST EVENT HANDLER entry (critical level)
Format is : “HOST EVENT HANDLER: self.get_name();*state*;*state_type*;*attempt*;
command.get_name()“
Example : “HOST EVENT HANDLER: server;UP;HARD;1;notify-by-rss”
-
raise_exit_downtime_log_entry()[source]
Raise HOST DOWNTIME ALERT entry (critical level)
Format is : “HOST DOWNTIME ALERT: get_name();STOPPED;
Host has entered a period of scheduled downtime”
- Example : “HOST DOWNTIME ALERT: test_host_0;STOPPED;
- Host has entered a period of scheduled downtime”
-
raise_flapping_start_log_entry(change_ratio, threshold)[source]
Raise HOST FLAPPING ALERT START entry (critical level)
Format is : “HOST FLAPPING ALERT: self.get_name();STARTED;
Host appears to have started
flapping (
*change_ratio*% change >=
*threshold*% threshold)”
- Example : “HOST FLAPPING ALERT: server;STARTED;
- Host appears to have started
flapping (50.6% change >= 50.0% threshold)”
Parameters: |
- change_ratio (float) – percent of changing state
- threshold (float) – threshold (percent) to trigger this log entry
|
Returns: | None
|
-
raise_flapping_stop_log_entry(change_ratio, threshold)[source]
Raise HOST FLAPPING ALERT STOPPED entry (critical level)
Format is : “HOST FLAPPING ALERT: self.get_name();STOPPED;
Host appears to have stopped
flapping (
*change_ratio*% change <
*threshold*% threshold)”
- Example : “HOST FLAPPING ALERT: server;STOPPED;
- Host appears to have stopped
flapping (23.0% change < 25.0% threshold)”
Parameters: |
- change_ratio (float) – percent of changing state
- threshold (float) – threshold (percent) to trigger this log entry
|
Returns: | None
|
-
raise_freshness_log_entry(t_stale_by, t_threshold)[source]
Raise freshness alert entry (warning level)
Format is : “The results of host ‘get_name()‘ are stale by t_stale_by
(threshold=*t_threshold*). I’m forcing an immediate check of the host.”
- Example : “Warning: The results of host ‘Server’ are stale by 0d 0h 0m 58s
- (threshold=0d 1h 0m 0s). ...”
Parameters: |
- t_stale_by (int) – time in seconds the host has been in a stale state
- t_threshold (int) – threshold (seconds) to trigger this log entry
|
Returns: | None
|
-
raise_initial_state()[source]
Raise CURRENT HOST ALERT entry (info level)
Format is : “CURRENT HOST STATE: get_name();*state*;*state_type*;*attempt*;*output*”
Example : “CURRENT HOST STATE: server;DOWN;HARD;1;I don’t know what to say...”
-
raise_no_next_check_log_entry()[source]
Raise no scheduled check entry (warning level)
Format is : “I cannot schedule the check for the host ‘get_name()*’
because there is not future valid time”
- Example : “I cannot schedule the check for the host ‘Server’
- because there is not future valid time”
-
raise_notification_log_entry(notif)[source]
Raise HOST NOTIFICATION entry (critical level)
Format is : “HOST NOTIFICATION: contact.get_name();*self.get_name()*;*state*;
command.get_name();*output*”
Example : “HOST NOTIFICATION: superadmin;server;UP;notify-by-rss;no output”
Parameters: | notif (alignak.objects.notification.Notification) – notification object created by host alert |
Returns: | None |
-
raise_snapshot_log_entry(command)[source]
Raise HOST SNAPSHOT entry (critical level)
Format is : “HOST SNAPSHOT: self.get_name();*state*;*state_type*;*attempt*;
command.get_name()“
Example : “HOST SNAPSHOT: server;UP;HARD;1;notify-by-rss”
-
reactionner_tag
-
realm
-
register
-
register_child(child)[source]
Add a child to child list
-
resultmodulations
-
retain_nonstatus_information
-
retain_status_information
-
retry_interval
-
return_code
-
running_properties = {'state_id_before_impact': <alignak.property.StringProp object at 0x7fd17a751390>, 'child_dependencies': <alignak.property.StringProp object at 0x7fd17a7511d0>, 'last_time_unreachable': <alignak.property.IntegerProp object at 0x7fd17a7494d0>, 'childs': <alignak.property.StringProp object at 0x7fd17a751150>, 'business_rule': <alignak.property.StringProp object at 0x7fd17a751490>, 'last_perf_data': <alignak.property.StringProp object at 0x7fd17a749f10>, 'acknowledgement': <alignak.property.StringProp object at 0x7fd17a749990>, 'actions': <alignak.property.StringProp object at 0x7fd17a7510d0>, 'current_notification_number': <alignak.property.IntegerProp object at 0x7fd17a749c50>, 'last_problem_id': <alignak.property.IntegerProp object at 0x7fd17a749ad0>, 's_time': <alignak.property.FloatProp object at 0x7fd17a749bd0>, 'checks_in_progress': <alignak.property.StringProp object at 0x7fd17a7497d0>, 'chk_depend_of': <alignak.property.ListProp object at 0x7fd17a749690>, 'last_notification': <alignak.property.FloatProp object at 0x7fd17a749c10>, 'chk_depend_of_me': <alignak.property.ListProp object at 0x7fd17a749710>, 'check_flapping_recovery_notification': <alignak.property.BoolProp object at 0x7fd17a749cd0>, 'last_state': <alignak.property.StringProp object at 0x7fd17a749290>, 'topology_change': <alignak.property.BoolProp object at 0x7fd17a751590>, 'my_own_business_impact': <alignak.property.IntegerProp object at 0x7fd17a751290>, 'impacts': <alignak.property.StringProp object at 0x7fd17a751310>, 'last_hard_state_change': <alignak.property.FloatProp object at 0x7fd17a749390>, 'was_in_hard_unknown_reach_phase': <alignak.property.BoolProp object at 0x7fd17a751510>, 'parent_dependencies': <alignak.property.StringProp object at 0x7fd17a751190>, 'percent_state_change': <alignak.property.FloatProp object at 0x7fd17a749910>, 'notifications_in_progress': <alignak.property.StringProp object at 0x7fd17a749810>, 'u_time': <alignak.property.FloatProp object at 0x7fd17a749b90>, 'last_state_id': <alignak.property.IntegerProp object at 0x7fd17a7492d0>, 'has_been_checked': <alignak.property.IntegerProp object at 0x7fd17a749a50>, 'broks': <alignak.property.StringProp object at 0x7fd17a751110>, 'pending_flex_downtime': <alignak.property.IntegerProp object at 0x7fd17a749d50>, 'last_state_update': <alignak.property.StringProp object at 0x7fd17a749750>, 'execution_time': <alignak.property.FloatProp object at 0x7fd17a749b50>, 'start_time': <alignak.property.IntegerProp object at 0x7fd17a749dd0>, 'flapping_changes': <alignak.property.StringProp object at 0x7fd17a7498d0>, 'configuration_warnings': <alignak.property.ListProp object at 0x7fd17a819650>, 'notified_contacts': <alignak.property.StringProp object at 0x7fd17a749fd0>, 'flapping_comment_id': <alignak.property.IntegerProp object at 0x7fd17a749610>, 'early_timeout': <alignak.property.IntegerProp object at 0x7fd17a749e50>, 'in_scheduled_downtime': <alignak.property.BoolProp object at 0x7fd17a751050>, 'act_depend_of_me': <alignak.property.ListProp object at 0x7fd17a7496d0>, 'state_type_id': <alignak.property.IntegerProp object at 0x7fd17a7491d0>, 'scheduled_downtime_depth': <alignak.property.IntegerProp object at 0x7fd17a749d10>, 'in_checking': <alignak.property.BoolProp object at 0x7fd17a741fd0>, 'last_state_change': <alignak.property.FloatProp object at 0x7fd17a749350>, 'long_output': <alignak.property.StringProp object at 0x7fd17a749590>, 'duration_sec': <alignak.property.IntegerProp object at 0x7fd17a749510>, 'end_time': <alignak.property.IntegerProp object at 0x7fd17a749e10>, 'timeout': <alignak.property.IntegerProp object at 0x7fd17a749d90>, 'output': <alignak.property.StringProp object at 0x7fd17a749550>, 'perf_data': <alignak.property.StringProp object at 0x7fd17a749ed0>, 'state_before_impact': <alignak.property.StringProp object at 0x7fd17a751350>, 'is_impact': <alignak.property.StringProp object at 0x7fd17a751250>, 'check_type': <alignak.property.IntegerProp object at 0x7fd17a749a10>, 'in_scheduled_downtime_during_last_check': <alignak.property.BoolProp object at 0x7fd17a751090>, 'source_problems': <alignak.property.StringProp object at 0x7fd17a7512d0>, 'last_event_id': <alignak.property.IntegerProp object at 0x7fd17a749250>, 'in_hard_unknown_reach_phase': <alignak.property.BoolProp object at 0x7fd17a7514d0>, 'problem_has_been_acknowledged': <alignak.property.BoolProp object at 0x7fd17a749950>, 'should_be_scheduled': <alignak.property.IntegerProp object at 0x7fd17a749a90>, 'latency': <alignak.property.FloatProp object at 0x7fd17a749090>, 'state_changed_since_impact': <alignak.property.StringProp object at 0x7fd17a7513d0>, 'current_event_id': <alignak.property.StringProp object at 0x7fd17a749210>, 'last_state_type': <alignak.property.StringProp object at 0x7fd17a749310>, 'downtimes': <alignak.property.StringProp object at 0x7fd17a749850>, 'last_time_up': <alignak.property.IntegerProp object at 0x7fd17a749450>, 'last_hard_state': <alignak.property.StringProp object at 0x7fd17a7493d0>, 'next_chk': <alignak.property.IntegerProp object at 0x7fd17a741f90>, 'processed_business_rule': <alignak.property.StringProp object at 0x7fd17a751450>, 'comments': <alignak.property.StringProp object at 0x7fd17a749890>, 'last_check_command': <alignak.property.StringProp object at 0x7fd17a751690>, 'state': <alignak.property.StringProp object at 0x7fd17a749110>, 'current_problem_id': <alignak.property.IntegerProp object at 0x7fd17a749b10>, 'last_chk': <alignak.property.IntegerProp object at 0x7fd17a741f50>, 'current_notification_id': <alignak.property.IntegerProp object at 0x7fd17a749c90>, 'last_snapshot': <alignak.property.IntegerProp object at 0x7fd17a751650>, 'is_problem': <alignak.property.StringProp object at 0x7fd17a751210>, 'tags': <alignak.property.ListProp object at 0x7fd17a8196d0>, 'pack_id': <alignak.property.IntegerProp object at 0x7fd17a7515d0>, 'return_code': <alignak.property.IntegerProp object at 0x7fd17a749e90>, 'is_flapping': <alignak.property.BoolProp object at 0x7fd17a7495d0>, 'customs': <alignak.property.StringProp object at 0x7fd17a749f50>, 'state_before_hard_unknown_reach_phase': <alignak.property.StringProp object at 0x7fd17a751550>, 'got_default_realm': <alignak.property.BoolProp object at 0x7fd17a749f90>, 'state_id': <alignak.property.IntegerProp object at 0x7fd17a749150>, 'services': <alignak.property.StringProp object at 0x7fd17a749790>, 'configuration_errors': <alignak.property.ListProp object at 0x7fd17a819690>, 'state_type': <alignak.property.StringProp object at 0x7fd17a749190>, 'attempt': <alignak.property.IntegerProp object at 0x7fd17a7490d0>, 'act_depend_of': <alignak.property.ListProp object at 0x7fd17a749650>, 'triggers': <alignak.property.StringProp object at 0x7fd17a751610>, 'acknowledgement_type': <alignak.property.IntegerProp object at 0x7fd17a7499d0>, 'last_time_down': <alignak.property.IntegerProp object at 0x7fd17a749490>, 'modified_attributes': <alignak.property.IntegerProp object at 0x7fd17a741f10>, 'in_maintenance': <alignak.property.IntegerProp object at 0x7fd17a749050>, 'got_business_rule': <alignak.property.BoolProp object at 0x7fd17a751410>, 'last_hard_state_id': <alignak.property.IntegerProp object at 0x7fd17a749410>}
-
s_time
-
scheduled_downtime_depth
-
service_excludes = []
-
service_includes = []
-
service_overrides
-
services
-
set_impact_state()[source]
We just go an impact, so we go unreachable
But only if we enable this state change in the conf
-
set_state_from_exit_status(status)[source]
Set the state in UP, DOWN, or UNDETERMINED
with the status of a check. Also update last_state
Parameters: | status (int) – integer between 0 and 3 (but not 1) |
Returns: | None |
-
set_unreachable()[source]
Set unreachable: all our parents are down
Unreachable is different from down even if the state id is the same
:return:None
-
should_be_scheduled
-
snapshot_command
-
snapshot_criteria
-
snapshot_enabled
-
snapshot_interval
-
snapshot_period
-
source_problems
-
stalking_options
-
start_time
-
state
-
state_before_hard_unknown_reach_phase
-
state_before_impact
-
state_changed_since_impact
-
state_id
-
state_id_before_impact
-
state_type
-
state_type_id
-
statusmap_image
-
tags
-
time_to_orphanage
-
timeout
-
topology_change
-
trending_policies
-
trigger
-
trigger_broker_raise_enabled
-
trigger_name
-
triggers
-
u_time
-
unset_impact_state()[source]
Unset impact, only if impact state change is set in configuration
-
use
-
vrml_image
-
was_in_hard_unknown_reach_phase
-
class alignak.objects.host.Hosts(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Class for the hosts lists. It’s mainly for configuration
-
apply_dependencies()[source]
Loop on hosts and call Host.fill_parents_dependency()
-
create_business_rules(hosts, services)[source]
Loop on hosts and call Host.create_business_rules(hosts, services)
-
create_business_rules_dependencies()[source]
Loop on hosts and call Host.create_business_rules_dependencies()
-
explode(hostgroups, contactgroups, triggers)[source]
Explode hosts, hostrgroups and triggers:
* Add triggers source to host triggers
* Add contact from contactgroups to host contacts
* Add host into their hostgroups as hostgroup members
-
fill_predictive_missing_parameters()[source]
Loop on hosts and call Host.fill_predictive_missing_parameters()
-
find_hosts_that_use_template(tpl_name)[source]
Find hosts that use the template defined in argument tpl_name
Parameters: | tpl_name (str) – the template name we filter or |
Returns: | list of the host_name of the hosts that got the template tpl_name in tags |
Return type: | list[str] |
-
inner_class
alias of Host
-
linkify(timeperiods=None, commands=None, contacts=None, realms=None, resultmodulations=None, businessimpactmodulations=None, escalations=None, hostgroups=None, triggers=None, checkmodulations=None, macromodulations=None)[source]
Create link between objects:
* hosts -> timeperiods
* hosts -> hosts (parents, etc)
* hosts -> commands (check_command)
* hosts -> contacts
-
linkify_h_by_h()[source]
Link hosts with their parents
-
linkify_h_by_hg(hostgroups)[source]
Link hosts with hostgroups
-
linkify_h_by_realms(realms)[source]
Link hosts with realms
-
name_property = 'host_name'
alignak.objects.hostdependency module
This module provides Hostdependency and Hostdependencies classes that
implements dependencies between hosts. Basically used for parsing.
-
class alignak.objects.hostdependency.Hostdependencies(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Hostdependencies manage a list of Hostdependency objects, used for parsing configuration
-
delete_hostsdep_by_id(ids)[source]
Delete a list of hostdependency
Parameters: | ids (list) – ids list to delete |
Returns: | None |
-
explode(hostgroups)[source]
Explode all host dependency for each member of hostgroups
Each member of dependent hostgroup or hostgroup in dependency have to get a copy of
host dependencies (quite complex to parse)
-
inner_class
alias of Hostdependency
-
is_correct()[source]
Check if this host configuration is correct
* All required parameter are specified
* Go through all configuration warnings and errors that could have been raised earlier
Returns: | True if the configuration is correct, False otherwise |
Return type: | bool |
-
linkify(hosts, timeperiods)[source]
Create link between objects:
* hostdependency -> host
* hostdependency -> timeperiods
-
linkify_h_by_hd()[source]
Add dependency in host objects
-
linkify_hd_by_h(hosts)[source]
Replace dependent_host_name and host_name
in host dependency by the real object
-
linkify_hd_by_tp(timeperiods)[source]
Replace dependency_period by a real object in host dependency
-
class alignak.objects.hostdependency.Hostdependency(params={})[source]
Bases: alignak.objects.item.Item
Hostdependency class is a simple implementation of host dependency as
defined in a monitoring context (dependency period, notification_failure_criteria ..)
-
get_name()[source]
Get name based on dependent_host_name and host_name attributes
Each attribute is substituted by ‘unknown’ if attribute does not exist
Returns: | dependent_host_name/host_name |
Return type: | str |
-
my_type = 'hostdependency'
-
properties = {'inherits_parent': <alignak.property.BoolProp object at 0x7fd17a6fca50>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'notification_failure_criteria': <alignak.property.ListProp object at 0x7fd17a6fcad0>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'dependency_period': <alignak.property.StringProp object at 0x7fd17a6fcb10>, 'execution_failure_criteria': <alignak.property.ListProp object at 0x7fd17a6fca90>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'hostgroup_name': <alignak.property.StringProp object at 0x7fd17a6fca10>, 'dependent_host_name': <alignak.property.StringProp object at 0x7fd17a6fc910>, 'host_name': <alignak.property.StringProp object at 0x7fd17a6fc9d0>, 'dependent_hostgroup_name': <alignak.property.StringProp object at 0x7fd17a6fc990>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>}
alignak.objects.hostescalation module
This module provides Hostescalation and Hostescalations classes that
implements host escalation for notification. Basically used for parsing.
-
class alignak.objects.hostescalation.Hostescalation(params={})[source]
Bases: alignak.objects.item.Item
Hostescalation class is used to implement notification escalation for hosts
- TODO: Why this class does not inherit from alignak.objects.Escalation.
- Maybe we can merge it
-
get_name()[source]
Get escalation name
Returns: | name |
Return type: | str |
TODO: Remove this function
-
my_type = 'hostescalation'
-
properties = {'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'contact_groups': <alignak.property.StringProp object at 0x7fd17a7aa390>, 'escalation_period': <alignak.property.StringProp object at 0x7fd17a7aa2d0>, 'last_notification': <alignak.property.IntegerProp object at 0x7fd17a7aa250>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'notification_interval': <alignak.property.IntegerProp object at 0x7fd17a7aa290>, 'contacts': <alignak.property.StringProp object at 0x7fd17a7aa350>, 'last_notification_time': <alignak.property.IntegerProp object at 0x7fd17a7aa410>, 'escalation_options': <alignak.property.ListProp object at 0x7fd17a7aa310>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'hostgroup_name': <alignak.property.StringProp object at 0x7fd17a7aa1d0>, 'host_name': <alignak.property.StringProp object at 0x7fd17a7aa150>, 'first_notification_time': <alignak.property.IntegerProp object at 0x7fd17a7aa3d0>, 'first_notification': <alignak.property.IntegerProp object at 0x7fd17a7aa210>}
-
class alignak.objects.hostescalation.Hostescalations(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Hostescalations manage a list of Hostescalation objects, used for parsing configuration
-
explode(escalations)[source]
Create instance of Escalation for each HostEscalation object
-
inner_class
alias of Hostescalation
-
name_property = ''
alignak.objects.hostextinfo module
This is the main class for the Host ext info. In fact it’s mainly
about the configuration part. Parameters are merged in Hosts so it’s
no use in running part
-
class alignak.objects.hostextinfo.HostExtInfo(params={})[source]
Bases: alignak.objects.item.Item
HostExtInfo class is made to handle some parameters of SchedulingItem:
* notes
* notes_url
* icon_image
* icon_image_alt
TODO: Is this class really necessary?
-
definition_order
-
get_dbg_name()[source]
Get the host name for debugging (host_name)
Returns: | service extinfo host name |
Return type: | str |
TODO: Remove this function, get_name is doing it
-
get_full_name()[source]
Get the full name for debugging (host_name)
Returns: | service extinfo host name |
Return type: | str |
TODO: Remove this function, get_name is doing it
-
get_name()[source]
Accessor to host_name attribute or name if first not defined
Returns: | host name or name |
Return type: | str |
TODO: Clean this function
-
host_name
-
icon_image
-
icon_image_alt
-
imported_from
-
is_correct()[source]
Check if this object is correct
Returns: | True, always. |
Return type: | bool |
TODO: Clean this function
-
macros = {'HOSTNOTES': 'notes', 'HOSTNAME': 'host_name', 'HOSTNOTESURL': 'notes_url'}
-
my_type = 'hostextinfo'
-
name
-
notes
-
notes_url
-
properties = {'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'icon_image_alt': <alignak.property.StringProp object at 0x7fd17a731550>, 'notes': <alignak.property.StringProp object at 0x7fd17a731490>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'vrml_image': <alignak.property.StringProp object at 0x7fd17a731590>, '3d_coords': <alignak.property.StringProp object at 0x7fd17a731650>, 'notes_url': <alignak.property.StringProp object at 0x7fd17a7314d0>, 'host_name': <alignak.property.StringProp object at 0x7fd17a731410>, 'icon_image': <alignak.property.StringProp object at 0x7fd17a731510>, '2d_coords': <alignak.property.StringProp object at 0x7fd17a731610>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'statusmap_image': <alignak.property.StringProp object at 0x7fd17a7315d0>}
-
register
-
statusmap_image
-
use
-
vrml_image
-
class alignak.objects.hostextinfo.HostsExtInfo(items, index_items=True)[source]
Bases: alignak.objects.item.Items
HostsExtInfo manage HostExtInfo and propagate properties (listed before)
into Hosts if necessary
-
inner_class
alias of HostExtInfo
-
merge(hosts)[source]
Merge extended host information into services
-
merge_extinfo(host, extinfo)[source]
Merge extended host information into a host
-
name_property = 'host_name'
alignak.objects.hostgroup module
This module provide Hostgroup and Hostgroups class used to manage host groups
-
class alignak.objects.hostgroup.Hostgroup(params={})[source]
Bases: alignak.objects.itemgroup.Itemgroup
Class to manage a group of host
A Hostgroup is used to manage a group of hosts
-
get_hostgroup_members()[source]
Get hostgroup members
Returns: | list of hosts |
Return type: | list |
-
get_hosts()[source]
Get list of hosts of this group
Returns: | list of hosts |
Return type: | list |
-
get_hosts_by_explosion(hostgroups)[source]
Get hosts of this group
-
get_name()[source]
Get name of group
Returns: | Name of hostgroup |
Return type: | str |
-
macros = {'HOSTGROUPMEMBERS': 'members', 'HOSTGROUPNOTES': 'notes', 'HOSTGROUPACTIONURL': 'action_url', 'HOSTGROUPALIAS': 'alias', 'HOSTGROUPNOTESURL': 'notes_url'}
-
my_type = 'hostgroup'
-
properties = {'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'hostgroup_name': <alignak.property.StringProp object at 0x7fd17a751e50>, 'realm': <alignak.property.StringProp object at 0x7fd17a751f90>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'alias': <alignak.property.StringProp object at 0x7fd17a751e90>, 'notes': <alignak.property.StringProp object at 0x7fd17a751ed0>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'unknown_members': <alignak.property.ListProp object at 0x7fd17a751dd0>, 'action_url': <alignak.property.StringProp object at 0x7fd17a751f50>, 'notes_url': <alignak.property.StringProp object at 0x7fd17a751f10>, 'members': <alignak.property.ListProp object at 0x7fd17a751d50>, '_id': <alignak.property.IntegerProp object at 0x7fd17a751e10>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>}
-
class alignak.objects.hostgroup.Hostgroups(items, index_items=True)[source]
Bases: alignak.objects.itemgroup.Itemgroups
Class to manage list of Hostgroup
Hostgroups is used to regroup all Hostgroup
-
add_member(hname, hgname)[source]
Add a host string to a hostgroup member
if the host group do not exist, create it
Parameters: | hname (str) – host name |
:param hgname:hostgroup name
:type hgname: str
:return: None
-
explode()[source]
Fill members with hostgroup_members
-
get_members_by_name(hgname)[source]
Get all members by name given in parameter
Parameters: | hgname (str) – name of members |
Returns: | list of hosts with this name |
Return type: | list |
-
inner_class
alias of Hostgroup
-
linkify(hosts=None, realms=None)[source]
Make link of hosts / realms
-
linkify_hg_by_hst(hosts)[source]
We just search for each hostgroup the id of the hosts
and replace the name by the id
Parameters: | hosts (object) – object Hosts |
Returns: | None |
-
linkify_hg_by_realms(realms)[source]
More than an explode function, but we need to already
have members so... Will be really linkify just after
And we explode realm in ours members, but do not override
a host realm value if it’s already set
Parameters: | realms (object) – object Realms |
Returns: | None |
-
name_property = 'hostgroup_name'
alignak.objects.item module
This class is a base class for nearly all configuration
elements like service, hosts or contacts.
-
class alignak.objects.item.Item(params={})[source]
Bases: object
Class to manage an item
An Item is the base of many objects of Alignak. So it define common properties,
common functions.
-
acknowledge_problem(sticky, notify, persistent, author, comment, end_time=0)[source]
Add an acknowledge
Parameters: |
- sticky (integer) – acknowledge will be always present is host return in UP state
- notify (integer) – if to 1, send a notification
- persistent (integer) – if 1, keep this acknowledge when Alignak restart
- author (str) – name of the author or the acknowledge
- comment (str) – comment (description) of the acknowledge
- end_time (int) – end (timeout) of this acknowledge in seconds(timestamp) (0 to never end)
|
Returns: | None
|
Add a comment to this object
Parameters: | comment (object) – a Comment object |
Returns: | None |
-
add_downtime(downtime)[source]
Add a downtime in this object
Parameters: | downtime (object) – a Downtime object |
Returns: | None |
-
check_for_expire_acknowledge()[source]
If have acknowledge and is expired, delete it
-
clean()[source]
Clean properties only need when initilize & configure
-
compact_unique_attr_value(val)[source]
Get value of first element of list if val is a list
Parameters: | val (list or other (string, integer...)) – simple value (string, integer...) or list |
Returns: | value |
Return type: | str |
-
copy()[source]
Get a copy of this item but with a new id
Returns: | copy of this object with a new id |
Return type: | object |
Delete a comment in this object
Parameters: | comment_id (int) – id of the comment to delete |
Returns: | None |
-
del_downtime(downtime_id)[source]
Delete a downtime in this object
Parameters: | downtime_id (int) – id of the downtime to delete |
Returns: | None |
-
dump()[source]
Dump properties
Returns: | dictionary with properties |
Return type: | dict |
-
explode_trigger_string_into_triggers(triggers)[source]
Add trigger to triggers if exist
Parameters: | triggers (object) – trigger object |
Returns: | None |
-
fill_data_brok_from(data, brok_type)[source]
Add properties to ‘data’ parameter with properties of this object when ‘brok_type’
parameter is defined in fill_brok of these properties
Parameters: |
- data (object) – object to fill
- brok_type (var) – name of brok_type
|
Returns: | None
|
-
fill_default()[source]
Define properties with default value when not defined
-
get_all_plus_and_delete()[source]
Get all self.plus items of list. We copy it, delete the original and return the copy list
Returns: | list of self.plus |
Return type: | list |
-
get_check_result_brok()[source]
Create check_result brok
Returns: | Brok object |
Return type: | object |
-
get_customs_properties_by_inheritance()[source]
Get custom properties from the templates defined in this object
Returns: | list of custom properties |
Return type: | list |
-
get_initial_status_brok()[source]
Create initial brok
Returns: | Brok object |
Return type: | object |
-
get_name()[source]
Get the name of the item
Returns: | the object name string |
Return type: | str |
-
get_next_schedule_brok()[source]
Create next_schedule (next check) brok
Returns: | Brok object |
Return type: | object |
-
get_plus_and_delete(prop)[source]
get a copy of the property (parameter) in self.plus, delete the original and return the
value of copy
Parameters: | prop (str) – a property |
Returns: | return the value of the property |
Return type: | str |
-
get_property_by_inheritance(prop)[source]
Get the property asked in parameter to this object or from defined templates of this
object
Parameters: | prop (str) – name of property |
Returns: | Value of property of this object or of a template |
Return type: | str or None |
-
get_property_value_for_brok(prop, tab)[source]
Get the property of an object and brok_transformation if needed and return the value
Parameters: |
- prop (str) – property name
- tab (object) – object with all properties of an object
|
Returns: | value of the property original or brok converted
|
Return type: | str
|
-
get_raw_import_values()[source]
Get properties => values of this object
Returns: | dictionary of properties => values |
Return type: | dict |
-
get_snapshot_brok(snap_output, exit_status)[source]
Create snapshot (check_result type) brok
Parameters: |
- snap_output (str) – value of output
- exit_status (integer) – status of exit
|
Returns: | Brok object
|
Return type: | object
|
-
get_templates()[source]
Get list of templates this object use
Returns: | list of templates |
Return type: | list |
-
get_update_status_brok()[source]
Create update brok
Returns: | Brok object |
Return type: | object |
-
has_plus(prop)[source]
Check if self.plus list have this property
Parameters: | prop (str) – property to check |
Returns: | True is self.plus have this property, otherwise False |
Return type: | bool |
-
id[source]
Getter for id, raise deprecation warning
-
init_running_properties()[source]
Init the running_properties.
Each instance have own property.
-
is_correct()[source]
Check if this object is correct
Returns: | True if it’s correct, otherwise False |
Return type: | bool |
-
is_tpl()[source]
Check if this object is a template
Returns: | True if is a template, else False |
Return type: | bool |
-
linkify_one_command_with_commands(commands, prop)[source]
Link a command
Parameters: |
- commands (object) – object commands
- prop (str) – property name
|
Returns: | None
|
-
linkify_with_triggers(triggers)[source]
Link with triggers
Parameters: | triggers (object) – Triggers object |
Returns: | None |
-
classmethod load_global_conf(conf)[source]
Load configuration of parent object
Parameters: |
- cls (object) – parent object
- conf (object) – current object (child)
|
Returns: | None
|
-
macros = {}
-
old_properties_names_to_new()[source]
This function is used by service and hosts to transform Nagios2 parameters to Nagios3
ones, like normal_check_interval to check_interval. There is a old_parameters tab
in Classes that give such modifications to do.
-
prepare_for_conf_sending()[source]
Flatten some properties tagged by the ‘conf_send_preparation’ because
they are too ‘linked’ to be send like that (like realms)
-
properties = {'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>}
-
running_properties = {'configuration_errors': <alignak.property.ListProp object at 0x7fd17a819690>, 'configuration_warnings': <alignak.property.ListProp object at 0x7fd17a819650>, 'tags': <alignak.property.ListProp object at 0x7fd17a8196d0>}
-
unacknowledge_problem()[source]
Remove the acknowledge, reset the flag. The comment is deleted except if the acknowledge
is defined to be persistent
-
unacknowledge_problem_if_not_sticky()[source]
Remove the acknowledge if it is not sticky
-
class alignak.objects.item.Items(items, index_items=True)[source]
Bases: object
Class to manage all Item
-
add_item(item, index=True)[source]
Add an item into our containers, and index it depending on the index flag.
Parameters: |
- item (object) – object to add
- index (bool) – Flag indicating if the item should be indexed
|
Returns: | None
|
-
add_items(items, index_items)[source]
Add items to template if is template, else add in item list
Parameters: |
- items (object) – items list to add
- index_items (bool) – Flag indicating if the items should be indexed on the fly.
|
Returns: | None
|
-
add_template(tpl)[source]
Add and index a template into the templates container.
Parameters: | tpl (object) – The template to add |
Returns: | None |
-
apply_inheritance()[source]
For all items and templates inherite properties and custom variables.
-
apply_partial_inheritance(prop)[source]
Define property with inherance value of the property
Parameters: | prop (str) – property |
Returns: | None |
-
clean()[source]
Request to remove the unnecessary attributes/others from our items
-
create_commandcall(prop, commands, command)[source]
Create commandCall object with command
Parameters: |
- prop (str) – property
- commands (object) – all commands
- command (object) – a command object
|
Returns: | a commandCall object
|
Return type: | object
|
-
evaluate_hostgroup_expression(expr, hosts, hostgroups, look_in='hostgroups')[source]
Evaluate hostgroup expression
Parameters: |
- expr (str) – an expression
- hosts (object) – hosts object (all hosts)
- hostgroups (object) – hostgroups object (all hostgroups)
- look_in (str) – item name where search
|
Returns: | return list of hostgroups
|
Return type: | list
|
-
explode_contact_groups_into_contacts(item, contactgroups)[source]
Get all contacts of contact_groups and put them in contacts container
Parameters: |
- item (object) – item where have contact_groups property
- contactgroups (object) – all contactgroups object
|
Returns: | None
|
-
explode_host_groups_into_hosts(item, hosts, hostgroups)[source]
Get all hosts of hostgroups and add all in host_name container
Parameters: |
- item (object) – the item object
- hosts (object) – hosts object
- hostgroups (object) – hostgroups object
|
Returns: | None
|
-
explode_trigger_string_into_triggers(triggers)[source]
Get al trigger in triggers and manage them
Parameters: | triggers (object) – triggers object |
Returns: | None |
-
fill_default()[source]
Define properties for each items with default value when not defined
-
find_by_filter(filters)[source]
Find items by filters
Parameters: | filters (list) – list of filters |
Returns: | list of items |
Return type: | list |
-
find_by_name(name)[source]
Find an item by name
Parameters: | name (str) – name of item |
Returns: | item |
Return type: | alignak.objects.item.Item |
-
find_tpl_by_name(name)[source]
Find template by name
Parameters: | name (str) – name of template |
Returns: | name of template found |
Return type: | str | None |
-
get_all_tags(item)[source]
Get all tags of an item
Parameters: | item (object) – an item |
Returns: | list of tags |
Return type: | list |
-
get_hosts_from_hostgroups(hgname, hostgroups)[source]
Get hosts of hostgroups
Parameters: |
- hgname (str) – hostgroup name
- hostgroups (object) – hostgroups object (all hostgroups)
|
Returns: | list of hosts
|
Return type: | list
|
-
get_source(item)[source]
Get source, so with what system we import this item
Parameters: | item (object) – item object |
Returns: | name of the source |
Return type: | str |
-
index_item(item)[source]
Indexe an item into our name_to_item dictionary.
If an object holding the same item’s name/key already exists in the index
then the conflict is managed by the manage_conflict method.
Parameters: | item (object) – item to index |
Returns: | item modified |
Return type: | object |
-
index_template(tpl)[source]
Indexes a template by name into the name_to_template dictionary.
Parameters: | tpl (object) – The template to index |
Returns: | None |
-
is_correct()[source]
Check if all items are correct (no error)
Returns: | True if correct, otherwise False |
Return type: | bool |
-
linkify_command_list_with_commands(commands, prop)[source]
Link a command list (commands with , between) in real CommandCalls
Parameters: |
- commands (object) – commands object
- prop (str) – property name
|
Returns: | None
|
-
linkify_item_templates(item)[source]
Link templates
Parameters: | item (object) – an item |
Returns: | None |
-
linkify_one_command_with_commands(commands, prop)[source]
Link a command to a property
Parameters: |
- commands (object) – commands object
- prop (str) – property name
|
Returns: | None
|
-
linkify_s_by_plug(modules)[source]
Link modules
Parameters: | modules (object) – modules object (all modules) |
Returns: | None |
-
linkify_templates()[source]
Link all templates, and create the template graph too
-
linkify_with_business_impact_modulations(business_impact_modulations)[source]
Link items with business impact objects
Parameters: | business_impact_modulations (object) – all business impacts object |
Returns: | None |
-
linkify_with_checkmodulations(checkmodulations)[source]
Link checkmodulation object
Parameters: | checkmodulations (object) – checkmodulations object |
Returns: | None |
-
linkify_with_contacts(contacts)[source]
Link items with contacts items
Parameters: | contacts (object) – all contacts object |
Returns: | None |
-
linkify_with_escalations(escalations)[source]
Link with escalations
Parameters: | escalations (object) – all escalations object |
Returns: | None |
-
linkify_with_macromodulations(macromodulations)[source]
Link macromodulations
Parameters: | macromodulations (object) – macromodulations object |
Returns: | None |
-
linkify_with_resultmodulations(resultmodulations)[source]
Link items with resultmodulations items
Parameters: | resultmodulations (object) – all resultmodulations object |
Returns: | None |
-
linkify_with_timeperiods(timeperiods, prop)[source]
Link items with timeperiods items
Parameters: |
- timeperiods (object) – all timeperiods object
- prop (str) – property name
|
Returns: | None
|
-
linkify_with_triggers(triggers)[source]
Link triggers
Parameters: | triggers (object) – triggers object |
Returns: | None |
-
manage_conflict(item, name, partial=False)[source]
Cheks if an object holding the same name already exists in the index.
If so, it compares their definition order: the lowest definition order
is kept. If definiton order equal, an error is risen.Item
The method returns the item that should be added after it has decided
which one should be kept.
If the new item has precedence over the New existing one, the
existing is removed for the new to replace it.
Parameters: |
- item (object) – object to check for conflict
- name (str) – name of the object
|
Returns: | ‘item’ parameter modified
|
Return type: | object
|
-
no_loop_in_parents(attr1, attr2)[source]
Find loop in dependencies.
For now, used with the following attributes :
:(self, parents):
host dependencies from host object
(host_name, dependent_host_name): |
| host dependencies from hostdependencies object
|
(service_description, dependent_service_description): |
| service dependencies from servicedependencies object
|
Parameters: |
- attr1 (str) – attribute name
- attr2 (str) – attribute name
|
Returns: | True if no loop, otherwise false
|
Return type: | bool
|
-
old_properties_names_to_new()[source]
Convert old Nagios2 names to Nagios3 new names
-
prepare_for_sending()[source]
flatten some properties
-
pythonize()[source]
Pythonize items
-
remove_item(item)[source]
Remove (and un-index) an object
Parameters: | item (object) – object to remove |
Returns: | None |
-
remove_template(tpl)[source]
Removes and un-index a template from the templates container.
Parameters: | tpl (object) – The template to remove |
Returns: | None |
-
remove_templates()[source]
Remove templates
-
unindex_item(item)[source]
Un-index an item from our name_to_item dict.
:param item: the item to un-index
:type item: object
:return: None
-
unindex_template(tpl)[source]
Unindex a template from the templates container.
Parameters: | tpl (object) – The template to un-index |
Returns: | None |
alignak.objects.itemgroup module
This module provide Itemgroup and Itemgroups class used to define group of items
-
class alignak.objects.itemgroup.Itemgroup(params={})[source]
Bases: alignak.objects.item.Item
Class to manage a group of items
An itemgroup is used to regroup items (group)
-
add_string_member(member)[source]
Add new entry(member) to members list
Parameters: | member (str) – member name |
Returns: | None |
-
add_string_unknown_member(member)[source]
Add new entry(member) to unknown members list
Parameters: | member (str) – member name |
Returns: | None |
-
copy_shell()[source]
Copy the groups properties EXCEPT the members.
Members need to be fill after manually
Returns: | Itemgroup object |
Return type: | object |
Returns: | None |
-
fill_default()[source]
Put property and it default value for properties not defined and not required
-
get_initial_status_brok()[source]
Get a brok with hostgroup info (like id, name)
Members contain list of (id, host_name)
:return:Brok object
:rtype: object
:return: None
-
has(prop)[source]
Check if self have a property
Parameters: | prop (string) – property name |
Returns: | True if self has this attribute, otherwise False |
Return type: | bool |
-
is_correct()[source]
Check if a group is valid.
Valid mean all members exists, so list of unknown_members is empty
Returns: | True if group is correct, otherwise False |
Return type: | bool |
-
properties = {'members': <alignak.property.ListProp object at 0x7fd17a751d50>, 'unknown_members': <alignak.property.ListProp object at 0x7fd17a751dd0>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>}
-
replace_members(members)[source]
Replace members of itemgroup by new members list
Parameters: | members (list) – list of members |
Returns: | None |
-
class alignak.objects.itemgroup.Itemgroups(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Class to manage list of groups of items
An itemgroups is used to regroup items group
-
add(itemgroup)[source]
Add an item (itemgroup) to Itemgroups
-
fill_default()[source]
Put property and it default value for properties not defined and not required in
each itemgroup
-
get_members_by_name(gname)[source]
Get members of groups have name in parameter
Parameters: | gname – name of group |
Rtype gname: | str |
Returns: | list of members |
Return type: | list |
alignak.objects.macromodulation module
This module provide MacroModulation and MacroModulations classes used to change critical and
warning level in some periods (like the night)
-
class alignak.objects.macromodulation.MacroModulation(params={})[source]
Bases: alignak.objects.item.Item
Class to manage a MacroModulation
A MacroModulation is defined to change critical and warning level in some periods (like the
night)
-
get_name()[source]
Get the name of the timeperiod
Returns: | the timeperiod name string |
Return type: | str |
-
is_active()[source]
Know if this macro is active for this correct period
Returns: | True is we are in the period, otherwise False |
Return type: | bool |
-
is_correct()[source]
Check if the macromodulation is valid and have all properties defined
Returns: | True if valide, otherwise False |
Return type: | bool |
-
macros = {}
-
my_type = 'macromodulation'
-
properties = {'macromodulation_name': <alignak.property.StringProp object at 0x7fd17a70fdd0>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'modulation_period': <alignak.property.StringProp object at 0x7fd17a70fe50>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>}
-
running_properties = {'configuration_errors': <alignak.property.ListProp object at 0x7fd17a819690>, 'configuration_warnings': <alignak.property.ListProp object at 0x7fd17a819650>, 'tags': <alignak.property.ListProp object at 0x7fd17a8196d0>}
-
class alignak.objects.macromodulation.MacroModulations(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Class to manage all MacroModulation
-
inner_class
alias of MacroModulation
-
linkify(timeperiods)[source]
Link with timeperiod
Parameters: | timeperiods (object) – Timeperiod object |
Returns: | None |
-
name_property = 'macromodulation_name'
alignak.objects.matchingitem module
This is a utility class for factorizing matching functions for
discovery runners and rules.
-
class alignak.objects.matchingitem.MatchingItem(params={})[source]
Bases: alignak.objects.item.Item
MatchingItem class provide function for regular expression matching
-
is_matching(key, value, look_in='matches')[source]
Try to see if the key,value is matching one or
our rule.
Parameters: |
- key – key to find in dict
- value – value to find at dict[key]
- look_in (str) – the attribute dict to look in (matches or not_matches)
|
Returns: | True if dict[key] match in value, otherwise False
|
Return type: | bool
|
-
is_matching_disco_datas(datas)[source]
Check if data match one of our matching attribute (matches or not_matches)
Parameters: | datas – data to parse |
Returns: | True if we match one pattern in matches and no pattern in not_matches,
otherwise False |
Return type: | bool |
alignak.objects.module module
This module provide Module and Modules classes used to manage internal and external modules
for each daemon
-
class alignak.objects.module.Module(params={})[source]
Bases: alignak.objects.item.Item
Class to manage a module
-
get_name()[source]
Get name of module
Returns: | Name of module |
Return type: | str |
-
macros = {}
-
my_type = 'module'
-
properties = {'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'modules': <alignak.property.ListProp object at 0x7fd17a6fcf50>, 'module_type': <alignak.property.StringProp object at 0x7fd17a6fcf10>, 'module_name': <alignak.property.StringProp object at 0x7fd17a6fce90>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>}
-
class alignak.objects.module.Modules(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Class to manage list of Module
Modules is used to regroup all Module
-
explode()[source]
Explode but not explode because this function is empty
-
inner_class
alias of Module
-
linkify()[source]
Link modules
-
linkify_s_by_plug()[source]
Link modules
-
name_property = 'module_name'
alignak.objects.notificationway module
This module provides NotificationWay and NotificationWays classes that
implements way of sending notifications. Basically used for parsing.
-
class alignak.objects.notificationway.NotificationWay(params={})[source]
Bases: alignak.objects.item.Item
NotificationWay class is used to implement way of sending notifications (command, periods..)
-
get_name()[source]
Accessor to notificationway_name attribute
Returns: | notificationway name |
Return type: | str |
-
get_notification_commands(o_type)[source]
Get notification commands for object type
Parameters: | o_type (str) – object type (host or service) |
Returns: | command list |
Return type: | list[alignak.objects.command.Command] |
-
is_correct()[source]
Check if this host configuration is correct
* All required parameter are specified
* Go through all configuration warnings and errors that could have been raised earlier
Returns: | True if the configuration is correct, otherwise False |
Return type: | bool |
-
macros = {}
-
my_type = 'notificationway'
-
old_properties = {'min_criticity': 'min_business_impact'}
-
properties = {'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'host_notification_commands': <alignak.property.ListProp object at 0x7fd17a772d10>, 'notificationway_name': <alignak.property.StringProp object at 0x7fd17a772b10>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'host_notifications_enabled': <alignak.property.BoolProp object at 0x7fd17a772b90>, 'service_notification_options': <alignak.property.ListProp object at 0x7fd17a772cd0>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'service_notification_period': <alignak.property.StringProp object at 0x7fd17a772c50>, 'min_business_impact': <alignak.property.IntegerProp object at 0x7fd17a772d90>, 'host_notification_options': <alignak.property.ListProp object at 0x7fd17a772c90>, 'service_notifications_enabled': <alignak.property.BoolProp object at 0x7fd17a772bd0>, 'host_notification_period': <alignak.property.StringProp object at 0x7fd17a772c10>, 'service_notification_commands': <alignak.property.ListProp object at 0x7fd17a772d50>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>}
-
running_properties = {'configuration_errors': <alignak.property.ListProp object at 0x7fd17a819690>, 'configuration_warnings': <alignak.property.ListProp object at 0x7fd17a819650>, 'tags': <alignak.property.ListProp object at 0x7fd17a8196d0>}
-
special_properties = ('service_notification_commands', 'host_notification_commands', 'service_notification_period', 'host_notification_period')
-
want_host_notification(timestamp, state, n_type, business_impact, cmd=None)[source]
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
* state does not match host_notification_options for problem, recovery, flapping and dt
Parameters: |
- timestamp (int) – time we want to notify the contact (usually now)
- state (str) – host or service state (“WARNING”, “CRITICAL” ..)
- n_type (str) – type of notification (“PROBLEM”, “RECOVERY” ..)
- business_impact (int) – impact of this service
- cmd (str) – command launched to notify the contact
|
Returns: | True if no condition is matched, otherwise False
|
Return type: | bool
|
TODO: Simplify function
-
want_service_notification(timestamp, state, n_type, business_impact, cmd=None)[source]
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 not valid
* state does not match service_notification_options for problem, recovery and flapping
* state does not match host_notification_options for downtime
Parameters: |
- timestamp (int) – time we want to notify the contact (usually now)
- state (str) – host or service state (“WARNING”, “CRITICAL” ..)
- n_type (str) – type of notification (“PROBLEM”, “RECOVERY” ..)
- business_impact (int) – impact of this service
- cmd (str) – command launched to notify the contact
|
Returns: | True if no condition is matched, otherwise False
|
Return type: | bool
|
TODO: Simplify function
-
class alignak.objects.notificationway.NotificationWays(items, index_items=True)[source]
Bases: alignak.objects.item.Items
NotificationWays manage a list of NotificationWay objects, used for parsing configuration
-
inner_class
alias of NotificationWay
-
linkify(timeperiods, commands)[source]
Create link between objects:
* notificationways -> timeperiods
* notificationways -> commands
-
name_property = 'notificationway_name'
-
new_inner_member(name=None, params={})[source]
Create new instance of NotificationWay with given name and parameters
and add it to the item list
Parameters: |
- name (str) – notification way name
- params (dict) – notification wat parameters
|
Returns: | None
|
alignak.objects.pack module
This module provide Pack and Packs classes used to define ‘group’ of configurations
-
class alignak.objects.pack.Pack(params={})[source]
Bases: alignak.objects.item.Item
Class to manage a Pack
A Pack contain multiple configuration files (like all checks for os ‘FreeBSD’)
-
get_name()[source]
Get the name of the pack
Returns: | the pack name string or ‘UnnamedPack’ |
Return type: | str |
-
my_type = 'pack'
-
properties = {'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'pack_name': <alignak.property.StringProp object at 0x7fd17a731bd0>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>}
-
running_properties = {'configuration_errors': <alignak.property.ListProp object at 0x7fd17a819690>, 'macros': <alignak.property.StringProp object at 0x7fd17a731c50>, 'configuration_warnings': <alignak.property.ListProp object at 0x7fd17a819650>, 'tags': <alignak.property.ListProp object at 0x7fd17a8196d0>}
-
class alignak.objects.pack.Packs(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Class to manage all Pack
-
create_pack(buf, name)[source]
Create pack with data from configuration file
Parameters: |
- buf (str) – buffer
- name (str) – name of file
|
Returns: | None
|
-
inner_class
alias of Pack
-
load_file(path)[source]
Load files in path parameter to load all configuration files with extension .pack
of the pack
Parameters: | path (str) – Path where file of pack are |
Returns: | None |
-
name_property = 'pack_name'
alignak.objects.pollerlink module
This module provide PollerLink and PollerLinks classes used to manage link
between the modules Arbiter and Poller
-
class alignak.objects.pollerlink.PollerLink(*args, **kwargs)[source]
Bases: alignak.objects.satellitelink.SatelliteLink
Class to manage the link between Arbiter and Poller. With it, arbiter
can see if a poller is alive, and can send it new configuration
-
my_type = 'poller'
-
properties = {'poller_name': <alignak.property.StringProp object at 0x7fd17a6cd910>, 'check_interval': <alignak.property.IntegerProp object at 0x7fd17a6c1610>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'poller_tags': <alignak.property.ListProp object at 0x7fd17a6cda90>, 'hard_ssl_name_check': <alignak.property.BoolProp object at 0x7fd17a6c1950>, 'use_timezone': <alignak.property.StringProp object at 0x7fd17a6c17d0>, 'spare': <alignak.property.BoolProp object at 0x7fd17a6c1690>, 'address': <alignak.property.StringProp object at 0x7fd17a6c1510>, 'use_ssl': <alignak.property.BoolProp object at 0x7fd17a6c1910>, 'manage_arbiters': <alignak.property.BoolProp object at 0x7fd17a6c1710>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'passive': <alignak.property.BoolProp object at 0x7fd17a6c1990>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'realm': <alignak.property.StringProp object at 0x7fd17a6c1810>, 'data_timeout': <alignak.property.IntegerProp object at 0x7fd17a6c15d0>, 'max_workers': <alignak.property.IntegerProp object at 0x7fd17a6cda10>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'modules': <alignak.property.ListProp object at 0x7fd17a6c1750>, 'port': <alignak.property.IntegerProp object at 0x7fd17a6cd990>, 'manage_sub_realms': <alignak.property.BoolProp object at 0x7fd17a6c16d0>, 'satellitemap': <alignak.property.DictProp object at 0x7fd17a6c1850>, 'timeout': <alignak.property.IntegerProp object at 0x7fd17a6c1590>, 'polling_interval': <alignak.property.IntegerProp object at 0x7fd17a6c1790>, 'max_check_attempts': <alignak.property.IntegerProp object at 0x7fd17a6c1650>, 'min_workers': <alignak.property.IntegerProp object at 0x7fd17a6cd9d0>, 'processes_by_worker': <alignak.property.IntegerProp object at 0x7fd17a6cda50>}
-
register_to_my_realm()[source]
Add this relation to the realm
-
class alignak.objects.pollerlink.PollerLinks(items, index_items=True)[source]
Bases: alignak.objects.satellitelink.SatelliteLinks
Class to manage list of PollerLink.
PollerLinks is used to regroup all links between the Arbiter and different Pollers
-
inner_class
alias of PollerLink
-
name_property = 'poller_name'
alignak.objects.reactionnerlink module
This module provide ReactionnerLink and ReactionnerLinks classes used to manage reactionners
-
class alignak.objects.reactionnerlink.ReactionnerLink(*args, **kwargs)[source]
Bases: alignak.objects.satellitelink.SatelliteLink
Class to manage the reactionner information
-
my_type = 'reactionner'
-
properties = {'check_interval': <alignak.property.IntegerProp object at 0x7fd17a6c1610>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'hard_ssl_name_check': <alignak.property.BoolProp object at 0x7fd17a6c1950>, 'reactionner_name': <alignak.property.StringProp object at 0x7fd17a6cd1d0>, 'use_timezone': <alignak.property.StringProp object at 0x7fd17a6c17d0>, 'spare': <alignak.property.BoolProp object at 0x7fd17a6c1690>, 'address': <alignak.property.StringProp object at 0x7fd17a6c1510>, 'use_ssl': <alignak.property.BoolProp object at 0x7fd17a6c1910>, 'manage_arbiters': <alignak.property.BoolProp object at 0x7fd17a6c1710>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'passive': <alignak.property.BoolProp object at 0x7fd17a6c1990>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'realm': <alignak.property.StringProp object at 0x7fd17a6c1810>, 'data_timeout': <alignak.property.IntegerProp object at 0x7fd17a6c15d0>, 'max_workers': <alignak.property.IntegerProp object at 0x7fd17a6cd2d0>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'modules': <alignak.property.ListProp object at 0x7fd17a6c1750>, 'port': <alignak.property.IntegerProp object at 0x7fd17a6cd250>, 'manage_sub_realms': <alignak.property.BoolProp object at 0x7fd17a6c16d0>, 'satellitemap': <alignak.property.DictProp object at 0x7fd17a6c1850>, 'reactionner_tags': <alignak.property.ListProp object at 0x7fd17a6cd350>, 'timeout': <alignak.property.IntegerProp object at 0x7fd17a6c1590>, 'polling_interval': <alignak.property.IntegerProp object at 0x7fd17a6c1790>, 'max_check_attempts': <alignak.property.IntegerProp object at 0x7fd17a6c1650>, 'min_workers': <alignak.property.IntegerProp object at 0x7fd17a6cd290>, 'processes_by_worker': <alignak.property.IntegerProp object at 0x7fd17a6cd310>}
-
register_to_my_realm()[source]
Add this reactionner to the realm
-
class alignak.objects.reactionnerlink.ReactionnerLinks(items, index_items=True)[source]
Bases: alignak.objects.satellitelink.SatelliteLinks
Class to manage list of ReactionnerLink.
ReactionnerLinks is used to regroup all reactionners
-
inner_class
alias of ReactionnerLink
-
name_property = 'reactionner_name'
alignak.objects.realm module
This module provides Realm and Realms classes that
implements realm for Alignak. Basically used for parsing.
-
class alignak.objects.realm.Realm(params={})[source]
Bases: alignak.objects.itemgroup.Itemgroup
Realm class is used to implement realm. It is basically a set of Host or Service
assigned to a specific set of Scheduler/Poller (other daemon are optional)
-
add_string_member(member)[source]
Add a realm to realm_members attribute
Parameters: | member – realm name to add |
Returns: | None |
TODO : Clean this self.members != self.realm_members?
-
count_brokers()[source]
Set the number of brokers in this realm.
TODO: Make this generic
-
count_pollers()[source]
Set the number of pollers in this realm.
-
count_reactionners()[source]
Set the number of reactionners in this realm.
TODO: Make this generic
-
count_receivers()[source]
Set the number of receivers in this realm.
TODO: Make this generic
-
fill_broker_with_poller_reactionner_links(broker)[source]
Fill brokerlink object with satellite data
Parameters: | broker (alignak.objects.brokerlink.Brokerlink) – broker link we want to fill |
Returns: | None |
-
fill_potential_satellites_by_type(sat_type)[source]
Edit potential_*sat_type* attribute to get potential satellite from upper level realms
Parameters: | sat_type (str) – satellite type wanted |
Returns: | None |
-
get_all_subs_satellites_by_type(sat_type)[source]
Get all satellites of the wated type in this realm recursively
Parameters: | sat_type – satelitte type wanted (scheduler, poller ..) |
Returns: | list of satellite in this realm |
Return type: | list |
TODO: Make this generic
-
get_name()[source]
Accessor to realm_name attribute
Returns: | realm name |
Return type: | str |
-
get_nb_of_must_have_satellites(s_type)[source]
Generic function to access one of the number satellite attribute
ie : self.nb_pollers, self.nb_reactionners ...
Parameters: | s_type (str) – satellite type wanted |
Returns: | self.nb_*type*s |
Return type: | int |
-
get_potential_satellites_by_type(s_type)[source]
Generic function to access one of the potential satellite attribute
ie : self.potential_pollers, self.potential_reactionners ...
Parameters: | s_type (str) – satellite type wanted |
Returns: | self.potential_*type*s |
Return type: | list |
-
get_realm_members()[source]
Get list of members of this realm
Returns: | list of realm (members) |
Return type: | list |
-
get_realms()[source]
Get list of members of this realm
Returns: | list of realm (members) |
Return type: | list |
TODO: Duplicate of get_realm_members
-
get_realms_by_explosion(realms)[source]
Get all members of this realm including members of sub-realms
Parameters: | realms (alignak.objects.realm.Realms) – realms list, used to look for a specific one |
Returns: | list of members and add realm to realm_members attribute |
Return type: | list |
TODO: Clean this function that silently edit realm_members.
-
get_satellites_links_for_scheduler()[source]
Get a configuration dict with pollers and reactionners data
Returns: | dict containing pollers and reactionners config (key is satellite id) |
Return type: | dict |
-
get_satellties_by_type(s_type)[source]
Generic function to access one of the satellite attribute
ie : self.pollers, self.reactionners ...
Parameters: | s_type (str) – satellite type wanted |
Returns: | self.*type*s |
Return type: | list |
-
macros = {'REALMNAME': 'realm_name', 'REALMMEMBERS': 'members'}
-
my_type = 'realm'
-
prepare_for_satellites_conf()[source]
Init the following attributes:
* to_satellites (with *satellite type* keys)
* to_satellites_need_dispatch (with *satellite type* keys)
* to_satellites_managed_by (with *satellite type* keys)
* nb_*satellite type*s
* self.potential_*satellite type*s
(satellite type are reactionner, poller, broker and receiver)
-
properties = {'higher_realms': <alignak.property.ListProp object at 0x7fd17a75b650>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'realm_members': <alignak.property.ListProp object at 0x7fd17a75b610>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'realm_name': <alignak.property.StringProp object at 0x7fd17a75b5d0>, 'unknown_members': <alignak.property.ListProp object at 0x7fd17a751dd0>, 'default': <alignak.property.BoolProp object at 0x7fd17a75b690>, 'broker_complete_links': <alignak.property.BoolProp object at 0x7fd17a75b6d0>, 'members': <alignak.property.ListProp object at 0x7fd17a751d50>, '_id': <alignak.property.IntegerProp object at 0x7fd17a75b550>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>}
-
running_properties = {'configuration_errors': <alignak.property.ListProp object at 0x7fd17a819690>, 'configuration_warnings': <alignak.property.ListProp object at 0x7fd17a819650>, 'serialized_confs': <alignak.property.DictProp object at 0x7fd17a75b710>, 'tags': <alignak.property.ListProp object at 0x7fd17a8196d0>}
-
class alignak.objects.realm.Realms(items, index_items=True)[source]
Bases: alignak.objects.itemgroup.Itemgroups
Realms manage a list of Realm objects, used for parsing configuration
-
explode()[source]
Explode realms with each realm_members
-
get_default()[source]
Get the default realm
Returns: | Default realm of Alignak configuration |
Return type: | alignak.objects.realm.Realm | None |
-
get_members_by_name(pname)[source]
Get realm_members for a specific realm
Parameters: | pname – realm name |
Type: | str |
Returns: | list of realm members |
Return type: | list |
-
inner_class
alias of Realm
-
linkify()[source]
Links sub-realms (parent / son),
add new realm_members,
and init each realm following attributes
* pollers : []
* schedulers : []
* reactionners.: []
* brokers: : []
* receivers: : []
* packs: : []
* confs: : {}
-
linkify_p_by_p()[source]
Links sub-realms (parent / son)
and add new realm_members
-
name_property = 'realm_name'
-
prepare_for_satellites_conf()[source]
Wrapper to loop over each reach and call Realm.prepare_for_satellites_conf()
-
recur_higer_realms(parent_r, sons)[source]
Add sub-realms (parent / son)
alignak.objects.receiverlink module
This module provide ReceiverLink and ReceiverLinks classes used to manage receivers
-
class alignak.objects.receiverlink.ReceiverLink(*args, **kwargs)[source]
Bases: alignak.objects.satellitelink.SatelliteLink
Class to manage the receiver information
-
my_type = 'receiver'
-
properties = {'check_interval': <alignak.property.IntegerProp object at 0x7fd17a6c1610>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'receiver_name': <alignak.property.StringProp object at 0x7fd17a6cd690>, 'hard_ssl_name_check': <alignak.property.BoolProp object at 0x7fd17a6c1950>, 'use_timezone': <alignak.property.StringProp object at 0x7fd17a6c17d0>, 'spare': <alignak.property.BoolProp object at 0x7fd17a6c1690>, 'address': <alignak.property.StringProp object at 0x7fd17a6c1510>, 'use_ssl': <alignak.property.BoolProp object at 0x7fd17a6c1910>, 'manage_arbiters': <alignak.property.BoolProp object at 0x7fd17a6cd790>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'passive': <alignak.property.BoolProp object at 0x7fd17a6c1990>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'realm': <alignak.property.StringProp object at 0x7fd17a6c1810>, 'data_timeout': <alignak.property.IntegerProp object at 0x7fd17a6c15d0>, 'direct_routing': <alignak.property.BoolProp object at 0x7fd17a6cd7d0>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'modules': <alignak.property.ListProp object at 0x7fd17a6c1750>, 'port': <alignak.property.IntegerProp object at 0x7fd17a6cd710>, 'manage_sub_realms': <alignak.property.BoolProp object at 0x7fd17a6cd750>, 'satellitemap': <alignak.property.DictProp object at 0x7fd17a6c1850>, 'timeout': <alignak.property.IntegerProp object at 0x7fd17a6c1590>, 'polling_interval': <alignak.property.IntegerProp object at 0x7fd17a6c1790>, 'max_check_attempts': <alignak.property.IntegerProp object at 0x7fd17a6c1650>, 'accept_passive_unknown_check_results': <alignak.property.BoolProp object at 0x7fd17a6cd810>}
-
push_host_names(sched_id, hnames)[source]
Send host names to receiver
Parameters: |
- sched_id (int) – id of the scheduler
- hnames (list) – list of host names
|
Returns: | None
|
-
register_to_my_realm()[source]
Add this reactionner to the realm
-
class alignak.objects.receiverlink.ReceiverLinks(items, index_items=True)[source]
Bases: alignak.objects.satellitelink.SatelliteLinks
Class to manage list of ReceiverLink.
ReceiverLinks is used to regroup all receivers
-
inner_class
alias of ReceiverLink
-
name_property = 'receiver_name'
alignak.objects.resultmodulation module
This module provide Resultmodulation and Resultmodulations classes used to describe
the modulation of a check command. Modulation occurs on a modulation period (Timeperiod)
-
class alignak.objects.resultmodulation.Resultmodulation(params={})[source]
Bases: alignak.objects.item.Item
Resultmodulation class is simply a modulation of a check result exit code
during a modulation_period.
-
get_name()[source]
Accessor to resultmodulation_name attribute
Returns: | result modulation name |
Return type: | str |
-
module_return(return_code)[source]
Module the exit code if necessary
* modulation_period is legit
* exit_code_modulation
* return_code in exit_codes_match
Parameters: | return_code (int) – actual code returned by the check |
Returns: | return_code modulated if necessary (exit_code_modulation) |
Return type: | int |
-
my_type = 'resultmodulation'
-
properties = {'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'resultmodulation_name': <alignak.property.StringProp object at 0x7fd17a794590>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'modulation_period': <alignak.property.StringProp object at 0x7fd17a794690>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'exit_code_modulation': <alignak.property.IntegerProp object at 0x7fd17a794650>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'exit_codes_match': <alignak.property.IntListProp object at 0x7fd17a794610>}
-
pythonize()[source]
Pythonization function for Resultmodulation.
We override it because we need to convert exit code into integers
-
class alignak.objects.resultmodulation.Resultmodulations(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Resultmodulations class allowed to handle easily several CheckModulation objects
-
inner_class
alias of Resultmodulation
-
linkify(timeperiods)[source]
Wrapper for linkify_rm_by_tp
Replace check_period by real Timeperiod object into each Resultmodulation
-
linkify_rm_by_tp(timeperiods)[source]
Replace check_period by real Timeperiod object into each Resultmodulation
-
name_property = 'resultmodulation_name'
alignak.objects.satellitelink module
This module provides an abstraction layer for communications between Alignak daemons
Used by the Arbiter
-
class alignak.objects.satellitelink.SatelliteLink(*args, **kwargs)[source]
Bases: alignak.objects.item.Item
SatelliteLink is a common Class for links between
Arbiter and other satellites. Used by the Dispatcher object.
-
add_failed_check_attempt(reason='')[source]
Go in reachable=False and add a failed attempt
if we reach the max, go dead
Parameters: | reason (str) – the reason of adding an attemps (stack trace sometimes) |
Returns: | None |
-
add_global_conf_parameters(params)[source]
Add some extra params in cfg dict attribute.
Some attributes are in the global configuration
Parameters: | params (dict) – dict to update cfg with |
Returns: | None |
-
create_connection()[source]
Initialize HTTP connection with a satellite (con attribute) and
set uri attribute
-
do_i_manage(cfg_id, push_flavor)[source]
Tell if the satellite is managing cfg_id with push_flavor
Parameters: |
- cfg_id (int) – config id
- push_flavor (int) – flavor id, random it generated at parsing
|
Returns: | True if the satellite has push_flavor in managed_confs[cfg_id]
|
Return type: | bool
|
-
get_all_broks()[source]
Get and clean all of our broks
Returns: | list of all broks in the satellite |
Return type: | list |
-
get_external_commands()[source]
Send a HTTP request to the satellite (GET /ping)
and THEN send a HTTP request to the satellite (GET /get_external_commands)
Get external commands from satellite.
Unpickle data received.
Returns: | External Command list on succes, [] on failure |
Return type: | list |
-
get_my_type()[source]
Get the satellite type. Accessor to __class__.mytype
ie : poller, scheduler, receiver, broker, arbiter or reactionner
Returns: | Satellite type |
Return type: | str |
-
get_name()[source]
Get the name of the link based on its type
if mytype*_name is an attribute then returns self.*mytype*_name.
otherwise returns “Unnamed *mytype”
Example : self.poller_name or “Unnamed poller”
Returns: | String corresponding to the link name |
Return type: | str |
-
give_satellite_cfg()[source]
Get a configuration for this satellite.
Not used by Scheduler and Arbiter (overridden)
Returns: | Configuration for satellite |
Return type: | dict |
-
have_conf(magic_hash=None)[source]
Send a HTTP request to the satellite (GET /have_conf)
Used to know if the satellite has a conf
Parameters: | magic_hash (int) – Config hash. Only used for HA arbiter communication |
Returns: | Boolean indicating if the satellite has a (specific) configuration |
Type: | bool |
-
known_conf_managed_push(cfg_id, push_flavor)[source]
- The elements just got a new conf_id, we put it in our list
- because maybe the satellite is too busy to answer now
Parameters: |
- cfg_id (int) – config id
- push_flavor (int) – push_flavor we pushed earlier to the satellite
|
Returns: | None
|
-
ping()[source]
Send a HTTP request to the satellite (GET /ping)
Add failed attempt if an error occurs
Otherwise, set alive this satellite
-
prepare_for_conf()[source]
Init cfg dict attribute with __class__.properties
and extra __class__ attribute
(like __init__ could do with an object)
-
properties = {'timeout': <alignak.property.IntegerProp object at 0x7fd17a6c1590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'hard_ssl_name_check': <alignak.property.BoolProp object at 0x7fd17a6c1950>, 'use_timezone': <alignak.property.StringProp object at 0x7fd17a6c17d0>, 'spare': <alignak.property.BoolProp object at 0x7fd17a6c1690>, 'address': <alignak.property.StringProp object at 0x7fd17a6c1510>, 'use_ssl': <alignak.property.BoolProp object at 0x7fd17a6c1910>, 'realm': <alignak.property.StringProp object at 0x7fd17a6c1810>, 'manage_arbiters': <alignak.property.BoolProp object at 0x7fd17a6c1710>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'manage_sub_realms': <alignak.property.BoolProp object at 0x7fd17a6c16d0>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'data_timeout': <alignak.property.IntegerProp object at 0x7fd17a6c15d0>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'modules': <alignak.property.ListProp object at 0x7fd17a6c1750>, 'passive': <alignak.property.BoolProp object at 0x7fd17a6c1990>, 'satellitemap': <alignak.property.DictProp object at 0x7fd17a6c1850>, 'check_interval': <alignak.property.IntegerProp object at 0x7fd17a6c1610>, 'polling_interval': <alignak.property.IntegerProp object at 0x7fd17a6c1790>, 'max_check_attempts': <alignak.property.IntegerProp object at 0x7fd17a6c1650>}
-
push_broks(broks)[source]
Send a HTTP request to the satellite (GET /ping)
and THEN Send a HTTP request to the satellite (POST /push_broks)
Send broks to the satellite
The first ping ensure the satellite is there to avoid a big timeout
Parameters: | broks (list) – Brok list to send |
Returns: | True on success, False on failure |
Return type: | bool |
-
put_conf(conf)[source]
Send the conf (serialized) to the satellite
HTTP request to the satellite (POST / put_conf)
Parameters: | conf – The conf to send (data depend on the satellite) |
Returns: | None |
-
remove_from_conf(sched_id)[source]
Send a HTTP request to the satellite (GET /remove_from_conf)
Tell a satellite to remove a scheduler from conf
Parameters: | sched_id (int) – scheduler id to remove |
Returns: | True on success, False on failure, None if can’t connect |
Return type: | bool | None |
TODO: Return False instead of None
-
running_properties = {'configuration_errors': <alignak.property.ListProp object at 0x7fd17a819690>, 'broks': <alignak.property.StringProp object at 0x7fd17a6c1a50>, 'attempt': <alignak.property.StringProp object at 0x7fd17a6c1a90>, 'tags': <alignak.property.ListProp object at 0x7fd17a8196d0>, 'alive': <alignak.property.BoolProp object at 0x7fd17a6c1a10>, 'last_check': <alignak.property.IntegerProp object at 0x7fd17a6c1b10>, 'configuration_warnings': <alignak.property.ListProp object at 0x7fd17a819650>, 'managed_confs': <alignak.property.StringProp object at 0x7fd17a6c1b50>, 'reachable': <alignak.property.BoolProp object at 0x7fd17a6c1ad0>, 'con': <alignak.property.StringProp object at 0x7fd17a6c19d0>}
-
set_alive()[source]
Set alive, reachable, and reset attempts.
If we change state, raise a status brok update
-
set_arbiter_satellitemap(satellitemap)[source]
- arb_satmap is the satellitemap in current context:
- A SatelliteLink is owned by an Arbiter
- satellitemap attribute of SatelliteLink is the map
defined IN THE satellite configuration
but for creating connections, we need the have the satellitemap of the Arbiter
-
set_dead()[source]
Set the satellite into dead state:
- Alive -> False
- con -> None
Create an update Brok
:return:None
-
update_infos()[source]
Update satellite info each self.check_interval seconds
so we smooth arbiter actions for just useful actions.
Create update Brok
-
update_managed_list()[source]
Send a HTTP request to the satellite (GET /what_i_managed)
and update managed_conf attribute with dict (cleaned)
Set to {} on failure
-
wait_new_conf()[source]
Send a HTTP request to the satellite (GET /wait_new_conf)
Returns: | True if wait new conf, otherwise False |
Return type: | bool |
-
class alignak.objects.satellitelink.SatelliteLinks(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Class to handle serveral SatelliteLink
-
linkify(realms, modules)[source]
Link realms and modules in all SatelliteLink
(Link a real Realm / Module python object to the SatelliteLink attribute)
Parameters: |
- realms (list) – Realm object list
- modules (list) – Module object list
|
Returns: | None
|
-
linkify_s_by_p(realms)[source]
Link realms in all SatelliteLink
Parameters: | realms (list) – Realm object list |
Returns: | None |
alignak.objects.schedulerlink module
This module provide SchedulerLink and SchedulerLinks classes used to manage schedulers
-
class alignak.objects.schedulerlink.SchedulerLink(*args, **kwargs)[source]
Bases: alignak.objects.satellitelink.SatelliteLink
Class to manage the scheduler information
-
get_override_configuration()[source]
Some parameters can give as ‘overridden parameters’ like use_timezone
so they will be mixed (in the scheduler) with the standard conf sent by the arbiter
Returns: | dictionary of properties |
Return type: | dict |
-
give_satellite_cfg()[source]
Get configuration of the scheduler satellite
Returns: | dictionary of scheduler information |
Return type: | dict |
-
my_type = 'scheduler'
-
properties = {'check_interval': <alignak.property.IntegerProp object at 0x7fd17a6c1610>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'hard_ssl_name_check': <alignak.property.BoolProp object at 0x7fd17a6c1950>, 'weight': <alignak.property.IntegerProp object at 0x7fd17a6c1f50>, 'use_timezone': <alignak.property.StringProp object at 0x7fd17a6c17d0>, 'spare': <alignak.property.BoolProp object at 0x7fd17a6c1690>, 'address': <alignak.property.StringProp object at 0x7fd17a6c1510>, 'use_ssl': <alignak.property.BoolProp object at 0x7fd17a6c1910>, 'manage_arbiters': <alignak.property.BoolProp object at 0x7fd17a6c1710>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'scheduler_name': <alignak.property.StringProp object at 0x7fd17a6c1e90>, 'passive': <alignak.property.BoolProp object at 0x7fd17a6c1990>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'realm': <alignak.property.StringProp object at 0x7fd17a6c1810>, 'data_timeout': <alignak.property.IntegerProp object at 0x7fd17a6c15d0>, 'skip_initial_broks': <alignak.property.BoolProp object at 0x7fd17a6c1f90>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'modules': <alignak.property.ListProp object at 0x7fd17a6c1750>, 'port': <alignak.property.IntegerProp object at 0x7fd17a6c1f10>, 'manage_sub_realms': <alignak.property.BoolProp object at 0x7fd17a6c16d0>, 'satellitemap': <alignak.property.DictProp object at 0x7fd17a6c1850>, 'timeout': <alignak.property.IntegerProp object at 0x7fd17a6c1590>, 'polling_interval': <alignak.property.IntegerProp object at 0x7fd17a6c1790>, 'max_check_attempts': <alignak.property.IntegerProp object at 0x7fd17a6c1650>, 'accept_passive_unknown_check_results': <alignak.property.BoolProp object at 0x7fd17a6c1fd0>}
-
register_to_my_realm()[source]
Add this reactionner to the realm
-
run_external_commands(commands)[source]
Run external commands
Parameters: | commands – |
Returns: | False, None |
Return type: | bool | None |
TODO: need recode this fonction because return types are too many
-
running_properties = {'configuration_errors': <alignak.property.ListProp object at 0x7fd17a819690>, 'broks': <alignak.property.StringProp object at 0x7fd17a6c1a50>, 'external_commands': <alignak.property.StringProp object at 0x7fd17a6cd0d0>, 'attempt': <alignak.property.StringProp object at 0x7fd17a6c1a90>, 'conf': <alignak.property.StringProp object at 0x7fd17a6cd050>, 'tags': <alignak.property.ListProp object at 0x7fd17a8196d0>, 'alive': <alignak.property.BoolProp object at 0x7fd17a6c1a10>, 'last_check': <alignak.property.IntegerProp object at 0x7fd17a6c1b10>, 'need_conf': <alignak.property.StringProp object at 0x7fd17a6cd090>, 'configuration_warnings': <alignak.property.ListProp object at 0x7fd17a819650>, 'managed_confs': <alignak.property.StringProp object at 0x7fd17a6c1b50>, 'reachable': <alignak.property.BoolProp object at 0x7fd17a6c1ad0>, 'push_flavor': <alignak.property.IntegerProp object at 0x7fd17a6cd110>, 'con': <alignak.property.StringProp object at 0x7fd17a6c19d0>}
-
class alignak.objects.schedulerlink.SchedulerLinks(items, index_items=True)[source]
Bases: alignak.objects.satellitelink.SatelliteLinks
Please Add a Docstring to describe the class here
-
inner_class
alias of SchedulerLink
-
name_property = 'scheduler_name'
alignak.objects.schedulingitem module
This class is a common one for service/host. Here you
will find all scheduling related functions, like the schedule
or the consume_check. It’s a very important class!
-
class alignak.objects.schedulingitem.SchedulingItem(params={})[source]
Bases: alignak.objects.item.Item
SchedulingItem class provide method for Scheduler to handle Service or Host objects
-
add_attempt()[source]
Add an attempt when a object is a non-ok state
-
add_flapping_change(sample)[source]
Add a flapping sample and keep cls.flap_history samples
Parameters: | sample (bool) – Sample to add |
Returns: | None |
-
business_rule_notification_is_blocked()[source]
Process business rule notifications behaviour. If all problems have
been acknowledged, no notifications should be sent if state is not OK.
By default, downtimes are ignored, unless explicitly told to be treated
as acknowledgements through with the business_rule_downtime_as_ack set.
Returns: | True if all source problem are acknowledged, otherwise False |
Return type: | bool |
-
check_and_set_unreachability()[source]
Check if all network dependencies are down and set this object
as unreachable if so.
TODO: factorize with previous check?
-
check_for_flexible_downtime()[source]
Enter in a dowtime if necessary and raise start notification
When a non Ok state occurs we try to raise a flexible downtime.
-
compensate_system_time_change(difference)[source]
If a system time change occurs we have to update
properties time related to reflect change
Parameters: | difference – difference between new time and old time |
Returns: | None |
-
consume_result(chk)[source]
Consume a check return and send action in return
main function of reaction of checks like raise notifications
Special cases:
* is_flapping: immediate notif when problem
* is_in_scheduled_downtime: no notification
* is_volatile: notif immediately (service only)
Basically go through all cases (combination of last_state, current_state, attempt number)
and do necessary actions (add attempt, raise notification., change state type.)
Parameters: | chk (alignak.objects.check.Check) – check to handle |
Returns: | None |
-
create_business_rules(hosts, services, running=False)[source]
Create business rules if necessary (cmd contains bp_rule)
-
create_business_rules_dependencies()[source]
If I’m a business rule service/host, I register myself to the
elements I will depend on, so They will have ME as an impact
-
create_notifications(n_type, t_wished=None)[source]
Create a “master” notification here, which will later
(immediately before the reactionner gets it) be split up
in many “child” notifications, one for each contact.
Parameters: |
- n_type (str) – notification type (“PROBLEM”, “RECOVERY” ...)
- t_wished (int) – time we want to notify
|
Returns: | None
|
-
current_event_id = 0
-
current_problem_id = 0
-
deregister_a_problem(prob)[source]
Remove the problem from our problems list
and check if we are still ‘impacted’
-
disable_active_checks()[source]
Disable active checks for this host/service
Update check in progress with current object information
-
do_check_freshness()[source]
Check freshness and schedule a check now if necessary.
Returns: | A check or None |
Return type: | None | object |
-
do_i_raise_dependency(status, inherit_parents)[source]
Check if this object or one of its dependency state (chk dependencies) match the status
Parameters: |
- status (list) – state list where dependency matters (notification failure criteria)
- inherit_parents (bool) – recurse over parents
|
Returns: | True if one state matched the status list, otherwise False
|
Return type: | bool
|
-
eval_triggers()[source]
Launch triggers
-
fill_data_brok_from(data, brok_type)[source]
Fill data brok dependending onthe brok_type
Parameters: |
- data (dict) – data to fill
- brok_type – brok type
|
Type: | str
|
Returns: | None
|
-
get_business_rule_output()[source]
Returns a status string for business rules based items formatted
using business_rule_output_template attribute as template.
The template may embed output formatting for itself, and for its child
(dependant) itmes. Childs format string is expanded into the $( and )$,
using the string between brackets as format string.
Any business rule based item or child macros may be used. In addition,
the $STATUS$, $SHORTSTATUS$ and $FULLNAME$ macro which name is common
to hosts and services may be used to ease template writing.
Caution: only childs in state not OK are displayed.
- Example:
- A business rule with a format string looking like
- “$STATUS$ [ $($TATUS$: $HOSTNAME$,$SERVICEDESC$ )$ ]”
- Would return
- “CRITICAL [ CRITICAL: host1,srv1 WARNING: host2,srv2 ]”
Returns: | status for business rules |
Return type: | str |
-
get_escalable_contacts(notif)[source]
Get all contacts (uniq) from eligible escalations
Parameters: | notif (alignak.objects.notification.Notification) – Notification to get data from (notif number...) |
Returns: | Contact list that can be notified for escalation |
Return type: | list[alignak.objects.contact.Contact] |
-
get_event_handlers(externalcmd=False)[source]
Raise event handlers if NONE of the following conditions is met:
* externalcmd is False and event_handlers are disabled (globally or locally)
* externalcmd is False and object is in scheduled dowtime and no event handlers in downtime
* self.event_handler and cls.global_event_handler are None
Parameters: | externalcmd (bool) – tells if this function was called when handling an external_command. |
Returns: | None |
-
get_next_notification_time(notif)[source]
Get the next notification time for a notification
Take the standard notification_interval or ask for our escalation
if one of them need a smaller value to escalade
Parameters: | notif (alignak.objects.notification.Notification) – Notification we need time |
Returns: | Timestamp of next notification |
Return type: | int |
-
get_perfdata_command()[source]
Add event_handler to process performance data if necessary (not disabled)
-
get_snapshot()[source]
Raise snapshot event handlers if NONE of the following conditions is met:
* snapshot_command is None
* snapshot_enabled is disabled
* snapshot_criteria does not matches current state
* last_snapshot > now - snapshot_interval * interval_length (previous snapshot too early)
* snapshot_period is not valid
-
get_time_to_orphanage()[source]
Get time to orphanage
* 0 : don't check for orphans
* non zero : number of secs that can pass before marking the check an orphan.
Returns: | integer with the meaning explained above |
Return type: | int |
-
is_escalable(notif)[source]
Check if a notification can be escalated.
Basically call is_eligible for each escalation
Parameters: | notif (alignak.objects.notification.Notification) – notification we would like to escalate |
Returns: | True if notification can be escalated, otherwise False |
Return type: | bool |
-
is_max_attempts()[source]
Check if max check attempt is reached
Returns: | True if self.attempt >= self.max_check_attempts, otherwise False |
Return type: | bool |
-
is_no_action_dependent()[source]
Check if dependencies states (logic or network) match dependencies statuses
This basically means that a dependency is in a bad state and
it can explain this object state.
Returns: | True if one of the logical dep matches the status or
all network dep match the status. False otherwise |
Return type: | bool |
-
is_no_check_dependent()[source]
Check if there is some host/service that this object depend on
has a state in the status list .
Returns: | True if this object has a check dependency, otherwise False |
Return type: | bool |
-
launch_check(timestamp, ref_check=None, force=False, dependent=False)[source]
Launch a check (command)
Parameters: |
- timestamp (int) –
- ref_check –
- force (bool) –
- dependent (bool) –
|
Returns: | None or alignak.check.Check
|
Return type: | None | alignak.check.Check
|
-
manage_internal_check(hosts, services, check)[source]
Manage internal commands such as
* bp_rule
* _internal_host_up
* _echo
-
no_more_a_problem()[source]
Remove this objects as an impact for other schedulingitem.
- TODO: SchedulingItem object should not handle other schedulingitem obj.
- We should call obj.register* on both obj.
This is ‘Java’ style
-
prepare_notification_for_sending(notif)[source]
Used by scheduler when a notification is ok to be sent (to reactionner).
Here we update the command with status of now, and we add the contact to set of
contact we notified. And we raise the log entry
Parameters: | notif (alignak.objects.notification.Notification) – notification to send |
Returns: | None |
-
raise_dependencies_check(ref_check)[source]
Get checks that we depend on if EVERY following conditions is met:
* timeperiod is valid
* dep.last_state_update < now - cls.cached_check_horizon (check of dependency is "old")
Parameters: | ref_check – Check we want to get dependency from |
Returns: | Checks that depend on ref_check |
Return type: | list[alignak.objects.check.Check] |
-
rebuild_ref()[source]
Rebuild the possible reference a schedulingitem can have
-
register_a_problem(prob)[source]
Call recursively by potentials impacts so they
update their source_problems list. But do not
go below if the problem is not a real one for me
like If I’ve got multiple parents for examples
- TODO: SchedulingItem object should not handle other schedulingitem obj.
- We should call obj.register* on both obj.
This is ‘Java’ style
-
register_son_in_parent_child_dependencies(son)[source]
Register a child dependency in this object
and a parent one in the son parameter
- TODO: SchedulingItem object should not handle other schedulingitem obj.
- We should call obj.register* on both obj.
This is ‘Java’ style
-
remove_in_progress_check(check)[source]
Remove check from check in progress
Parameters: | check (alignak.objects.check.Check) – Check to remove |
Returns: | None |
-
remove_in_progress_notification(notif)[source]
Remove a notification and mark them as zombie
Parameters: | notif – the notification to remove |
Returns: | None |
-
remove_in_progress_notifications()[source]
Remove all notifications from notifications_in_progress
:return:None
-
scatter_notification(notif)[source]
In create_notifications we created a notification “template”. When it’s
time to hand it over to the reactionner, this master notification needs
to be split in several child notifications, one for each contact
To be more exact, one for each contact who is willing to accept
notifications of this type and at this time
Parameters: | notif (alignak.objects.notification.Notification) – Notification to scatter |
Returns: | child notifications |
Return type: | list[alignak.objects.notification.Notification] |
-
schedule(force=False, force_time=None)[source]
Main scheduling function
If a check is in progress, or active check are disabled, do not schedule a check.
The check interval change with HARD state:
* SOFT: retry_interval
* HARD: check_interval
The first scheduling is evenly distributed, so all checks
are not launched at the same time.
Parameters: |
- force (bool) – tell if we forced this object to schedule a check
- force_time (None | int) – time we would like the check to be scheduled
|
Returns: | None
|
-
set_myself_as_problem()[source]
Raise all impact from my error. I’m setting myself
as a problem, and I register myself as this in all
hosts/services that depend_on_me. So they are now my
impacts
-
update_business_impact_value()[source]
We update our ‘business_impact’ value with the max of
the impacts business_impact if we got impacts. And save our ‘configuration’
business_impact if we do not have do it before
If we do not have impacts, we revert our value
- TODO: SchedulingItem object should not handle other schedulingitem obj.
- We should call obj.register* on both obj.
This is ‘Java’ style
-
update_event_and_problem_id()[source]
Update current_event_id and current_problem_id
Those attributes are used for macros (SERVICEPROBLEMID ...)
-
update_flapping()[source]
Compute the sample list (self.flapping_changes) and determine
whether the host/service is flapping or not
-
update_hard_unknown_phase_state()[source]
Update in_hard_unknown_reach_phase attribute and
was_in_hard_unknown_reach_phase
UNKNOWN during a HARD state are not so important, and they should
not raise notif about it
-
update_in_checking()[source]
Update in_checking attribute.
Object is in checking if we have checks in check_in_progress list
-
update_notification_command(notif)[source]
Update the notification command by resolving Macros
And because we are just launching the notification, we can say
that this contact has been notified
Parameters: | notif (alignak.objects.notification.Notification) – notification to send |
Returns: | None |
alignak.objects.service module
This Class is the service one, s it manage all service specific thing.
If you look at the scheduling part, look at the scheduling item class
-
class alignak.objects.service.Service(params={})[source]
Bases: alignak.objects.schedulingitem.SchedulingItem
Service class implements monitoring concepts for service.
For example it defines parents, check_interval, check_command etc.
-
acknowledgement
-
acknowledgement_type
-
act_depend_of
-
act_depend_of_me
-
action_url
-
actions
-
active_checks_enabled
-
add_business_rule_act_dependency(srv, status, timeperiod, inherits_parent)[source]
Add business act_dependency between two services.
TODO: Function seems to be asymmetric, (obj1.call1 , obj2.call1, obj2.call2)
-
add_service_act_dependency(srv, status, timeperiod, inherits_parent)[source]
Add logical act_dependency between two services.
- TODO: Service object should not handle other host obj.
- We should call obj.add_* on both obj.
This is ‘Java’ style
TODO: Function seems to be asymmetric, (obj1.call1 , obj2.call1, obj2.call2)
TODO: Looks like srv is a str when called. I bet it’s a mistake.
-
add_service_chk_dependency(srv, status, timeperiod, inherits_parent)[source]
Add logic chk_dependency between two services.
TODO: Function seems to be asymmetric, (obj1.call1 , obj2.call1, obj2.call2)
-
aggregation
-
attempt
-
broks
-
business_impact
-
business_impact_modulations
-
business_rule
-
business_rule_downtime_as_ack
-
business_rule_host_notification_options
-
business_rule_output_template
-
business_rule_service_notification_options
-
business_rule_smart_notifications
-
check_command
-
check_flapping_recovery_notification
-
check_freshness
-
check_interval
-
check_period
-
check_type
-
checkmodulations
-
checks_in_progress
-
child_dependencies
-
chk_depend_of
-
chk_depend_of_me
-
configuration_errors
-
configuration_warnings
-
contact_groups
-
contacts
-
current_event_id
-
current_notification_id
-
current_notification_number
-
current_problem_id
-
custom_views
-
customs
-
default_value
-
definition_order
-
display_name[source]
Display_name if defined, else service_description
Returns: | service description or service display_name |
Return type: | str |
-
downtimes
-
duplicate(host)[source]
For a given host, look for all copy we must create for for_each property
-
duplicate_foreach
-
duration_sec
-
early_timeout
-
end_time
-
escalations
-
event_handler
-
event_handler_enabled
-
execution_time
-
failure_prediction_enabled
-
fill_daddy_dependency()[source]
Add network act_dependency for host
:return:None
TODO: Host object should not handle other host obj.
We should call obj.add_* on both obj.
This is ‘Java’ style
-
fill_predictive_missing_parameters()[source]
define state with initial_state
-
first_notification_delay
-
flap_detection_enabled
-
flap_detection_options
-
flapping_changes
-
freshness_threshold
-
get_ack_author_name()[source]
Get the author of the acknowledgement
Returns: | author |
Return type: | str |
TODO: use getattr(self.acknowledgement, “author”, ‘’) instead
TODO: Move to util or SchedulingItem class
Get the comment of the acknowledgement
Returns: | comment |
Return type: | str |
TODO: use getattr(self.acknowledgement, “comment”, ‘’) instead
TODO: Move to util or SchedulingItem class
-
get_check_command()[source]
Wrapper to get the name of the check_command attribute
Returns: | check_command name |
Return type: | str |
TODO: Move to util or SchedulingItem class
-
get_data_for_checks()[source]
Get data for a check
Returns: | list containing the service and the linked host |
Return type: | list |
-
get_data_for_event_handler()[source]
Get data for an event handler
Returns: | list containing the service and the linked host |
Return type: | list |
-
get_data_for_notifications(contact, notif)[source]
Get data for a notification
Parameters: |
- contact – The contact to return
- notif – the notification to return
|
Returns: | list containing the service, the host and the given parameters
|
Return type: | list
|
-
get_dbg_name()[source]
Get the full name for debugging (host_name/service_description)
Returns: | service full name |
Return type: | str |
TODO: Remove this function
-
get_downtime()[source]
Accessor to scheduled_downtime_depth attribue
Returns: | scheduled downtime depth |
Return type: | str |
TODO: Move to util or SchedulingItem class
-
get_duration()[source]
Get duration formatted
Format is : “HHh MMm SSs”
Example : “10h 20m 40s”
Returns: | Formatted duration |
Return type: | str |
TODO: Move to util or SchedulingItem class
-
get_duration_sec()[source]
Get duration in seconds. (cast it before returning)
Returns: | duration in seconds |
Return type: | int |
TODO: Move to util or SchedulingItem class
-
get_full_name()[source]
Get the full name for debugging (host_name/service_description)
Returns: | service full name |
Return type: | str |
-
get_groupnames()[source]
Get servicegroups list
Returns: | comma separated list of servicegroups |
Return type: | str |
-
get_host_tags()[source]
Wrapper to access tags attribute of host attribute
Returns: | service tags (host one) |
Return type: | alignak.objects.tag.Tags |
-
get_hostgroups()[source]
Wrapper to access hostgroups attribute of host attribute
Returns: | service hostgroups (host one) |
Return type: | alignak.objects.hostgroup.Hostgroups |
-
get_name()[source]
Accessor to service_description attribute or name if first not defined
Returns: | service name |
Return type: | str |
-
get_obsessive_compulsive_processor_command()[source]
Create action for obsessive compulsive commands if such option is enabled
-
get_realm()[source]
Wrapper to access get_realm method of host attribute
Returns: | service realm (host one) |
Return type: | None | alignak.objects.realm.Realm |
-
get_service_tags()[source]
Accessor to tags attribute
Returns: | service tags |
Return type: | alignak.objects.tag.Tags |
-
get_short_status()[source]
Get the short status of this host
Returns: | “O”, “W”, “C”, “U’, or “n/a” based on service state_id or business_rule state |
Return type: | str |
-
get_status()[source]
Get the status of this host
Returns: | “OK”, “WARNING”, “CRITICAL”, “UNKNOWN” or “n/a” based on
service state_id or business_rule state |
Return type: | str |
-
got_business_rule
-
has_been_checked
-
high_flap_threshold
-
host
-
host_dependency_enabled
-
host_name
-
hostgroup_name
-
icon_image
-
icon_image_alt
-
icon_set
-
impacts
-
imported_from
-
in_checking
-
in_hard_unknown_reach_phase
-
in_maintenance
-
in_scheduled_downtime
-
in_scheduled_downtime_during_last_check
-
initial_state
-
is_correct()[source]
Check if this host configuration is correct
* All required parameter are specified
* Go through all configuration warnings and errors that could have been raised earlier
Returns: | True if the configuration is correct, False otherwise |
Return type: | bool |
-
is_flapping
-
is_impact
-
is_problem
-
is_state(status)[source]
Return if status match the current service status
Parameters: | status (str) – status to compare ( “o”, “c”, “w”, “u”). Usually comes from config files |
Returns: | True if status <=> self.status, otherwise False |
Return type: | bool |
-
is_volatile
-
labels
-
last_check_command
-
last_chk
-
last_event_id
-
last_hard_state
-
last_hard_state_change
-
last_hard_state_id
-
last_notification
-
last_perf_data
-
last_problem_id
-
last_snapshot
-
last_state
-
last_state_change
-
last_state_id
-
last_state_type
-
last_state_update
-
last_time_critical
-
last_time_non_ok_or_up()[source]
Get the last time the service was in a non-OK state
Returns: | self.last_time_down if self.last_time_down > self.last_time_up, otherwise 0 |
Return type: | int |
-
last_time_ok
-
last_time_unknown
-
last_time_warning
-
latency
-
long_output
-
low_flap_threshold
-
macromodulations
-
macros = {'SERVICEDOWNTIME': 'get_downtime', 'SERVICEACKAUTHORNAME': 'get_ack_author_name', 'LASTSERVICESTATE': 'last_state', 'SERVICEACKCOMMENT': 'get_ack_comment', 'SERVICEDURATIONSEC': 'get_duration_sec', 'SERVICEDESC': 'service_description', 'SERVICEPERFDATA': 'perf_data', 'SERVICEATTEMPT': 'attempt', 'LASTSERVICEUNKNOWN': 'last_time_unknown', 'SERVICEBUSINESSIMPACT': 'business_impact', 'LASTSERVICECRITICAL': 'last_time_critical', 'LASTSERVICECHECK': 'last_chk', 'SERVICEEVENTID': 'current_event_id', 'SERVICEPERCENTCHANGE': 'percent_state_change', 'SERVICEACKAUTHORALIAS': 'get_ack_author_name', 'MAXSERVICEATTEMPTS': 'max_check_attempts', 'LASTSERVICEPROBLEMID': 'last_problem_id', 'SERVICEDISPLAYNAME': 'display_name', 'SERVICEGROUPNAME': 'get_groupname', 'LASTSERVICEEVENTID': 'last_event_id', 'SERVICESTATE': 'state', 'SERVICEGROUPNAMES': 'get_groupnames', 'SERVICENOTESURL': 'notes_url', 'SERVICECHECKCOMMAND': 'get_check_command', 'SERVICEDURATION': 'get_duration', 'SERVICEACTIONURL': 'action_url', 'LASTSERVICESTATECHANGE': 'last_state_change', 'LONGSERVICEOUTPUT': 'long_output', 'SHORTSTATUS': 'get_short_status', 'LASTSERVICEPERFDATA': 'last_perf_data', 'SERVICESTATETYPE': 'state_type', 'LASTSERVICEWARNING': 'last_time_warning', 'SERVICEACKAUTHOR': 'get_ack_author_name', 'SERVICEEXECUTIONTIME': 'execution_time', 'SERVICESTATEID': 'state_id', 'STATUS': 'get_status', 'LASTSERVICESTATEID': 'last_state_id', 'LASTSERVICEOK': 'last_time_ok', 'SERVICEPROBLEMID': 'current_problem_id', 'SERVICELATENCY': 'latency', 'SERVICEOUTPUT': 'output', 'SERVICENOTES': 'notes', 'SERVICEISVOLATILE': 'is_volatile', 'FULLNAME': 'get_full_name'}
-
maintenance_period
-
manage_stalking(check)[source]
Check if the service need stalking or not (immediate recheck)
If one stalking_options matches the exit_status (‘o’ <=> 0 ...) then stalk is needed
Raise a log entry (info level) if stalk is needed
Parameters: | check (alignak.check.Check) – finshed check (check.status == ‘waitconsume’) |
Returns: | None |
-
max_check_attempts
-
merge_host_contacts
-
modified_attributes
-
my_own_business_impact
-
my_type = 'service'
-
name
-
next_chk
-
notes
-
notes_url
-
notification_interval
-
notification_is_blocked_by_contact(notif, contact)[source]
Check if the notification is blocked by this contact.
Parameters: |
|
Returns: | True if the notification is blocked, False otherwise
|
Return type: | bool
|
-
notification_is_blocked_by_item(n_type, t_wished=None)[source]
Check if a notification is blocked by the service.
Conditions are ONE of the following:
* enable_notification is False (global)
* not in a notification_period
* notifications_enable is False (local)
* notification_options is 'n' or matches the state ('UNKNOWN' <=> 'u' ...)
(include flapping and downtimes)
- state goes ok and type is ‘ACKNOWLEDGEMENT’ (no sense)
- scheduled_downtime_depth > 0 and flapping (host is in downtime)
- scheduled_downtime_depth > 1 and not downtime end (deep downtime)
- scheduled_downtime_depth > 0 and problem or recovery (host is in downtime)
- SOFT state of a problem (we raise notification ony on HARD state)
- ACK notification when already ACK (don’t raise again ACK)
- not flapping notification in a flapping state
- business rule smart notifications is enabled and all its children have been acknowledged
or are under downtime
- linked host is not up
- linked host is in downtime
Parameters: |
- n_type – notification type
- t_wished (float) – the time we should like to notify the host (mostly now)
|
Returns: | True if ONE of the above condition was met, otherwise False
|
Return type: | bool
|
TODO: Refactor this, a lot of code duplication with Host.notification_is_blocked_by_item
-
notification_options
-
notification_period
-
notifications_enabled
-
notifications_in_progress
-
notified_contacts
-
obsess_over_service
-
ok_up = 'OK'
-
old_properties = {'normal_check_interval': 'check_interval', 'hostgroups': 'hostgroup_name', 'hostgroup': 'hostgroup_name', 'criticity': 'business_impact', 'retry_check_interval': 'retry_interval'}
-
output
-
parallelize_check
-
parent_dependencies
-
passive_checks_enabled
-
pending_flex_downtime
-
percent_state_change
-
perf_data
-
poller_tag
-
problem_has_been_acknowledged
-
process_perf_data
-
processed_business_rule
-
properties = {'hostgroup_name': <alignak.property.StringProp object at 0x7fd17a7f66d0>, 'business_impact_modulations': <alignak.property.ListProp object at 0x7fd17a783210>, 'retry_interval': <alignak.property.IntegerProp object at 0x7fd17a7f6910>, 'labels': <alignak.property.ListProp object at 0x7fd17a783350>, 'obsess_over_service': <alignak.property.BoolProp object at 0x7fd17a7f6a10>, 'action_url': <alignak.property.StringProp object at 0x7fd17a7f6f90>, 'escalations': <alignak.property.ListProp object at 0x7fd17a783250>, 'low_flap_threshold': <alignak.property.IntegerProp object at 0x7fd17a7f6b50>, 'process_perf_data': <alignak.property.BoolProp object at 0x7fd17a7f6c50>, 'icon_image': <alignak.property.StringProp object at 0x7fd17a7f6fd0>, 'snapshot_interval': <alignak.property.IntegerProp object at 0x7fd17a783910>, 'check_period': <alignak.property.StringProp object at 0x7fd17a7f69d0>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'display_name': <alignak.property.StringProp object at 0x7fd17a7f6750>, 'notification_interval': <alignak.property.IntegerProp object at 0x7fd17a7f6d10>, 'failure_prediction_enabled': <alignak.property.BoolProp object at 0x7fd17a7830d0>, 'flap_detection_options': <alignak.property.ListProp object at 0x7fd17a7f6c10>, 'snapshot_enabled': <alignak.property.BoolProp object at 0x7fd17a783810>, 'event_handler_enabled': <alignak.property.BoolProp object at 0x7fd17a7f6b10>, 'trigger': <alignak.property.StringProp object at 0x7fd17a783610>, 'initial_state': <alignak.property.CharProp object at 0x7fd17a7f6850>, 'first_notification_delay': <alignak.property.IntegerProp object at 0x7fd17a7f6d50>, 'notification_options': <alignak.property.ListProp object at 0x7fd17a7f6dd0>, 'host_name': <alignak.property.StringProp object at 0x7fd17a7f6650>, 'snapshot_period': <alignak.property.StringProp object at 0x7fd17a783890>, 'notifications_enabled': <alignak.property.BoolProp object at 0x7fd17a7f6e10>, 'event_handler': <alignak.property.StringProp object at 0x7fd17a7f6ad0>, 'aggregation': <alignak.property.StringProp object at 0x7fd17a7837d0>, 'freshness_threshold': <alignak.property.IntegerProp object at 0x7fd17a7f6a90>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'time_to_orphanage': <alignak.property.IntegerProp object at 0x7fd17a7832d0>, 'trigger_broker_raise_enabled': <alignak.property.BoolProp object at 0x7fd17a783690>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'notes': <alignak.property.StringProp object at 0x7fd17a7f6f10>, 'check_command': <alignak.property.StringProp object at 0x7fd17a7f6810>, 'parallelize_check': <alignak.property.BoolProp object at 0x7fd17a783110>, 'servicegroups': <alignak.property.ListProp object at 0x7fd17a7f6790>, 'passive_checks_enabled': <alignak.property.BoolProp object at 0x7fd17a7f6990>, 'check_interval': <alignak.property.IntegerProp object at 0x7fd17a7f68d0>, 'merge_host_contacts': <alignak.property.BoolProp object at 0x7fd17a783310>, 'notes_url': <alignak.property.StringProp object at 0x7fd17a7f6f50>, 'custom_views': <alignak.property.ListProp object at 0x7fd17a783790>, 'check_freshness': <alignak.property.BoolProp object at 0x7fd17a7f6a50>, 'active_checks_enabled': <alignak.property.BoolProp object at 0x7fd17a7f6950>, 'icon_image_alt': <alignak.property.StringProp object at 0x7fd17a783050>, 'host_dependency_enabled': <alignak.property.BoolProp object at 0x7fd17a783390>, 'checkmodulations': <alignak.property.ListProp object at 0x7fd17a783710>, 'reactionner_tag': <alignak.property.StringProp object at 0x7fd17a783190>, 'is_volatile': <alignak.property.BoolProp object at 0x7fd17a7f67d0>, 'default_value': <alignak.property.StringProp object at 0x7fd17a783590>, 'maintenance_period': <alignak.property.StringProp object at 0x7fd17a783290>, 'contacts': <alignak.property.ListProp object at 0x7fd17a7f6e50>, 'notification_period': <alignak.property.StringProp object at 0x7fd17a7f6d90>, 'trending_policies': <alignak.property.ListProp object at 0x7fd17a7836d0>, 'resultmodulations': <alignak.property.ListProp object at 0x7fd17a7831d0>, 'retain_status_information': <alignak.property.BoolProp object at 0x7fd17a7f6c90>, 'business_rule_downtime_as_ack': <alignak.property.BoolProp object at 0x7fd17a783450>, 'stalking_options': <alignak.property.ListProp object at 0x7fd17a7f6ed0>, 'macromodulations': <alignak.property.ListProp object at 0x7fd17a783750>, 'flap_detection_enabled': <alignak.property.BoolProp object at 0x7fd17a7f6bd0>, 'business_rule_host_notification_options': <alignak.property.ListProp object at 0x7fd17a783490>, 'high_flap_threshold': <alignak.property.IntegerProp object at 0x7fd17a7f6b90>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'snapshot_criteria': <alignak.property.ListProp object at 0x7fd17a7838d0>, 'retain_nonstatus_information': <alignak.property.BoolProp object at 0x7fd17a7f6cd0>, 'contact_groups': <alignak.property.ListProp object at 0x7fd17a7f6e90>, 'business_rule_smart_notifications': <alignak.property.BoolProp object at 0x7fd17a783410>, 'service_description': <alignak.property.StringProp object at 0x7fd17a7f6710>, 'trigger_name': <alignak.property.StringProp object at 0x7fd17a783650>, 'service_dependencies': <alignak.property.ListProp object at 0x7fd17a783510>, 'snapshot_command': <alignak.property.StringProp object at 0x7fd17a783850>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'duplicate_foreach': <alignak.property.StringProp object at 0x7fd17a783550>, 'poller_tag': <alignak.property.StringProp object at 0x7fd17a783150>, 'icon_set': <alignak.property.StringProp object at 0x7fd17a783090>, 'business_impact': <alignak.property.IntegerProp object at 0x7fd17a7835d0>, 'max_check_attempts': <alignak.property.IntegerProp object at 0x7fd17a7f6890>, 'business_rule_service_notification_options': <alignak.property.ListProp object at 0x7fd17a7834d0>, 'business_rule_output_template': <alignak.property.StringProp object at 0x7fd17a7833d0>}
-
raise_alert_log_entry()[source]
Raise SERVICE ALERT entry (critical level)
Format is : “SERVICE ALERT: host.get_name();*get_name()*;*state*;*state_type*;*attempt*
;*output*”
Example : “SERVICE ALERT: server;Load;DOWN;HARD;1;I don’t know what to say...”
-
raise_cancel_downtime_log_entry()[source]
Raise SERVICE DOWNTIME ALERT entry (critical level)
Format is : “SERVICE DOWNTIME ALERT: host.get_name();*get_name()*;CANCELLED;
Service has entered a period of scheduled downtime”
- Example : “SERVICE DOWNTIME ALERT: test_host_0;Load;CANCELLED;
- Service has entered a period of scheduled downtime”
-
raise_enter_downtime_log_entry()[source]
Raise SERVICE DOWNTIME ALERT entry (critical level)
Format is : “SERVICE DOWNTIME ALERT: host.get_name();*get_name()*;STARTED;
Service has entered a period of scheduled downtime”
- Example : “SERVICE DOWNTIME ALERT: test_host_0;Load;STARTED;
- Service has entered a period of scheduled downtime”
-
raise_event_handler_log_entry(command)[source]
Raise SERVICE EVENT HANDLER entry (critical level)
Format is : “SERVICE EVENT HANDLER: host.get_name();*self.get_name()*;*state*;*state_type*
;*attempt*;*command.get_name()*”
Example : “SERVICE EVENT HANDLER: server;Load;UP;HARD;1;notify-by-rss”
-
raise_exit_downtime_log_entry()[source]
Raise SERVICE DOWNTIME ALERT entry (critical level)
Format is : “SERVICE DOWNTIME ALERT: host.get_name();*get_name()*;STOPPED;
Service has entered a period of scheduled downtime”
- Example : “SERVICE DOWNTIME ALERT: test_host_0;Load;STOPPED;
- Service has entered a period of scheduled downtime”
-
raise_flapping_start_log_entry(change_ratio, threshold)[source]
Raise SERVICE FLAPPING ALERT START entry (critical level)
Format is : “SERVICE FLAPPING ALERT: host.get_name();*self.get_name()*;STARTED;
Service appears to have started
flapping (
*change_ratio*% change >=
*threshold*% threshold)”
- Example : “SERVICE FLAPPING ALERT: server;Load;STARTED;
- Service appears to have started
flapping (50.6% change >= 50.0% threshold)”
Parameters: |
- change_ratio – percent of changing state
- threshold – threshold (percent) to trigger this log entry
|
Returns: | None
|
-
raise_flapping_stop_log_entry(change_ratio, threshold)[source]
Raise SERVICE FLAPPING ALERT STOPPED entry (critical level)
Format is : “SERVICE FLAPPING ALERT: host.get_name();*self.get_name()*;STOPPED;
Service appears to have started
flapping (
*change_ratio*% change >=
*threshold*% threshold)”
- Example : “SERVICE FLAPPING ALERT: server;Load;STOPPED;
- Service appears to have started
flapping (50.6% change >= 50.0% threshold)”
Parameters: |
- change_ratio (float) – percent of changing state
- threshold (float) – threshold (percent) to trigger this log entry
|
Returns: | None
|
-
raise_freshness_log_entry(t_stale_by, t_threshold)[source]
Raise freshness alert entry (warning level)
Format is : “The results of service ‘get_name()‘ on host ‘host.get_name()‘
are stale by t_stale_by (threshold=*t_threshold*).
I’m forcing an immediate check of the service.”
- Example : “Warning: The results of service ‘Load’ on host ‘Server’ are stale by 0d 0h 0m 58s
- (threshold=0d 1h 0m 0s). ...”
Parameters: |
- t_stale_by (int) – time in seconds the service has been in a stale state
- t_threshold (int) – threshold (seconds) to trigger this log entry
|
Returns: | None
|
-
raise_initial_state()[source]
Raise SERVICE HOST ALERT entry (info level)
Format is : “SERVICE HOST STATE: host.get_name();*get_name()*;*state*;*state_type*
;*attempt*;*output*”
Example : “SERVICE HOST STATE: server;Load;DOWN;HARD;1;I don’t know what to say...”
-
raise_no_next_check_log_entry()[source]
Raise no scheduled check entry (warning level)
Format is : “I cannot schedule the check for the service ‘get_name()‘
on host ‘host.get_name()‘ because there is not future valid time”
- Example : “I cannot schedule the check for the service ‘Load’ on host ‘Server’
- because there is not future valid time”
-
raise_notification_log_entry(notif)[source]
Raise SERVICE NOTIFICATION entry (critical level)
Format is : “SERVICE NOTIFICATION: contact.get_name();*host.get_name()*;*self.get_name()*
;*state*;*command.get_name()*;*output*”
Example : “SERVICE NOTIFICATION: superadmin;server;Load;UP;notify-by-rss;no output”
Parameters: | notif (alignak.objects.notification.Notification) – notification object created by service alert |
Returns: | None |
-
raise_snapshot_log_entry(command)[source]
Raise SERVICE SNAPSHOT entry (critical level)
Format is : “SERVICE SNAPSHOT: host.get_name();*self.get_name()*;*state*;*state_type*;
attempt;*command.get_name()*”
Example : “SERVICE SNAPSHOT: server;Load;UP;HARD;1;notify-by-rss”
-
reactionner_tag
-
register
-
resultmodulations
-
retain_nonstatus_information
-
retain_status_information
-
retry_interval
-
return_code
-
running_properties = {'state_id_before_impact': <alignak.property.IntegerProp object at 0x7fd17a78cd10>, 'child_dependencies': <alignak.property.StringProp object at 0x7fd17a78ce90>, 'last_problem_id': <alignak.property.IntegerProp object at 0x7fd17a78c550>, 'business_rule': <alignak.property.StringProp object at 0x7fd17a78ce10>, 'last_perf_data': <alignak.property.StringProp object at 0x7fd17a78c990>, 'acknowledgement': <alignak.property.StringProp object at 0x7fd17a78c410>, 'actions': <alignak.property.ListProp object at 0x7fd17a78cb10>, 'current_notification_number': <alignak.property.IntegerProp object at 0x7fd17a78c6d0>, 'flapping_changes': <alignak.property.ListProp object at 0x7fd17a78c310>, 'last_time_critical': <alignak.property.IntegerProp object at 0x7fd17a783e50>, 's_time': <alignak.property.FloatProp object at 0x7fd17a78c650>, 'last_time_warning': <alignak.property.IntegerProp object at 0x7fd17a783e10>, 'checks_in_progress': <alignak.property.ListProp object at 0x7fd17a78c1d0>, 'chk_depend_of': <alignak.property.ListProp object at 0x7fd17a78c0d0>, 'last_notification': <alignak.property.FloatProp object at 0x7fd17a78c690>, 'chk_depend_of_me': <alignak.property.ListProp object at 0x7fd17a78c150>, 'check_flapping_recovery_notification': <alignak.property.BoolProp object at 0x7fd17a78c750>, 'last_state': <alignak.property.StringProp object at 0x7fd17a783c10>, 'topology_change': <alignak.property.BoolProp object at 0x7fd17a78cf90>, 'my_own_business_impact': <alignak.property.IntegerProp object at 0x7fd17a78cc10>, 'impacts': <alignak.property.ListProp object at 0x7fd17a78cc90>, 'last_hard_state_change': <alignak.property.FloatProp object at 0x7fd17a783d10>, 'was_in_hard_unknown_reach_phase': <alignak.property.BoolProp object at 0x7fd17a78cf10>, 'parent_dependencies': <alignak.property.StringProp object at 0x7fd17a78ce50>, 'percent_state_change': <alignak.property.FloatProp object at 0x7fd17a78c390>, 'notifications_in_progress': <alignak.property.DictProp object at 0x7fd17a78c210>, 'u_time': <alignak.property.FloatProp object at 0x7fd17a78c610>, 'last_state_id': <alignak.property.IntegerProp object at 0x7fd17a783c90>, 'has_been_checked': <alignak.property.IntegerProp object at 0x7fd17a78c4d0>, 'broks': <alignak.property.ListProp object at 0x7fd17a78cb50>, 'last_time_unknown': <alignak.property.IntegerProp object at 0x7fd17a783e90>, 'last_state_update': <alignak.property.FloatProp object at 0x7fd17a78c190>, 'execution_time': <alignak.property.FloatProp object at 0x7fd17a78c5d0>, 'start_time': <alignak.property.IntegerProp object at 0x7fd17a78c850>, 'state_type': <alignak.property.StringProp object at 0x7fd17a783f10>, 'configuration_warnings': <alignak.property.ListProp object at 0x7fd17a819650>, 'notified_contacts': <alignak.property.ListProp object at 0x7fd17a78ca50>, 'flapping_comment_id': <alignak.property.IntegerProp object at 0x7fd17a78c350>, 'early_timeout': <alignak.property.IntegerProp object at 0x7fd17a78c8d0>, 'in_scheduled_downtime': <alignak.property.BoolProp object at 0x7fd17a78ca90>, 'state_type_id': <alignak.property.IntegerProp object at 0x7fd17a783f50>, 'scheduled_downtime_depth': <alignak.property.IntegerProp object at 0x7fd17a78c790>, 'in_checking': <alignak.property.BoolProp object at 0x7fd17a783a10>, 'last_state_change': <alignak.property.FloatProp object at 0x7fd17a783cd0>, 'long_output': <alignak.property.StringProp object at 0x7fd17a783fd0>, 'duration_sec': <alignak.property.IntegerProp object at 0x7fd17a783ed0>, 'current_event_id': <alignak.property.IntegerProp object at 0x7fd17a783b90>, 'end_time': <alignak.property.IntegerProp object at 0x7fd17a78c890>, 'timeout': <alignak.property.IntegerProp object at 0x7fd17a78c810>, 'output': <alignak.property.StringProp object at 0x7fd17a783f90>, 'perf_data': <alignak.property.StringProp object at 0x7fd17a78c950>, 'state_before_impact': <alignak.property.StringProp object at 0x7fd17a78ccd0>, 'is_impact': <alignak.property.BoolProp object at 0x7fd17a78cbd0>, 'check_type': <alignak.property.IntegerProp object at 0x7fd17a78c490>, 'in_scheduled_downtime_during_last_check': <alignak.property.BoolProp object at 0x7fd17a78cad0>, 'source_problems': <alignak.property.ListProp object at 0x7fd17a78cc50>, 'last_event_id': <alignak.property.IntegerProp object at 0x7fd17a783bd0>, 'in_hard_unknown_reach_phase': <alignak.property.BoolProp object at 0x7fd17a78ced0>, 'problem_has_been_acknowledged': <alignak.property.BoolProp object at 0x7fd17a78c3d0>, 'should_be_scheduled': <alignak.property.IntegerProp object at 0x7fd17a78c510>, 'latency': <alignak.property.FloatProp object at 0x7fd17a783a90>, 'state_changed_since_impact': <alignak.property.BoolProp object at 0x7fd17a78cd50>, 'pending_flex_downtime': <alignak.property.IntegerProp object at 0x7fd17a78c7d0>, 'last_state_type': <alignak.property.StringProp object at 0x7fd17a783c50>, 'downtimes': <alignak.property.ListProp object at 0x7fd17a78c290>, 'last_hard_state': <alignak.property.StringProp object at 0x7fd17a783d50>, 'next_chk': <alignak.property.IntegerProp object at 0x7fd17a7839d0>, 'processed_business_rule': <alignak.property.StringProp object at 0x7fd17a78cdd0>, 'comments': <alignak.property.ListProp object at 0x7fd17a78c2d0>, 'last_check_command': <alignak.property.StringProp object at 0x7fd17a794090>, 'state': <alignak.property.StringProp object at 0x7fd17a783b10>, 'current_problem_id': <alignak.property.IntegerProp object at 0x7fd17a78c590>, 'last_chk': <alignak.property.IntegerProp object at 0x7fd17a783990>, 'current_notification_id': <alignak.property.IntegerProp object at 0x7fd17a78c710>, 'last_snapshot': <alignak.property.IntegerProp object at 0x7fd17a794050>, 'is_problem': <alignak.property.BoolProp object at 0x7fd17a78cb90>, 'last_time_ok': <alignak.property.IntegerProp object at 0x7fd17a783dd0>, 'tags': <alignak.property.ListProp object at 0x7fd17a8196d0>, 'return_code': <alignak.property.IntegerProp object at 0x7fd17a78c910>, 'is_flapping': <alignak.property.BoolProp object at 0x7fd17a78c050>, 'customs': <alignak.property.DictProp object at 0x7fd17a78ca10>, 'host': <alignak.property.StringProp object at 0x7fd17a78c9d0>, 'state_before_hard_unknown_reach_phase': <alignak.property.StringProp object at 0x7fd17a78cf50>, 'state_id': <alignak.property.IntegerProp object at 0x7fd17a783b50>, 'configuration_errors': <alignak.property.ListProp object at 0x7fd17a819690>, 'act_depend_of_me': <alignak.property.ListProp object at 0x7fd17a78c110>, 'attempt': <alignak.property.IntegerProp object at 0x7fd17a783ad0>, 'act_depend_of': <alignak.property.ListProp object at 0x7fd17a78c090>, 'triggers': <alignak.property.ListProp object at 0x7fd17a78cfd0>, 'acknowledgement_type': <alignak.property.IntegerProp object at 0x7fd17a78c450>, 'modified_attributes': <alignak.property.IntegerProp object at 0x7fd17a783950>, 'in_maintenance': <alignak.property.IntegerProp object at 0x7fd17a783a50>, 'got_business_rule': <alignak.property.BoolProp object at 0x7fd17a78cd90>, 'last_hard_state_id': <alignak.property.IntegerProp object at 0x7fd17a783d90>}
-
s_time
-
scheduled_downtime_depth
-
service_dependencies
-
service_description
-
servicegroups
-
set_impact_state()[source]
We just go an impact, so we go unreachable
But only if we enable this state change in the conf
-
set_state_from_exit_status(status)[source]
Set the state in UP, WARNING, CRITICAL or UNKNOWN
with the status of a check. Also update last_state
Parameters: | status (int) – integer between 0 and 3 |
Returns: | None |
-
set_unreachable()[source]
Does nothing. Unreachable means nothing for a service
-
should_be_scheduled
-
snapshot_command
-
snapshot_criteria
-
snapshot_enabled
-
snapshot_interval
-
snapshot_period
-
source_problems
-
stalking_options
-
start_time
-
state
-
state_before_hard_unknown_reach_phase
-
state_before_impact
-
state_changed_since_impact
-
state_id
-
state_id_before_impact
-
state_type
-
state_type_id
-
tags
-
time_to_orphanage
-
timeout
-
topology_change
-
trending_policies
-
trigger
-
trigger_broker_raise_enabled
-
trigger_name
-
triggers
-
u_time
-
unique_key[source]
Unique key for this service
Returns: | Tuple with host_name and service_description |
Return type: | tuple |
-
unset_impact_state()[source]
Unset impact, only if impact state change is set in configuration
-
use
-
was_in_hard_unknown_reach_phase
-
class alignak.objects.service.Services(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Class for the services lists. It’s mainly for configuration
-
add_item(item, index=True, was_partial=False)[source]
Adds and index an item into the items container.
This implementation takes into account that a service has two naming
attribute: host_name and service_description.
Parameters: |
- item – The item to add
- index (bool) – Flag indicating if the item should be indexed
- was_partial (bool) – True if was partial, otherwise False
|
Returns: | None
|
-
add_partial_service(item, index=True, var_tuple=())[source]
Add a partial service.
ie : A service that does not have service_description or host_name/host_group
We have to index them differently and try to inherit from our template to get one
of the previous parameter
Parameters: |
- item (alignak.objects.service.Service) – service to add
- index (bool) – whether to index it or not. Not used
- var_tuple (tuple) – tuple containing object class, host_name, hostgroup_name,
service_description and file it was parsed from (from logging purpose)
|
Returns: | None
|
-
add_template(tpl)[source]
Adds and index a template into the templates container.
This implementation takes into account that a service has two naming
attribute: host_name and service_description.
Parameters: | tpl – The template to add |
Returns: | None |
-
apply_dependencies()[source]
Wrapper to loop over services and call Service.fill_daddy_dependency()
-
apply_implicit_inheritance(hosts)[source]
Apply implicit inheritance for special properties:
contact_groups, notification_interval , notification_period
So service will take info from host if necessary
-
apply_inheritance()[source]
- For all items and templates inherit properties and custom
- variables.
-
apply_partial_inheritance(prop)[source]
Apply partial inheritance. Because of partial services we need to
override this function from SchedulingItem
Parameters: | prop (str) – property to inherit from |
Returns: | None |
-
clean()[source]
Remove services without host object linked to
-
create_business_rules(hosts, services)[source]
Loop on services and call Service.create_business_rules(hosts, services)
TODO: Move this function into SchedulingItems class
-
create_business_rules_dependencies()[source]
Loop on services and call Service.create_business_rules_dependencies()
TODO: Move this function into SchedulingItems class
-
delete_services_by_id(ids)[source]
Delete a list of services
Parameters: | ids (list) – ids list to delete |
Returns: | None |
-
explode(hosts, hostgroups, contactgroups, servicegroups, servicedependencies, triggers)[source]
Explodes services, from host_name, hostgroup_name, and from templetes.
Parameters: |
- hosts – The hosts container
- hostgroups – The hostgoups container
- contactgroups – The concactgoups container
- servicegroups – The servicegoups container
- servicedependencies – The servicedependencies container
- triggers – The triggers container
|
Returns: | None
|
-
explode_services_duplicates(hosts, service)[source]
Explodes services holding a duplicate_foreach clause.
-
explode_services_from_hosts(hosts, service, hnames)[source]
Explodes a service based on a lis of hosts.
Parameters: |
- hosts – The hosts container
- service – The base service to explode
- hnames (str) – The host_name list to explode service on
|
Returns: | None
|
-
explode_services_from_templates(hosts, service)[source]
Explodes services from templates. All hosts holding the specified
templates are bound the service.
-
fill_predictive_missing_parameters()[source]
Loop on services and call Service.fill_predictive_missing_parameters()
-
find_srv_by_name_and_hostname(host_name, sdescr)[source]
Get a specific service based on a host_name and service_description
Parameters: |
- host_name (str) – host name linked to needed service
- sdescr (str) – service name we need
|
Returns: | the service found or None
|
Return type: | alignak.objects.service.Service
|
-
find_srvs_by_hostname(host_name)[source]
Get all services from a host based on a host_name
Parameters: | host_name (str) – the host name we want services |
Returns: | list of services |
Return type: | list[alignak.objects.service.Service] |
-
inner_class
alias of Service
-
linkify(hosts, commands, timeperiods, contacts, resultmodulations, businessimpactmodulations, escalations, servicegroups, triggers, checkmodulations, macromodulations)[source]
Create link between objects:
* service -> host
* service -> command
* service -> timeperiods
* service -> contacts
-
linkify_s_by_hst(hosts)[source]
Link services with their parent host
-
linkify_s_by_sg(servicegroups)[source]
Link services with servicegroups
-
linkify_templates()[source]
Create link between objects
-
name_property = 'unique_key'
-
optimize_service_search(hosts)[source]
Setter for hosts attribute
-
override_properties(hosts)[source]
Handle service_overrides property for hosts
ie : override properties for relevant services
-
register_service_dependencies(service, servicedependencies)[source]
Registers a service dependencies.
Parameters: |
- service – The service to register
- servicedependencies – The servicedependencies container
|
Returns: | None
|
-
register_service_into_servicegroups(service, servicegroups)[source]
Registers a service into the service groups declared in its
servicegroups attribute.
Parameters: |
- service – The service to register
- servicegroups – The servicegroups container
|
Returns: | None
|
alignak.objects.servicedependency module
This module provides Servicedependency and Servicedependencies classes that
implements dependencies between services. Basically used for parsing.
-
class alignak.objects.servicedependency.Servicedependencies(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Servicedependencies manage a list of Servicedependency objects, used for parsing configuration
-
add_service_dependency(dep_host_name, dep_service_description, par_host_name, par_service_description)[source]
Instantiate and add a Servicedependency object to the items dict:
* notification criteria is "u,c,w"
* inherits_parent is True
Parameters: |
- dep_host_name (str) – dependent host name
- dep_service_description (str) – dependent service description
- par_host_name (str) – host name
- par_service_description (str) – service description
|
Returns: | None
|
-
delete_servicesdep_by_id(ids)[source]
Delete a list of servicedependency
Parameters: | ids (list) – ids list to delete |
Returns: | None |
-
explode(hostgroups)[source]
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_hostgroup(svc_dep, hostgroups)[source]
Explode a service dependency for each member of hostgroup
:return:None
-
inner_class
alias of Servicedependency
-
is_correct()[source]
Check if this host configuration is correct
* All required parameter are specified
* Go through all configuration warnings and errors that could have been raised earlier
Returns: | True if the configuration is correct, otherwise False |
Return type: | bool |
-
linkify(hosts, services, timeperiods)[source]
Create link between objects:
* servicedependency -> host
* servicedependency -> service
* servicedependency -> timeperiods
-
linkify_s_by_sd()[source]
Add dependency in service objects
-
linkify_sd_by_s(hosts, services)[source]
Replace dependent_service_description and service_description
in service dependency by the real object
-
linkify_sd_by_tp(timeperiods)[source]
Replace dependency_period by a real object in service dependency
-
class alignak.objects.servicedependency.Servicedependency(params={})[source]
Bases: alignak.objects.item.Item
Servicedependency class is a simple implementation of service dependency as
defined in a monitoring context (dependency period, notification_failure_criteria ..)
-
get_name()[source]
Get name based on 4 class attributes
Each attribute is substituted by ‘’ if attribute does not exist
Returns: | dependent_host_name/dependent_service_description..host_name/service_description |
Return type: | str |
TODO: Clean this function (use format for string)
-
my_type = 'servicedependency'
-
properties = {'inherits_parent': <alignak.property.BoolProp object at 0x7fd17a6fc750>, 'notification_failure_criteria': <alignak.property.ListProp object at 0x7fd17a6fc7d0>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'explode_hostgroup': <alignak.property.BoolProp object at 0x7fd17a6fc850>, 'dependent_host_name': <alignak.property.StringProp object at 0x7fd17a6fc590>, 'service_description': <alignak.property.StringProp object at 0x7fd17a6fc710>, 'dependent_hostgroup_name': <alignak.property.StringProp object at 0x7fd17a6fc610>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'dependency_period': <alignak.property.StringProp object at 0x7fd17a6fc810>, 'execution_failure_criteria': <alignak.property.ListProp object at 0x7fd17a6fc790>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'hostgroup_name': <alignak.property.StringProp object at 0x7fd17a6fc6d0>, 'host_name': <alignak.property.StringProp object at 0x7fd17a6fc690>, 'dependent_service_description': <alignak.property.StringProp object at 0x7fd17a6fc650>}
alignak.objects.serviceescalation module
This module provides Serviceescalation and Serviceescalations classes that
implements service escalation for notification. Basically used for parsing.
-
class alignak.objects.serviceescalation.Serviceescalation(params={})[source]
Bases: alignak.objects.item.Item
Serviceescalation class is used to implement notification escalation for services
- TODO: Why this class does not inherit from alignak.objects.Escalation.
- Maybe we can merge it
-
get_name()[source]
Get escalation name
Returns: | name |
Return type: | str |
TODO: Remove this function
-
my_type = 'serviceescalation'
-
properties = {'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'contact_groups': <alignak.property.StringProp object at 0x7fd17a794fd0>, 'escalation_period': <alignak.property.StringProp object at 0x7fd17a794f10>, 'service_description': <alignak.property.StringProp object at 0x7fd17a794e10>, 'last_notification': <alignak.property.IntegerProp object at 0x7fd17a794e90>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'notification_interval': <alignak.property.IntegerProp object at 0x7fd17a794ed0>, 'contacts': <alignak.property.StringProp object at 0x7fd17a794f90>, 'last_notification_time': <alignak.property.IntegerProp object at 0x7fd17a7aa090>, 'escalation_options': <alignak.property.ListProp object at 0x7fd17a794f50>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'hostgroup_name': <alignak.property.StringProp object at 0x7fd17a794dd0>, 'host_name': <alignak.property.StringProp object at 0x7fd17a794d50>, 'first_notification_time': <alignak.property.IntegerProp object at 0x7fd17a7aa050>, 'first_notification': <alignak.property.IntegerProp object at 0x7fd17a794e50>}
-
class alignak.objects.serviceescalation.Serviceescalations(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Serviceescalations manage a list of Serviceescalation objects, used for parsing configuration
-
explode(escalations)[source]
Create instance of Escalation for each ServiceEscalation object
-
inner_class
alias of Serviceescalation
-
name_property = ''
alignak.objects.serviceextinfo module
This is the main class for the Service ext info. In fact it’s mainly
about the configuration part. Parameters are merged in Service so it’s
no use in running part
-
class alignak.objects.serviceextinfo.ServiceExtInfo(params={})[source]
Bases: alignak.objects.item.Item
ServiceExtInfo class is made to handle some parameters of SchedulingItem:
* notes
* notes_url
* icon_image
* icon_image_alt
TODO: Is this class really necessary?
-
definition_order
-
get_dbg_name()[source]
Get the host name for debugging (host_name)
Returns: | service extinfo host name |
Return type: | str |
TODO: Remove this function, get_name is doing it
-
get_full_name()[source]
Get the full name for debugging (host_name)
Returns: | service extinfo host name |
Return type: | str |
TODO: Remove this function, get_name is doing it
-
get_name()[source]
Accessor to host_name attribute or name if first not defined
Returns: | host name (no sense) |
Return type: | str |
TODO: Clean this function
-
host_name
-
icon_image
-
icon_image_alt
-
imported_from
-
is_correct()[source]
Check if this object is correct
Returns: | True, always. |
Return type: | bool |
TODO: Clean this function
-
macros = {'SERVICENOTES': 'notes', 'SERVICEDESC': 'service_description', 'SERVICENOTESURL': 'notes_url', 'SERVICEACTIONURL': 'action_url'}
-
my_type = 'serviceextinfo'
-
name
-
notes
-
notes_url
-
properties = {'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'icon_image_alt': <alignak.property.StringProp object at 0x7fd17a731a50>, 'notes': <alignak.property.StringProp object at 0x7fd17a731990>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'icon_image': <alignak.property.StringProp object at 0x7fd17a731a10>, 'notes_url': <alignak.property.StringProp object at 0x7fd17a7319d0>, 'host_name': <alignak.property.StringProp object at 0x7fd17a7318d0>, 'service_description': <alignak.property.StringProp object at 0x7fd17a731950>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>}
-
register
-
service_description
-
use
-
class alignak.objects.serviceextinfo.ServicesExtInfo(items, index_items=True)[source]
Bases: alignak.objects.item.Items
ServicesExtInfo manage ServiceExtInfo and propagate properties (listed before)
into Services if necessary
-
inner_class
alias of ServiceExtInfo
-
merge(services)[source]
Merge extended host information into services
-
merge_extinfo(service, extinfo)[source]
Merge extended host information into a service
-
name_property = 'host_name'
alignak.objects.servicegroup module
This module provide Servicegroup and Servicegroups classes used to group services
-
class alignak.objects.servicegroup.Servicegroup(params={})[source]
Bases: alignak.objects.itemgroup.Itemgroup
Class to manage a servicegroup
A servicegroup is used to group services
-
get_name()[source]
Get the name of the servicegrop
Returns: | the servicegroup name string |
Return type: | str |
-
get_servicegroup_members()[source]
Get list of members of this servicegroup
Returns: | list of services (members) |
Return type: | list | str |
-
get_services()[source]
Get services of this servicegroup
Returns: | list of services (members) |
Return type: | list |
-
get_services_by_explosion(servicegroups)[source]
Get all services of this servicegroup and add it in members container
Parameters: | servicegroups (object) – servicegroups object |
Returns: | return empty string or list of members |
Return type: | str or list |
-
macros = {'SERVICEGROUPNOTES': 'notes', 'SERVICEGROUPALIAS': 'alias', 'SERVICEGROUPMEMBERS': 'members', 'SERVICEGROUPACTIONURL': 'action_url', 'SERVICEGROUPNOTESURL': 'notes_url'}
-
my_type = 'servicegroup'
-
properties = {'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'alias': <alignak.property.StringProp object at 0x7fd17a6fc250>, 'notes': <alignak.property.StringProp object at 0x7fd17a6fc290>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'unknown_members': <alignak.property.ListProp object at 0x7fd17a751dd0>, 'action_url': <alignak.property.StringProp object at 0x7fd17a6fc310>, 'notes_url': <alignak.property.StringProp object at 0x7fd17a6fc2d0>, 'members': <alignak.property.ListProp object at 0x7fd17a751d50>, '_id': <alignak.property.IntegerProp object at 0x7fd17a6fc190>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>, 'servicegroup_name': <alignak.property.StringProp object at 0x7fd17a6fc210>}
-
class alignak.objects.servicegroup.Servicegroups(items, index_items=True)[source]
Bases: alignak.objects.itemgroup.Itemgroups
Class to manage all servicegroups
-
add_member(cname, sgname)[source]
Add a member (service) to this servicegroup
Parameters: |
- cname (str) – member (service) name
- sgname (str) – servicegroup name
|
Returns: | None
|
-
explode()[source]
Get services and put them in members container
-
inner_class
alias of Servicegroup
-
linkify(hosts, services)[source]
Link services with host
Parameters: |
- hosts (object) – hosts object
- services (object) – services object
|
Returns: | None
|
-
linkify_sg_by_srv(hosts, services)[source]
We just search for each host the id of the host
and replace the name by the id
TODO: very slow for hight services, so search with host list,
not service one
Parameters: |
- hosts (object) – hosts object
- services (object) – services object
|
Returns: | None
|
-
name_property = 'servicegroup_name'
alignak.objects.timeperiod module
This module provide Timeperiod class used to define time periods to do
action or not if we are in right period
-
class alignak.objects.timeperiod.Timeperiod(params={})[source]
Bases: alignak.objects.item.Item
Class to manage a timeperiod
A timeperiod is defined with range time (hours) of week to do action
and add day exceptions (like non working days)
-
apply_inheritance()[source]
Inherite no properties and no custom variables for timeperiod
-
check_and_log_activation_change()[source]
Will look for active/un-active change of timeperiod.
In case it change, we log it like:
[1327392000] TIMEPERIOD TRANSITION: <name>;<from>;<to>
States of is_active:
-1: default value when start
0: when timeperiod end
1: when timeperiod start
-
check_exclude_rec()[source]
Check if this timeperiod is tagged
Returns: | if tagged return false, if not true |
Return type: | bool |
-
clean_cache()[source]
Clean cache with entries older than now because not used in future ;)
-
explode()[source]
Try to resolv all unresolved elements
Parameters: | timeperiods – Timeperiods object |
Returns: | None |
-
fill_data_brok_from(data, brok_type)[source]
Add timeperiods from brok
Parameters: |
- data (dict) – timeperiod dictionnary
- brok_type (string) – brok type
|
Returns: | None
|
-
find_next_invalid_time_from_cache(timestamp)[source]
Get the next invalid time from cache
Parameters: | timestamp (int) – number of seconds |
Returns: | Nothing or time in seconds |
Return type: | None or int |
-
find_next_valid_time_from_cache(timestamp)[source]
Get the next valid time from cache
Parameters: | timestamp (int) – number of seconds |
Returns: | Nothing or time in seconds |
Return type: | None or int |
-
get_min_from_t(timestamp)[source]
Get the first time > timestamp which is valid
Parameters: | timestamp (int) – number of seconds |
Returns: | number of seconds |
Return type: | int |
TODO: not used, so delete it
-
get_name()[source]
Get the name of the timeperiod
Returns: | the timeperiod name string |
Return type: | str |
-
get_next_invalid_time_from_t(timestamp)[source]
Get next invalid time from the cache
Parameters: | timestamp (int) – number of seconds |
Returns: | Nothing or time in seconds |
Return type: | None or int |
-
get_next_valid_time_from_t(timestamp)[source]
Get next valid time from the cache
Parameters: | timestamp (int) – number of seconds |
Returns: | Nothing or time in seconds |
Return type: | None or int |
-
get_not_in_min_from_t(first)[source]
-
TODO: not used, so delete it
-
get_raw_import_values()[source]
Get some properties of timeperiod (timeperiod is a bit different
from classic item)
Returns: | a dictionnary of some properties |
Return type: | dict |
-
get_unresolved_properties_by_inheritance(items)[source]
Fill full properties with template if needed for the
unresolved values (example: sunday ETCETC)
Parameters: | items (object) – The Timeperiods object. |
Returns: | None |
-
has(prop)[source]
Check if self have prop attribute
Parameters: | prop (string) – property name |
Returns: | true if self has this attribute |
Return type: | bool |
-
is_correct()[source]
Check if dateranges of timeperiod are valid
Returns: | false if at least one datarange is invalid |
Return type: | bool |
-
is_time_valid(timestamp)[source]
Check if a time is valid or not
Returns: | time is valid or not |
Return type: | bool |
-
linkify(timeperiods)[source]
Will make timeperiod in exclude with id of the timeperiods
Parameters: | timeperiods – Timeperiods object |
Returns: | None |
-
my_type = 'timeperiod'
-
properties = {'use': <alignak.property.StringProp object at 0x7fd17a8331d0>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'register': <alignak.property.IntegerProp object at 0x7fd17a833210>, 'is_active': <alignak.property.BoolProp object at 0x7fd17a8336d0>, 'dateranges': <alignak.property.ListProp object at 0x7fd17a833250>, 'alias': <alignak.property.StringProp object at 0x7fd17a833150>, 'timeperiod_name': <alignak.property.StringProp object at 0x7fd17a833110>, 'exclude': <alignak.property.ListProp object at 0x7fd17a833690>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>}
-
resolve_daterange(dateranges, entry)[source]
Try to solve dateranges (special cases)
Parameters: |
- dateranges (list) – dateranges
- entry (string) – property of timeperiod
|
Returns: | None
|
-
running_properties = {'configuration_errors': <alignak.property.ListProp object at 0x7fd17a819690>, 'configuration_warnings': <alignak.property.ListProp object at 0x7fd17a819650>, 'tags': <alignak.property.ListProp object at 0x7fd17a8196d0>}
-
class alignak.objects.timeperiod.Timeperiods(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Class to manage all timeperiods
A timeperiod is defined with range time (hours) of week to do action
and add day exceptions (like non working days)
-
apply_inheritance()[source]
The only interesting property to inherit is exclude
-
explode()[source]
Try to resolv each timeperiod
-
inner_class
alias of Timeperiod
-
is_correct()[source]
check if each properties of timeperiods are valid
Returns: | True if is correct, otherwise False |
Return type: | bool |
-
linkify()[source]
Check exclusion for each timeperiod
-
name_property = 'timeperiod_name'
alignak.objects.trigger module
This module provides Trigger and Triggers classes.
Triggers are python files executed after the Scheduler has received a check result
Typical use is for passive results. This allows passive check data to be modified if necessary
-
class alignak.objects.trigger.Trigger(params={})[source]
Bases: alignak.objects.item.Item
Trigger class provides a simple set of method to compile and execute a python file
-
compile()[source]
Compile the trigger
-
eval(myself, ctx)[source]
Execute the trigger
-
get_name()[source]
Accessor to trigger_name attribute
Returns: | trigger name |
Return type: | str |
-
my_type = 'trigger'
-
properties = {'use': <alignak.property.ListProp object at 0x7fd17a819550>, 'code_src': <alignak.property.StringProp object at 0x7fd17a70f890>, 'name': <alignak.property.StringProp object at 0x7fd17a819590>, 'definition_order': <alignak.property.IntegerProp object at 0x7fd17a8195d0>, 'trigger_name': <alignak.property.StringProp object at 0x7fd17a70f850>, 'register': <alignak.property.BoolProp object at 0x7fd17a819610>, 'imported_from': <alignak.property.StringProp object at 0x7fd17a819510>}
-
running_properties = {'configuration_errors': <alignak.property.ListProp object at 0x7fd17a819690>, 'code_bin': <alignak.property.StringProp object at 0x7fd17a70f8d0>, 'trigger_broker_raise_enabled': <alignak.property.BoolProp object at 0x7fd17a70f910>, 'configuration_warnings': <alignak.property.ListProp object at 0x7fd17a819650>, 'tags': <alignak.property.ListProp object at 0x7fd17a8196d0>}
-
class alignak.objects.trigger.Triggers(items, index_items=True)[source]
Bases: alignak.objects.item.Items
Triggers class allowed to handle easily several Trigger objects
-
compile()[source]
Loop on triggers and call Trigger.compile()
-
create_trigger(src, name)[source]
Create a trigger with source and name
Parameters: |
- src (str) – python code source
- name (str) – trigger name
|
Returns: | new trigger object
|
Return type: | alignak.objects.trigger.Trigger
|
-
inner_class
alias of Trigger
-
load_file(path)[source]
Load all trigger files (.trig) in the specified path (recursively)
and create trigger objects
Parameters: | path (str) – path to start |
Returns: | None |
-
load_objects(conf)[source]
Set hosts and services from conf as global var
Parameters: | conf (dict) – alignak configuration |
Returns: | None |
TODO: global statement may not be useful
-
name_property = 'trigger_name'
Module contents
- The objects package contains definition classes of the different objects
- that can be declared in configuration files.