Centreon

class Centreon(username, password, url, verify=True)

This class is the base class to communicate with the Centreon API

Parameters
  • username (str) – Username to use for authentication

  • password (str) – Password to use for authentication

  • url (str) – URL to use for requests

  • verify (bool) – Optional: Set False if you do not want to verify the SSL certificate

acl_action_add(acl_action_name, acl_action_description)

This method is used to add an ACL action

Parameters
  • acl_action_name (str) – Name of the ACL action

  • acl_action_description (str) – Description of the ACL action

Returns

Returns True, if the operation was successful

Return type

bool

acl_action_del(acl_action_name)

This method is used to delete an ACL action

Parameters

acl_action_name (str) – Name of the ACL action

Returns

Returns True, if the operation was successful

Return type

bool

acl_action_get_acl_group(acl_action_name)

This method is used to retrieve the ACL groups that are linked to a specific ACL action

Parameters

acl_action_name (str) – Name of the ACL action

Returns

Returns a list of all ACL groups linked to the ACL action

Return type

list

acl_action_grant(acl_action_name, acl_actions=None, enable_all=False)

This method is used to grant ACL actions

Parameters
  • acl_action_name (str) – Name of the ACL action to modify

  • acl_actions (list of ACLAction) – Optional: List of ACL actions you want to grant, required if enable_all is False

  • enable_all (bool) – Optional: Set True, if you want to grant all available ACL actions

Returns

Returns True if the operation was successful

Return type

bool

acl_action_revoke(acl_action_name, acl_actions=None, disable_all=False)

This method is used to revoke ACL actions

Parameters
  • acl_action_name (str) – Name of the ACL action to modify

  • acl_actions (list of ACLAction) – Optional: List of ACL actions you want to revoke, required if disable_all is False

  • disable_all (bool) – Optional: Set True, if you want to revoke all available ACL actions

Returns

Returns True on if the operation was successful

Return type

bool

acl_action_set_param(acl_action_name, param_name, param_value)

This method is used to set a parameter of an ACL action

Parameters
  • acl_action_name (str) – Name of the ACL action

  • param_name (ACLActionParam) – Name of the param

  • param_value (str) – Value of the param

Returns

Returns True, if the operation was successful

Return type

bool

acl_action_show()

This method is used to show the available ACL actions

Returns

Returns a list of ACL actions

Return type

list of ACLAction

acl_group_add(acl_group_name, acl_group_alias)

This method is used to add an ACL group

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_group_alias (str) – Alias of the ACL group

Returns

Returns True, if the operation was successful

Return type

bool

acl_group_add_action(acl_group_name, acl_actions)

This method is used to add action rules to the ACL group. Appends to existing rules

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_actions (list of str) – List of ACL action rules

Returns

Returns True if operation was successful

Return type

bool

acl_group_add_contact(acl_group_name, acl_contact_names)

This method is used to add contacts to a specific ACL group. Appends to existing contacts

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_contact_names (list of str) – List of contacts

Returns

Returns True if the operation was successful

Return type

bool

acl_group_add_contact_group(acl_group_name, acl_contact_group_names)

This method is used to add contact groups to a specific ACL group. Appends to existing contact groups

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_contact_group_names (list of str) – List of contact groups

Returns

Returns True if the operation was successful

Return type

bool

acl_group_add_menu(acl_group_name, acl_menus)

This method is used to add menu rules to the ACL group. Appends to existing rules

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_menus (list of str) – List of ACL menu rules

Returns

Returns True if operation was successful

Return type

bool

acl_group_add_resource(acl_group_name, acl_resources)

This method is used to add resource rules to the ACL group. Appends to existing rules

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_resources (list of str) – List of ACL resource rules

Returns

Returns True if the operation was successful

Return type

bool

acl_group_del(acl_group_name)

This method is used to delete an ACL group

Parameters

acl_group_name (str) – Name of the ACL group

Returns

Returns True, if the operation was successful

Return type

bool

acl_group_del_action(acl_group_name, acl_action_name)

This method is used to delete a action rule linked to the ACL group

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_action_name (str) – Name of the action rule

Returns

Returns True if the operation was successful

Return type

bool

acl_group_del_contact(acl_group_name, acl_contact_name)

This method is used to delete a contact from a specific ACL group

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_contact_name (str) – Name of the contact

Returns

Returns True if the operation was successful

Return type

bool

acl_group_del_contact_group(acl_group_name, acl_contact_group_name)

This method is used to delete a contact group from a specific ACL group

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_contact_group_name (str) – Name of the contact group

Returns

Returns True if the oepration was successful

Return type

bool

acl_group_del_menu(acl_group_name, acl_menu_name)

This method is used to delete a menu rule linked to the ACL group

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_menu_name (str) – Name of the menu rule

Returns

Returns True if the operation was successful

Return type

bool

acl_group_del_resource(acl_group_name, acl_resource_name)

This method is used to delete a resource rule linked to the ACL group

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_resource_name (str) – Name of the resource rule

Returns

Returns True if the operation was successful

Return type

bool

acl_group_get_action(acl_group_name)

This method is used to retrieve the action rules that are linked to a specific ACL group

Parameters

acl_group_name (str) – Name of the ACL group

Returns

Returns list of action rules

Return type

list of dict

acl_group_get_contact(acl_group_name)

This method is used to retrieve the contacts that are linked to a specific ACL group

Parameters

acl_group_name (str) – Name of the ACL group

Returns

Returns list of contacts

Return type

list of dict

acl_group_get_contact_group(acl_group_name)

This method is used to retrieve the contact groups that are linked to a specific ACL group

Parameters

acl_group_name (str) – Name of the ACL group

Returns

Returns list of contact groups

Return type

list of dict

acl_group_get_menu(acl_group_name)

This method is used to retrieve the menu rules that are linked to a specific ACL group

Parameters

acl_group_name (str) – Name of the ACL group

Returns

Returns list of menu rules

Return type

list of dict

acl_group_get_resource(acl_group_name)

This method is used to retrieve the resource rules that are linked to a specific ACL group

Parameters

acl_group_name (str) – Name of the ACL group

Returns

Returns list of resource rules

Return type

list of dict

acl_group_set_action(acl_group_name, acl_actions)

This method is used to set the linked action rules. Overwrites existing rules

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_actions (list of str) – List of ACL action rules

Returns

Returns True if the operation is successful

Return type

bool

acl_group_set_contact(acl_group_name, acl_contact_names)

This method is used to set contact to a specific ACL group. Overwrites existing contacts

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_contact_names (list of str) – List of contacts

Returns

Returns True if the operation was successful

Return type

bool

acl_group_set_contact_group(acl_group_name, acl_contact_group_names)

This method is used to set contact groups to a specific ACL group. Overwrites existing contact groups

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_contact_group_names (list of str) – List of contact groups

Returns

Returns True if the operation was successful

Return type

bool

acl_group_set_menu(acl_group_name, acl_menus)

This method is used to set the linked menu rules. Overwrites existing rules

Parameters
  • acl_group_name (str) – Name of ACL group

  • acl_menus (list of str) – List of ACL menu rules

Returns

Returns True if the operation is successful

Return type

bool

acl_group_set_param(acl_group_name, param_name, param_value)

This method is used to change a specific parameter of an ACL group

Parameters
  • acl_group_name (str) – Name of the ACL group to modify

  • param_name (ACLGroupParam) – Name of the param

  • param_value (str) – Value of the param

Returns

Returns True if the operation was successful

Return type

bool

acl_group_set_resource(acl_group_name, acl_resources)

This method is used to set the linked resource rules. Overwrites existing rules

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_resources (list of str) – List of ACL resource rules

Returns

Returns True if operation was successful

Return type

bool

acl_group_show()

This method is used to retrieve information about ACL groups

Returns

Returns a list of ACL groups

Return type

list of ACLGroup

acl_last_reload(format_str=None)

This method is used to retrieve information about when the last reload of the ACL was done

Parameters

format_str (str) – Optional: This format string is used to get the time in a human readable format d - Day, m - Month, Y - Year, H - Hour, i - Minute, s - Second

Returns

Returns the time in the specified format

Return type

str

acl_menu_add(acl_menu_name, acl_menu_alias)

This method is used to add a new ACL menu

Parameters
  • acl_menu_name (str) – Name of the ACL menu

  • acl_menu_alias (str) – Alias of the ACL menu

Returns

Returns True if the operation was successful

Return type

bool

acl_menu_del(acl_menu_name)

This method is used to delete a ACL menu

Parameters

acl_menu_name (str) – Name of the ACL menu

Returns

Returns True if the operation was successful

Return type

bool

acl_menu_get_acl_group(acl_menu_name)

This method is used to get the ACL groups that are linked to a menu rule

Parameters

acl_menu_name (str) – Name of the ACL menu

Returns

Returns a list of ACL groups

Return type

list of dict

acl_menu_grant(acl_menu_name, grant_children_menu, menu_names, read_only=False)

This method is used to grant read & write or read only access to an ACL menu

Parameters
  • acl_menu_name (str) – Name of the ACL menu

  • grant_children_menu (bool) – Set True if the access to all children of the menu should be granted

  • menu_names (list of str) – Name of menus. Example: [Home] > [Poller statistics] -> [“Home”, “Poller statistics”]

  • read_only (bool) – Optional: Specify True, if you only want to grant read only access to the menu

Returns

Returns True if the operation was successful

Return type

bool

acl_menu_revoke(acl_menu_name, grant_children_menu, menu_names)

This method is used to revoke the access to an ACL menu

Parameters
  • acl_menu_name (str) – Name of the ACL menu

  • grant_children_menu (bool) – Set True if the access to all children of the menu should be revoked

  • menu_names (list of str) – Name of menus. Example: [Home] > [Poller statistics] -> [“Home”, “Poller statistics”]

Returns

Returns True if the operation is successful

Return type

bool

acl_menu_set_param(acl_menu_name, param_name, param_value)

This method is used to set parameters for an ACL menu

Parameters
  • acl_menu_name (str) – Name of the ACL menu

  • param_name (ACLMenu) – Name of the param

  • param_value (str) – Value of the param

Returns

Returns True if the operation was successful

Return type

bool

acl_menu_show()

This method is used to show the available ACL menus

Returns

Returns a list of ACL menus

Return type

list of dict

acl_reload()

This method is used to reload the ACL

Returns

Returns True on success

Return type

bool

acl_resource_add(acl_resource_name, acl_resource_alias)

This method is used to add a new ACL resource

Parameters
  • acl_resource_name (str) – Name of the ACL resource

  • acl_resource_alias (str) – Alias of the ACL resource

Returns

Returns True if the operation was successful

acl_resource_del(acl_resource_name)

This method is used to delete an ACL resource

Parameters

acl_resource_name (str) – Name of the ACL resource

Returns

Returns True if the operation was successful

Return type

bool

acl_resource_get_acl_group(acl_resource_name)

This method is used to get the linked ACL groups

Parameters

acl_resource_name (str) – Name of the ACL resource

Returns

Returns the linked ACL groups

Return type

list of dict

acl_resource_grant(acl_group_name, acl_grant_action, acl_resource_names, use_wildcard=False)

This method is used to grant resources in an ACL resource rule

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_grant_action (ACLResourceGrantAction) – Grant action to perform

  • acl_resource_names (list of str) – List of the resource names

  • use_wildcard (bool) – Optional: Set True, if the wildcard should be used. Not all actions support wildcards. See ACLResourceGrantAction for further information. If the operation doesn’t support a wildcard, but it is used anyway, the option is ignored and all resources in acl_resource_names are used. Default: False

Returns

Returns True if the operation was successful

Return type

bool

acl_resource_revoke(acl_group_name, acl_revoke_action, acl_resource_names, use_wildcard=False)

This method is used to revoke resources in an ACL resource rule

Parameters
  • acl_group_name (str) – Name of the ACL group

  • acl_revoke_action (ACLResourceRevokeAction) – Revoke action to perform

  • acl_resource_names (list of str) – List of the resource names

  • use_wildcard (bool) – Optional: Set True, if the wildcard should be used. Default: False

Returns

Returns True if the operation was successful

Return type

bool

acl_resource_set_param(acl_resource_name, param_name, param_value)

This method is used to set a specific parameter for an ACL resource

Parameters
  • acl_resource_name (str) – Name of the ACL resource

  • param_name (ACLResourceParam) – Name of the param

  • param_value (str) – Value of the param

Returns

Returns True if the operation was successful

acl_resource_show()

This method is used to show the available ACL resources

Returns

Returns a list of ACL resources

Return type

list of ACLResource

cent_broker_cfg_add(cent_broker_cfg_name, cent_broker_cfg_instance)

This method is used to add a centreon broker cfg

Parameters
  • cent_broker_cfg_name (str) – Name of the configuration

  • cent_broker_cfg_instance (str) – Instance that is linked to the broker cfg

Returns

Returns True if the operation was successful

Return type

bool

cent_broker_cfg_add_input(cent_broker_cfg_name, input_name, input_nature)

This method is used to add an input to a centreon broker config

Parameters
  • cent_broker_cfg_name (str) – Name of the centreon broker config

  • input_name (str) – Name of the input

  • input_nature (CentBrokerCFGInputNature) – Nature of the input

Returns

Returns True if the operation was successful

Return type

bool

cent_broker_cfg_add_logger(cent_broker_cfg_name, logger_name, logger_nature)

This method is used to add a logger to a centreon broker config

Parameters
  • cent_broker_cfg_name (str) – Name of the centreon broker config

  • logger_name (str) – Name of the logger

  • logger_nature (CentBrokerCFGLoggerNature) – Nature of the logger

Returns

Returns True if the operation was successful

Return type

bool

cent_broker_cfg_add_output(cent_broker_cfg_name, output_name, output_nature)

This method is used to add an output to a centreon broker config

Parameters
  • cent_broker_cfg_name (str) – Name of the centreon broker config

  • output_name (str) – Name of the output

  • output_nature (CentBrokerCFGOutputNature) – Nature of the output

Returns

Returns True if the operation was successful

Return type

bool

cent_broker_cfg_del(cent_broker_cfg_name)

This method is used to delete a centreon broker cfg

Parameters

cent_broker_cfg_name (str) – Name of the centreon broker configuration

Returns

Returns True if the operation is successful

Return type

bool

cent_broker_cfg_del_input(cent_broker_cfg_name, input_id)

This method is used to delete an input from a centreon broker config

Parameters
  • cent_broker_cfg_name (str) – Name of the centreon broker config

  • input_id (str) – ID of the input

Returns

Returns True if the operation was successful

Return type

bool

cent_broker_cfg_del_logger(cent_broker_cfg_name, logger_id)

This method is used to delete a logger from a centreon broker config

Parameters
  • cent_broker_cfg_name (str) – Name of teh centreon broker config

  • logger_id (str) – ID of the logger

Returns

Returns True if the operation was successful

Return type

bool

cent_broker_cfg_del_output(cent_broker_cfg_name, output_id)

This method is used to delete an output from a centreon broker config

Parameters
  • cent_broker_cfg_name (str) – Name of the centreon broker config

  • output_id (str) – ID of the output

Returns

Returns True if the operation was successful

Return type

bool

cent_broker_cfg_get_field_list(type_name)

This method is used to get the available field list of a type

Parameters

type_name (str) – Name of the type

Returns

Returns the available fields. If there is a ‘*’ behind a key, it means you have to choose from a given list of values

Return type

list of dict

cent_broker_cfg_get_input(cent_broker_cfg_name, input_id)

This method is used to get parameters of a specific input

Parameters
  • cent_broker_cfg_name (str) – Name of the centreon broker cfg

  • input_id (str) – ID of the input

Returns

Returns the parameters from the specified input

Return type

list of dict

cent_broker_cfg_get_logger(cent_broker_cfg_name, logger_id)

This method is used to get parameters of a specific logger

Parameters
  • cent_broker_cfg_name (str) – Name of the centreon broker cfg

  • logger_id (str) – ID of the logger

Returns

Returns the parameters from the specified logger

Return type

list of dict

cent_broker_cfg_get_output(cent_broker_cfg_name, output_id)

This method is used to get parameters of a specific output

Parameters
  • cent_broker_cfg_name (str) – Name of the centreon broker cfg

  • output_id (str) – ID of the output

Returns

Returns the parameters from the specified output

Return type

list of dict

cent_broker_cfg_get_type_list(io_type)

This method is used to get the available types for an io type

Parameters

io_type (CentBrokerCFGIOType) – IO Type

Returns

Returns the available types

Return type

list of dict

cent_broker_cfg_get_value_list(field_name)

This method is used to get the available values for a field

Parameters

field_name (str) – Name of the field

Returns

Returns the possible values

Return type

list of dict

cent_broker_cfg_list_input(cent_broker_cfg_name)

This method is used to list input types

Parameters

cent_broker_cfg_name (str) – Name of the centreon broker cfg

Returns

Return the list of the input types

Return type

list of dict

cent_broker_cfg_list_logger(cent_broker_cfg_name)

This method is used to list logger types

Parameters

cent_broker_cfg_name (str) – Name of the centreon broker cfg

Returns

Returns the list of the logger types

Return type

list of dict

cent_broker_cfg_list_output(cent_broker_cfg_name)

This method is used to list output types

Parameters

cent_broker_cfg_name (str) – Name of the centreon broker cfg

Returns

Returns the list of the output types

Return type

list of dict

cent_broker_cfg_set_input(cent_broker_cfg_name, input_id, param_name, param_values)

This method is used to set parameters of an input

Parameters
  • cent_broker_cfg_name (str) – Name of the centreon broker config

  • input_id (str) – ID of the input

  • param_name (str) – Name of the param

  • param_values (list of str) – Values of the param

Returns

Returns True if the operation was successful

Return type

bool

cent_broker_cfg_set_logger(cent_broker_cfg_name, logger_id, param_name, param_values)

This method is used to set parameters of a logger

Parameters
  • cent_broker_cfg_name (str) – Name of the centreon broker config

  • logger_id (str) – ID of the input

  • param_name (str) – Name of the param

  • param_values (list of str) – Values of the param

Returns

Returns True if the operation was successful

Return type

bool

cent_broker_cfg_set_output(cent_broker_cfg_name, output_id, param_name, param_values)

This method is used to set parameters of an output

Parameters
  • cent_broker_cfg_name (str) – Name of the centreon broker config

  • output_id (str) – ID of the input

  • param_name (str) – Name of the param

  • param_values (list of str) – Values of the param

Returns

Returns True if the operation was successful

Return type

bool

cent_broker_cfg_set_param(cent_broker_cfg_name, param_name, param_value)

This method is used to set a specified parameter

Parameters
  • cent_broker_cfg_name (str) – Name of the centreon broker cfg

  • param_name (CentBrokerCFGParam) – Name of the parameter

  • param_value (str) – Value of the parameter

Returns

Returns True if the operation is successful

Return type

bool

cent_broker_cfg_show()

This method is used to show the available Centreon broker cfg

Returns

Returns the available centreon broker cfg

Return type

list of CentBrokerCFG

cent_engine_cfg_add(cent_engine_cfg_name, instance_name, comment)

This method is used to add a new centreon engine configuration

Parameters
  • cent_engine_cfg_name (str) – Name of the centreon engine configuration

  • instance_name (str) – Name of the instance, the centreon engine configuration should be lniked with

  • comment (str) – Comments regarding the centreon engine configuration

Returns

Returns True if the operation was successful

Return type

bool

cent_engine_cfg_add_broker_module(cent_engine_cfg_name, module_names)

This method is used to add a broker module without removing existing modules

Parameters
  • cent_engine_cfg_name (str) – Name of the centreon engine configuration

  • module_names (list of str) – List of the names of the modules

Returns

Returns True if the operation was successful

Return type

bool

cent_engine_cfg_del(cent_engine_cfg_name)

This method is used to delete a centreon engine configuration

Parameters

cent_engine_cfg_name (str) – Name of the centreon engine configuration

Returns

Returns True if the operation was successful

Return type

bool

cent_engine_cfg_del_broker_module(cent_engine_cfg_name, module_names)

This method is used to delete a broker module without removing existing modules

Parameters
  • cent_engine_cfg_name (str) – Name of the centreon engine configuration

  • module_names (list of str) – List of the names of the modules

Returns

Returns True if the operation was successful

Return type

bool

cent_engine_cfg_set_param(cent_engine_cfg_name, param_name, param_value)

This method is used to set a parameter for an engine configuration

Parameters
  • cent_engine_cfg_name (str) – Name of the centreon engine configuration

  • param_name (CentEngineCFGParam) – Name of the parameter

  • param_value (See CentEngineCFGParam for further information) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

cent_engine_cfg_show()

This method is used to list all available centreon engine configurations

Returns

Returns a list of centreon engine configurations

Return type

list of CentEngineCFG

cmd_add(cmd_name, cmd_type, command_line)

This method is used to add a command. Generating configuration files and restarting the monitoring engine is required

Parameters
  • cmd_name (str) – Name of the command

  • cmd_type (CMDType) – Type of the command

  • command_line (str) – Command to execute in command line

Returns

Returns True if the operation was successful

Return type

bool

cmd_del(cmd_name)

This method is used to delete a command. Generating configuration files and restarting the monitoring engine is required

Parameters

cmd_name (str) – Name of the command

Returns

Returns True if the operation was successful

Return type

bool

cmd_get_argument_description(cmd_name)

This method is used to get the argument description for a command

Parameters

cmd_name (str) – Name of the command

Returns

Returns the argument description

Return type

list of dict

cmd_set_argument_description(cmd_name, arg_descriptions)

This method is used to set the argument description for a command

Parameters
  • cmd_name (str) – Name of the command

  • arg_descriptions (list of str) – Descriptions of the description

Returns

Returns True if the operation was successful

Return type

bool

cmd_set_param(cmd_name, param_name, param_value)

This method is used to set or change a specific parameter for a command. Generating configuration files and restarting the monitoring engine is required

Parameters
  • cmd_name (str) – Name of the command

  • param_name (str) – Name of the parameter

  • param_value (CMDParam) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

cmd_show()

This method is used to list all available commands

Returns

Returns the available commands

Return type

list of CMD

contact_add(name, alias, email, password, admin, gui_access, language, authentication_type)

This method is used to add a contact. Generating configuration files and restarting the monitoring engine is required

Parameters
  • name (str) – Name of the contact

  • alias (str) – Alias of the contact

  • email (str) – EMail of the contact

  • password (str) – Password of the contact

  • admin (bool) – Is the contact an admin

  • gui_access (bool) – Has the contact access to the gui?

  • language (str) – Language of the contact

  • authentication_type (ContactAuthenticationType) – Authentication type

Returns

Returns True if the operation was successful

Return type

bool

contact_del(contact_name)

This method is used to delete a contact. Generating configuration files and restarting the monitoring engine is required

Parameters

contact_name (str) – Name of the contact

Returns

Returns True if the operation was successful

Return type

bool

contact_disable(contact_alias)

This method is used to disable a host. Generating configuration files and restarting the monitoring engine is required

Parameters

contact_alias (str) – Alias of the contact

Returns

Returns True if the operation is successful

Return type

bool

contact_enable(contact_alias)

This method is used to enable a host. Generating configuration files and restarting the monitoring engine is required

Parameters

contact_alias (str) – Alias of the contact

Returns

Returns True if the operation is successful

Return type

bool

contact_group_add(name, alias)

This method is used to add a contact group. Generating configuration files and restarting the engine is required

Parameters
  • name (str) – Name of the contact group

  • alias (str) – Alias of the contact group

Returns

Returns True if the operation was successful

Return type

bool

contact_group_add_contact(contact_group_name, contact_names)

This method is used to add a contact to the linked contacts of a contact group. Generating configuration files and restarting the engine is required

Parameters
  • contact_group_name (str) – Name of the contact group

  • contact_names (list of str) – List of the names of contacts

Returns

Returns True if the operation was successful

Return type

bool

contact_group_del(name)

This method is used to delete a contact group. Generating configuration files and restarting the engine is required

Parameters

name (str) – Name of the contact group

Returns

Returns True if the operation was successful

Return type

bool

contact_group_del_contact(contact_group_name, contact_name)

This method is used to delete a linked contact of a contact group

Parameters
  • contact_group_name (str) – Name of the contact group

  • contact_name (str) – Name of the contact

Returns

Returns True if the operation was successful

Return type

bool

contact_group_disable(contact_group_name)

This method is used to disable a contact group. Generating configuration files and restarting the engine is required

Parameters

contact_group_name (str) – Name of the contact group

Returns

Returns True if the operation was successful

Return type

bool

contact_group_enable(contact_group_name)

This method is used to enable a contact group. Generating configuration files and restarting the engine is required

Parameters

contact_group_name (str) – Name of the contact group

Returns

Returns True if the operation was successful

Return type

bool

contact_group_get_contact(contact_group_name)

This method is used to get the list of contacts that are linked to a contact group

Parameters

contact_group_name (str) – Name of the contact group

Returns

Returns the list of linked contacts

Return type

list of dict

contact_group_set_contact(contact_group_name, contact_names)

This method is used to set the contacts for a contact group. Existing contacts are overwritten. Generating configuration files and restarting the engine is required

Parameters
  • contact_group_name (str) – Name of the contact group

  • contact_names (list of str) – List of the names of the contacts

Returns

Returns True if the operation was successful

Return type

bool

contact_group_set_param(contact_group_name, param_name, param_value)

This method is used to set a parameter for a contact group. Generating configuration files and restarting the engine is required

Parameters
  • contact_group_name (str) – Name of the contact group

  • param_name (ContactGroupParam) – Name of the parameter

  • param_value (str) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

contact_group_show()

This method is used to list all available contact groups. Generating configuration files and restarting the engine is required

Returns

Returns a list of all available contact groups

Return type

ContactGroup

contact_set_param(alias, param_name, param_value)

This method is used to set a parameter for a contact. Generating configuration files and restarting the monitoring engine is required

Parameters
  • alias (str) – Alias of the contact

  • param_name (ContactParam) – Name of the parameter

  • param_value (See ContactParam for information about the data type) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

contact_show()

This method is used to list all available contacts

Returns

Returns all available contacts

Return type

list of Contact

contact_template_add(name, alias, email, password, admin, gui_access, language, authentication_type)

This method is used to add a new contact template. Generating configuration files and restarting the monitoring engine is required

Parameters
  • name (str) – Name of the contact

  • alias (str) – Alias of the contact

  • email (str) – EMail of the contact

  • password (str) – Password of the contact

  • admin (bool) – Is the contact an admin?

  • gui_access (bool) – Has the contact gui access?

  • language (str) – Language of the contact

  • authentication_type (ContactTemplateAuthType) – Authentication type used be the contact

Returns

Returns True if the operation was successful

Return type

bool

contact_template_del(name)

This method is used to delete a contact template. Generating configuration files and restarting the monitoring engine is required

Parameters

name (str) – Name of the contact template

Returns

Returns True if the operation was successful

Return type

bool

contact_template_disable(contact_template_name)

This method is used to disable a contact template. Generating configuration files and restarting the engine is required

Parameters

contact_template_name (str) – Name of the contact template

Returns

Returns True if the operation was successful

Return type

bool

contact_template_enable(contact_template_name)

This method is used to enable a contact template. Generating configuration files and restarting the monitoring engine is required

Parameters

contact_template_name (str) – Name of the contact template

Returns

Returns True if the operation was successful

Return type

bool

contact_template_set_param(contact_template_alias, param_name, param_value)

This method is used to set a parameter of a contact template. Generating configuration files and restarting the monitoring engine is required

Parameters
Returns

Returns True if the operation was successful

Return type

bool

contact_template_show()

This method is used to get all available contact templates

Returns

Returns all available contact templates

Return type

list of ContactTemplate

dependency_add(name, description, dependency_type, parent_names)

This method is used to add a new dependency. Generating configuration files and restarting the engine is required

Parameters
  • name (str) – Name of the dependency

  • description (str) – Description of the dependency

  • dependency_type (DependencyType) – Type of the dependency

  • parent_names (list of str) – Name of the parent resources

Returns

Returns True if the operation was successful

Return type

bool

dependency_add_child(dependency_name, child_names)

This method is used to add children to a dependency

Parameters
  • dependency_name (str) – Name of the dependency

  • child_names (list of str) – List of children names. If children is a service, str has to be in the format “host_name,service_description”

Returns

Returns True if the operation was successful

Return type

bool

dependency_add_parent(dependency_name, parent_names)

This method is used to add parents to a dependency

Parameters
  • dependency_name (str) – Name of the dependency

  • parent_names (list of str) – List of parents. If parent is a service, str has to be in the format “host_name,service_description”

Returns

Returns True if the operation was successful

Return type

bool

dependency_del(dependency_name)

This method is used to delete a dependency. Generating configuration files and restarting the engine is required

Parameters

dependency_name (str) – Name of the dependency

Returns

Returns True if the operation is successful

Return type

bool

dependency_del_child(dependency_name, child_names)

This method is used to delete a children from a dependency

Parameters
  • dependency_name (str) – Name of the dependency

  • child_names (list of str) – List of parent names to delete. If children is a service, str has to be in the format “host_name,service_description”

Returns

Returns True if the operation was successful

Return type

bool

dependency_del_parent(dependency_name, parent_names)

This method is used to delete a parent from a dependency

Parameters
  • dependency_name (str) – Name of the dependency

  • parent_names (list of str) – List of parent names to delete. If parent is a service, str has to be in the format “host_name,service_description”

Returns

Returns True if the operation was successful

Return type

bool

dependency_list_dependencies(dependency_name)

This method is used to retrieve the dependency definitions of a dependency object

Parameters

dependency_name (str) – Name of the dependency

Returns

Returns the dependency definitions

Return type

list of dict

dependency_set_param(dependency_name, param_name, param_value)

This method is used to set a parameter for a dependency. Generating configuration files and restarting the engine is required

Parameters
  • dependency_name (str) – Name of the dependency

  • param_name (DependencyParam) – Name of the parameter

  • param_value (See DependencyParam for further information) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

dependency_show()

This method is used to show all available dependencies

Returns

Returns a list of the available dependencies

Return type

Dependency

downtime_add(downtime_name, downtime_description)

This method is used to add a recurrent downtime

Parameters
  • downtime_name (str) – Name of the downtime

  • downtime_description (str) – Description of the downtime

Returns

Returns True if the operation was successful

Return type

bool

downtime_add_host(downtime_name, host_names)

This method is used to link hosts to a recurrent downtime

Parameters
  • downtime_name (str) – Name of the downtime

  • host_names (list of str) – List of the hosts

Returns

Returns True if the operation was successful

Return type

bool

downtime_add_host_group(downtime_name, host_groups)

This method is used to link hostgroups to a recurrent downtime

Parameters
  • downtime_name (str) – Name of the downtime

  • host_groups (list of str) – List of the hostgroups

Returns

Returns True if the operation was successful

Return type

bool

downtime_add_monthly_period(downtime_name, start_time, end_time, fixed, duration, day_of_month)

This method is used to add a monthly period to a recurrent downtime

Parameters
  • downtime_name (str) – Name of the downtime

  • start_time (str) – Start time of the downtime. Format hh:mm:ss

  • end_time (str) – End time of the downtime. Format hh:mm:ss

  • fixed (bool) – Is the downtime fixed or flexible? Fixed = True, Flexible = False

  • duration (int) – Duration of the downtime in seconds

  • day_of_month (list of int) – Days of the month the downtime should be active

Returns

Returns True if the operation was successful

Return type

bool

downtime_add_service(downtime_name, services)

This method is used to link services to a recurrent downtime

Parameters
  • downtime_name (str) – Name of the downtime

  • services (list of str) – List of services. Format: [“host_name,service_name”, …]

Returns

Returns True if the operation was successful

Return type

bool

downtime_add_service_group(downtime_name, service_groups)

This method is used to link service groups to a recurrent downtime

Parameters
  • downtime_name (str) – Name of the downtime

  • service_groups (list of str) – List of service groups

Returns

Returns True if the operation was successful

Return type

bool

downtime_add_specific_period(downtime_name, start_time, end_time, fixed, duration, day_of_week, month_cycle)

This method is used to add a specific time period to a recurrent downtime

Parameters
  • downtime_name (str) – Name of the downtime

  • start_time (str) – Start time of the downtime. Format hh:mm:ss

  • end_time (str) – End time of the downtime. Format hh:mm:ss

  • fixed (bool) – Is the downtime fixed or flexible? Fixed = True, Flexible = False

  • duration (int) – Duration of the downtime in seconds

  • day_of_week (list of int) – Days of the week the downtime should be active

  • month_cycle (str) – first or last

Returns

Returns True if the operation was successful

Return type

bool

downtime_add_weekly_period(downtime_name, start_time, end_time, fixed, duration, day_of_week)

This method is used to add a weekly period to a recurrent downtime

Parameters
  • downtime_name (str) – Name of the downtime

  • start_time (str) – Start time of the downtime. Format hh:mm:ss

  • end_time (str) – End time of the downtime. Format hh:mm:ss

  • fixed (bool) – Is the downtime fixed or flexible? Fixed = True, Flexible = False

  • duration (int) – Duration of the downtime in seconds

  • day_of_week (list of int) – Days of the week the downtime should be active

Returns

Returns True if the operation was successful

Return type

bool

downtime_del(downtime_name)

This method is used to delete a recurrent downtime

Parameters

downtime_name (str) – Name of the downtime

Returns

Returns True if the operation was successful

Return type

bool

downtime_del_host(downtime_name, host_names)

This method is used to delete linked hosts from a recurrent downtime.

Parameters
  • downtime_name (str) – Name of the downtime

  • host_names (list of str) – List of the hosts

Returns

Returns True if the operation was successful

Return type

bool

downtime_del_host_group(downtime_name, host_groups)

This method is used to delete linked hostgroups from a recurrent downtime.

Parameters
  • downtime_name (str) – Name of the downtime

  • host_groups (list of str) – List of the hostgroups

Returns

Returns True if the operation was successful

Return type

bool

downtime_del_service(downtime_name, services)

This method is used to delete linked services from a recurrent downtime.

Parameters
  • downtime_name (str) – Name of the downtime

  • services (list of str) – List of services. Format: [“host_name,service_name”, …]

Returns

Returns True if the operation was successful

Return type

bool

downtime_del_service_group(downtime_name, service_groups)

This method is used to delete linked service groups from a recurrent downtime.

Parameters
  • downtime_name (str) – Name of the downtime

  • service_groups (str) – List of service groups

Returns

Returns True if the operation was successful

Return type

bool

downtime_get(downtime_name, downtime_type=None)

This method is used to retrieve information about the resources of a recurrent downtime

Parameters
  • downtime_name (str) – Name of the downtime

  • downtime_type (DowntimeType) – Optional: Type of the downtime. If not specified, all information will be recveived

Returns

Returns a list of downtimes which match the name

Return type

list of Downtime

downtime_list_periods(downtime_name)

This method is used to retrieve the periods set on a recurrent downtime

Parameters

downtime_name (str) – Name of the downtime

Returns

Returns a list of downtime periods

Return type

list of DowntimePeriod

downtime_set_host(downtime_name, host_names)

This method is used to link hosts to a recurrent downtime. Overwriting existing relationship definitions.

Parameters
  • downtime_name (str) – Name of the downtime

  • host_names (list of str) – List of the hosts

Returns

Returns True if the operation was successful

Return type

bool

downtime_set_host_group(downtime_name, host_groups)

This method is used to link hostgroups to a recurrent downtime. Overwriting existing relationship definitions.

Parameters
  • downtime_name (str) – Name of the downtime

  • host_groups (list of str) – List of the hostgroups

Returns

Returns True if the operation was successful

Return type

bool

downtime_set_param(downtime_name, param_name, param_value)

This method is used to set a parameter for a recurrent downtime

Parameters
  • downtime_name (str) – Name of the downtime

  • param_name (DowntimeParam) – Name of the parameter

  • param_value (str) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

downtime_set_service(downtime_name, services)

This method is used to link services to a recurrent downtime. Overwriting existing relationship definitions.

Parameters
  • downtime_name (str) – Name of the downtime

  • services (list of str) – List of services. Format: [“host_name,service_name”, …]

Returns

Returns True if the operation was successful

Return type

bool

downtime_set_service_group(downtime_name, service_groups)

This method is used to link service groups to a recurrent downtime. Overwriting existing relationship definitions.

Parameters
  • downtime_name (str) – Name of the downtime

  • service_groups (list of str) – List of service groups

Returns

Returns True if the operation was successful

Return type

bool

downtime_show()

This method is used to list all available recurrent downtimes

Returns

Returns a list of downtimes

Return type

Downtime

get_auth_token(username, password)

This method is used to receive the authentication token

Parameters
  • username (str) – Username of REST user

  • password (str) – Password of REST user

Returns

Returns authentication token

Return type

str

host_add(host_name, host_alias, host_address, host_templates, instance, host_groups)

This method is used to add a new host

Parameters
  • host_name (str) – Name of the host

  • host_alias (str) – Alias of the host

  • host_address (str) – Address of the host

  • host_templates (list of str) – List of host templates

  • instance (str) – Instance the host should checked from

  • host_groups (list of str) – List of host groups

Returns

Returns True if operation was successful

host_add_contact(host_name, contact_names)

This method is used to add contact(s) to a host

Parameters
  • host_name (str) – Name of the host

  • contact_names (list of str) – List of contact names

Returns

Returns True on success

Return type

bool

host_add_contact_group(host_name, contact_group_names)

This method is used to add a contact group to a host

Parameters
  • host_name (str) – Name of the host

  • contact_group_names (list of str) – List of names of the contact group

Returns

Returns True on success

Return type

bool

host_add_host_group(host_name, host_group_names)

This method is used to add host group(s) to a host

Parameters
  • host_name (str) – Name of a host

  • host_group_names (list of str) – List of the names of the host group(s)

Returns

Returns True on success

Return type

bool

host_add_parent(host_name, parent_names)

This method is used to add a parent to a host

Parameters
  • host_name (str) – Name of the host

  • parent_names (list of str) – List of names of the parent host

Returns

Returns True on success

Return type

bool

host_add_template(host_name, template_name)

This method is used to add a template to a host

Parameters
  • host_name (str) – Name of the host

  • template_name (str) – Name of the template

Returns

Returns True on success

Return type

bool

host_apply_template(host_name)

This method is used to apply a template to a host

Parameters

host_name (str) – Name of the host

Returns

Returns True on success

Return type

bool

host_category_add(host_category_name, host_category_alias)

This method is used to add a new host category

Parameters
  • host_category_name (str) – Name of the host category

  • host_category_alias (str) – Alias of the host category

Returns

Returns True if the operation was successful

Return type

bool

host_category_add_member(host_category_name, members)

This method is used to add members to a host category

Parameters
  • host_category_name (str) – Name of the host category

  • members (list of str) – List of member names

Returns

Returns True if the operation was successful

Return type

bool

host_category_del(host_category_name)

This method is used to delete a host category

Parameters

host_category_name (str) – Name of the host category

Returns

Returns True if the operation was successful

Return type

bool

host_category_del_member(host_category_name, host_names)

This method is used to delete members of a host category

Parameters
  • host_category_name (str) – Name of the host category

  • host_names (list of str) – Name of the hosts

Returns

Returns True if the operation was successful

Return type

bool

host_category_get_member(host_category_name)

This method is used to get the member that are listed to a host category

Parameters

host_category_name (str) – Name of the host category

Returns

Returns a list of members

Return type

list of dict

host_category_set_member(host_category_name, members)

This method is used to set the members of a host category. Overwrites existing linked members

Parameters
  • host_category_name (str) – Name of the category name

  • members (list of str) – List of member names

Returns

Returns True if the operation was successful

Return type

bool

host_category_set_severity(host_category_name, severity_level, severity_icon)

This method is used to set the severity of a host category

Parameters
  • host_category_name (str) – Name of the host category

  • severity_level (int) – Level of the severity

  • severity_icon (str) – Icon of the severity

Returns

Returns True if the operation was successful

Return type

bool

host_category_show()

This method is used to list all available host categories

Returns

Returns a list of categories

Return type

HostCategory

host_category_unset_severity(host_category)

This method is used to unset the severity of a host category

Parameters

host_category (str) – Name of the host category

Returns

Returns True if the operation was successful

Return type

bool

host_del(host_name)

This method is used to delete a host

Parameters

host_name (str) – Name of the host

Returns

Returns True if the operation was successful

Return type

bool

host_del_contact(host_name, contact_names)

This method is used to delete contact(s) for a host

Parameters
  • host_name (str) – Name of the host

  • contact_names (list of str) – List of names of the contact(s)

Returns

Returns True on success

Return type

bool

host_del_contact_group(host_name, contact_group_names)

This method is used to delete contact group(s) from a host

Parameters
  • host_name (str) – Name of the host

  • contact_group_names (list of str) – List of the contact group(s)

Returns

Returns True on success

Return type

bool

host_del_host_group(host_name, host_group_names)

This method is used to delete host group(s) from a host

Parameters
  • host_name (str) – Name of a host

  • host_group_names (list of str) – List of the names of the host group(s)

Returns

Returns True on success

Return type

bool

host_del_macro(host_name, macro_name)

This method is used to delete a macro for a specific host

Parameters
  • host_name (str) – Name of the host

  • macro_name (str) – Name of the macro

Returns

Returns True if the operation is successful

Return type

bool

host_del_parent(host_name, parent_names)

This method is used to delete a parent from a host

Parameters
  • host_name (str) – Name of the host

  • parent_names (list of str) – List of names of the parent host

Returns

Returns True on success

Return type

bool

host_del_template(host_name, template_name)

This method is used to remove a template from a host

Parameters
  • host_name (str) – Name of the host

  • template_name (str) – Name of the template

Returns

Returns True on success

Return type

bool

host_disable(host_name)

This method is used to enable a host

Parameters

host_name (str) – Name of the host

Returns

Returns True on success

Return type

bool

host_enable(host_name)

This method is used to enable a host

Parameters

host_name (str) – Name of the host

Returns

Returns True on success

Return type

bool

host_get_contact(host_name)

This method is used to get the contacts applied to a host

Parameters

host_name (str) – Name of the host

Returns

Returns the list of contacts

Return type

dict

host_get_contact_group(host_name)

This method is used to get the information about the contact group

Parameters

host_name (str) – Name of the host

Returns

Returns a dict, which holds the contact group information

Return type

dict

host_get_host_group(host_name)

This method is used to get the host group of a host

Parameters

host_name (str) – Name of the host

Returns

Returns dict of host groups

Return type

dict

host_get_macro(host_name)

This method is used to get the macros for a specific host

Parameters

host_name (str) – Hostname to use

Returns

Returns list of macros

Return type

list of Macro:

host_get_params(host_name, params)

This method is used to get parameter(s) from hosts

Parameters
  • host_name (str) – Name of the host

  • params (list of HostParam) – List of the parameters you want to receive

Returns

Returns a dict with the wanted results

Return type

dict

host_get_parent(host_name)

This method is used to get the parent of a host

Parameters

host_name (str) – Name of the host

Returns

Returns list of parents

Return type

list of dict

host_get_template(host_name)

This method is used to get the templates linked to a specific host

Parameters

host_name (str) – Name of the host

Returns

Returns a list of used templates (id, name)

Return type

list of dict

host_group_add(host_group_name, host_group_alias)

This method is used to add a new hostgroup. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • host_group_alias (str) – Alias of the hostgroup

Returns

Returns True if the operation was successful

Return type

bool

host_group_add_member(host_group_name, member_names)

This method is used to add members to a hostgroup. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • member_names (list of str) – List of names of the members

Returns

Returns True if the operation was successful

Return type

bool

host_group_del(host_group_name)

This method is used to delete a hostgroup. Generating configuration files and restarting the engine is required

Parameters

host_group_name (str) – Name of the host group

Returns

Returns True if the operation was successful

Return type

bool

host_group_del_member(host_group_name, member_names)

This method is used to delete members of a hostgroup. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • member_names (list of str) – List of names of members

Returns

Returns True if the operation was successful

Return type

bool

host_group_get_member(host_group_name)

This method is used to get the members of a hostgroup

Parameters

host_group_name (str) – Name of the hostgroup

Returns

Returns a list of linked members

Return type

list of dict

host_group_service_add(host_group_name, service_description, service_template)

This method is used to add a new hostgroup service. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • service_template (str) – Template of the service

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_add_contact(host_group_name, service_description, contacts)

This method is used to add a new contacts to the notification contact list. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • contacts (list of str) – Contacts which should be added

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_add_contact_group(host_group_name, service_description, contact_groups)

This method is used to add contact groups to a hostgroup service. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • contact_groups (list of str) – List of the contact groups

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_add_host_group(host_group_name, service_description, host_group_names_new)

This method is used to tia a hostgroup service to an extra hostgroup. The previous definitions will be appended. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • host_group_names_new (list of str) – List of the hostgroup names, the service should be linked to

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_add_trap(host_group_name, service_description, trap_names)

This method is used to add traps to a hostgroup service. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • trap_names (list of str) – List of the trap names

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_del(host_group_name, service_description)

This method is used to delete a hostgroup service. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_del_contact(host_group_name, service_description, contacts)

This method is used to remove contacts from the notification contact list. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • contacts (list of str) – List of the contacts to delete

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_del_contact_group(host_group_name, service_description, contact_groups)

This method is used to delete contact groups of a hostgroup service. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • contact_groups (list of str) – List of the contact groups

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_del_host(host_group_name, service_description, host_group_names_to_delete)

This method is used to delete a relation between a hostgroup and a service. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Service description

  • host_group_names_to_delete (list of str) – List of hostgroups, which should be unlinked

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_del_macro(host_group_name, service_description, macro_name)

This method is used to delete a macro. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • macro_name (str) – Name of the macro

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_del_trap(host_group_name, service_description, trap_names)

This method is used to delete traps from a hostgroup service. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • trap_names (list of str) – List of the trap names

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_get_contact(host_group_name, service_description)

This method is used to list the available contacts of a service

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

Returns

Returns the available contacts

Return type

list of dict

host_group_service_get_contact_group(host_group_name, service_description)

This method is used to list the contact groups of a service

Parameters
  • host_group_name (str) – Name of the host

  • service_description (str) – Description of the service

Returns

Returns the list of contact groups

Return type

list of dict

host_group_service_get_macro(host_group_name, service_description)

This method is used to view the custom macro list of a hostgroup service

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

Returns

Returns a list of macros

Return type

list of Macro

host_group_service_get_trap(host_group_name, service_description)

This method is used to list the traps of a hostgroup service.

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

Returns

Returns the traps

Return type

list of dict

host_group_service_set_contact(host_group_name, service_description, contacts)

This method is used to set the contacts for the notification contact list. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • contacts – List of contacts

Type

contacts: list of str

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_set_contact_group(host_group_name, service_description, contact_groups)

This method is used to set contact groups to a hostgroup service. Existing ones will be overwritten. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • contact_groups (list of str) – List of the contact groups

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_set_host(host_group_name, service_description, host_group_names_new)

This method is used to tie a service to an extra hostgroup. The previous definitions will be overwritten. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • host_group_names_new (list of str) – List of new hostgroup names

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_set_macro(host_group_name, service_description, macro_name, macro_value, macro_is_password, macro_description)

This method is used to set a macro for a hostgroup service. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • macro_name (str) – Name of the macro

  • macro_value (str) – Value of the macro

  • macro_is_password (bool) – Is the macro a password?

  • macro_description (str) – Description of the macro

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_set_param(host_group_name, service_description, param_name, param_value)

This method is used to set a parameter for a hostgroup service. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • param_name (HostGroupServiceParam) – Name of the parameter

  • param_value (See HostGroupServiceParam) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_set_severity(host_group_name, service_description, severity_name)

This method is used to associate a severity level to a hostgroup service

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • severity_name (str) – Name of the severity level

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_set_trap(host_group_name, service_description, trap_names)

This method is used to set traps for a hostgroup service. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description of the service

  • trap_names (list of str) – List of the trap names

Returns

Returns True if the operation was successful

Return type

bool

host_group_service_show()

This method is used to list all available hostgroup services

Returns

Returns a list of hostgroup services

Return type

list of HostGroupService

host_group_service_unset_severity(host_group_name, service_description)

This method is used to remove the severity from a hostgroup service

Parameters
  • host_group_name (str) – Name of the hostgroup

  • service_description (str) – Description if the service

Returns

Returns True if the operation was successful

Return type

bool

host_group_set_member(host_group_name, member_names)

This method is used to set members of a hostgroup. Overwrites existing members. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • member_names (list of str) – List of names of members

Returns

Returns True if the operation was successful

Return type

bool

host_group_set_param(host_group_name, param_name, param_value)

This method is used to set a parameter for a hostgroup. Generating configuration files and restarting the engine is required

Parameters
  • host_group_name (str) – Name of the hostgroup

  • param_name (HostGroupParam) – Name of the parameter

  • param_value (See HostGroupParam) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

host_group_show()

This method is used to list all available hostgroups

Returns

Returns a list of hostgroups

Return type

list of HostGroup

host_set_contact(host_name, contact_names)

This method is used to set contact(s) for a host

Parameters
  • host_name (str) – Name of the host

  • contact_names (list of str) – List of names of the contact(s)

Returns

Returns True on success

Return type

bool

host_set_contact_group(host_name, contact_group_names)

This method is used to set contact group(s) to a host

Parameters
  • host_name (str) – Name of the host

  • contact_group_names (list of str) – List of the names of the contact group(s)

Returns

Returns True on success

Return type

bool

host_set_host_group(host_name, host_group_names)

This method is used to set the host group(s) to a host

Parameters
  • host_name (str) – Name of a host

  • host_group_names (list of str) – List of the names of the host group(s)

Returns

Returns True on success

Return type

bool

host_set_instance(host_name, instance)

This method is used to set the instance poller for a host

Parameters
  • host_name (str) – Name of the host

  • instance (str) – Instance of the instance

Returns

Returns True if the operation was successful

Return type

bool

host_set_macro(host_name, macro_name, macro_value)

This method is used to set a macro for a specific host

Parameters
  • host_name (str) – Hostname to use

  • macro_name (str) – Name of the macro

  • macro_value (str) – Value of the macro

Returns

Returns True if the operation was successful

Return type

bool

host_set_param(host_name, param_name, param_value)

This method is used to set a param for a host

Parameters
  • host_name (str) – Name of the host

  • param_name (HostParam) – Name of the param

  • param_value (str) – Value of the param

Returns

Returns True, if operation was successful

Return type

bool

host_set_parent(host_name, parent_names)

This method is used to set the parent of a host

Parameters
  • host_name (str) – Name of the host

  • parent_names (list) – List of names of the parent

Returns

Returns True on success

Return type

bool

host_set_template(host_name, template_name)

This method is used to set a template, if other templates are linked to the host, they are removed

Parameters
  • host_name (str) – Name of the host

  • template_name (str) – Name of the template

Returns

Returns True on success

Return type

bool

host_show()

This method is used to list all available hosts

Returns

Returns hosts available in centreon

Return type

list of Host:

host_status_get(*, viewType=None, fields=None, status=None, hostgroup=None, instance=None, search=None, critically=None, sortType=None, order=None, limit=None, number=None)

This method is used to get the host status from a host object

Parameters
  • viewType (str) – Select a predefined filter like in the monitoring view. One of all, unhandled, problems

  • fields (str) – The field list you want to get, separated by a “,”.

  • status (str) – The status of hosts you want to get. One of up, down, unreachable, pending, all

  • hostgroup (str) – Hostgroup id filter

  • instance (str) – Instance id filter

  • search (str) – Search pattern applied on host name

  • critically (str) – Specify critically

  • sortType (str) – The sort type, selected in the field list

  • order (str) – ASC or DESC

  • limit (int) – Limit the number of lines, you want to receive

  • number (int) – Specify page number

Returns

Returns a list of HostStatus

Return type

list of dict

instance_add(name, address, ssh_port)

This method is used to add an instance.

Parameters
  • name (str) – Name of the instance

  • address (str) – Address of the instance

  • ssh_port (int) – Port of the SSH Server

Returns

Returns True if the operation was successful

Return type

bool

instance_del(instance_name)

This method is used to delete an instance.

Parameters

instance_name (str) – Name of the instance

Returns

Returns True if the operation was successful

Return type

bool

instance_get_hosts(instance_name)

This method is used to list all hosts that are linked to an instance

Parameters

instance_name (str) – Name of the instance

Returns

Returns a list of hosts

Return type

list of dict

instance_set_param(instance_name, param_name, param_value)

This method is used to set a parameter for an instance.

Parameters
  • instance_name (str) – Name of the instance

  • param_name (InstanceParam) – Name of the parameter

  • param_value (See InstanceParam for further information.) – Value of the parameter. See InstanceParam for further information.

Returns

instance_show()

This method is used to list the available instances, also called poller

Returns

Returns a list of instances

Return type

list of Instance

ldap_add(ldap_name, description)

This method is used to add a new LDAP configuration

Parameters
  • ldap_name (str) – Name of the configuration

  • description (str) – Description of the configuration

Returns

Returns True if the operation was successful

Return type

bool

ldap_add_server(ldap_name, server_address, server_port, use_ssl, use_tls)

This method is used to add a server to a LDAP configuration

Parameters
  • ldap_name (str) – Name of the configuration

  • server_address (str) – Address of the server

  • server_port (int) – Port of the server

  • use_ssl (bool) – Use SSL?

  • use_tls (bool) – Use TLS?

Returns

Returns True if the operation was successful

Return type

bool

ldap_del(ldap_name)

This method is used to delete a LDAP configuration

Parameters

ldap_name (str) – Name of the configuration

Returns

Returns True if the operation was successful

Return type

bool

ldap_del_server(server_id)

This method is used to delete a server from a ldap configuration

Parameters

server_id – ID of the server

Type

server_id: int

Returns

Returns True if the operation was successful

Return type

bool

ldap_set_param(ldap_name, param_name, param_value)

This method is used to set a parameter of a LDAP configuration

Parameters
  • ldap_name (str) – Name of the configuration

  • param_name (LDAPParam) – Name of the parameter

  • param_value (See LDAPParam) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

ldap_set_param_server(server_id, param_name, param_value)

This method is used to set the parameter for a server

Parameters
  • server_id (int) – ID of the server

  • param_name (LDAPServerParam) – Name of the parameter

  • param_value (See LDAPServerParam) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

ldap_show()

This method is used to list all available LDAP configurations

Returns

Returns the available LDAP configuration

Return type

list of LDAP

ldap_show_server(ldap_name)

This method is used to show the server list of the ldap configuration

Parameters

ldap_name (str) – Name of the ldap configuration

Returns

Returns a list of ldap servers

Return type

list of LDAPServer

poller_apply_config(poller)

This method is used as a all in one command to apply a config to a poller

Parameters

poller (Union[str,int]) – ID or name of the poller

poller_execute_post_generation_commands(poller)

This method is used to execute post generation commands of a poller

Parameters

poller (Union[str,int]) – ID or name of the poller

poller_generate_config_files(poller)

This method is used to generate the configuration files for a specific poller

Parameters

poller (Union[int,str]) – ID or name of the poller

poller_list()

This method is used to list all available pollers

Returns

Returns a list of pollers

Return type

list of Poller

poller_move_monitoring_engine_cfg_files(poller)

This method is used to move the configuration files for a poller to the final directory

Parameters

poller (Union[str,int]) – ID or name of the poller

poller_reload_monitoring_engine(poller)

This method is used to reload the monitoring engine of a poller

Parameters

poller (Union[str,int]) – ID or name of the monitoring engine of a poller

poller_restart_monitoring_engine(poller)

This method is used to restart the monitoring engine of a poller

Parameters

poller (Union[str,int]) – ID or name of the poller

poller_test_config_files(poller)

This method is used to test the configuration files of a poller

Parameters

poller (Union[str,int]) – ID or name of the poller

real_time_acknowledgement_add_host(host_name, description, sticky, notify_contacts, persistent_comment)

This method is used to add a new acknowledgement for a host

Parameters
  • host_name (str) – Name of the host

  • description (str) – Description of the acknowledgement

  • sticky (bool) – Is the acknowledgement maintained in case of a change of status

  • notify_contacts (bool) – Should notification be send to the contacts linked to the object

  • persistent_comment (bool) – Should the acknowledgement be maintained in the case of a restart of the scheduler

Returns

Returns True if the operation was successful

Return type

bool

real_time_acknowledgement_add_service(host_name, services, description, sticky, notify_contacts, persistent_comment)

This method is used to add a new acknowledgement for a service

Parameters
  • host_name (str) – Name of the host

  • services (list of str) – List of service descriptions

  • description (str) – Description of the acknowledgement

  • sticky (bool) – Is the acknowledgement maintained in case of a change of status

  • notify_contacts (bool) – Should notification be send to the contacts linked to the object

  • persistent_comment (bool) – Should the acknowledgement be maintained in the case of a restart of the scheduler

Returns

Returns True if the operation was successful

Return type

bool

real_time_acknowledgement_cancel(acknowledgement_name)

This method is used to cancel a acknowledgement

Parameters

acknowledgement_name (str) – Name of the acknowledged resources. In case of service: “host_name,service_description”

Returns

Returns True if the operation was successful

Return type

bool

real_time_acknowledgement_show()

This method is used to show all available acknowledgements

Returns

Returns a list of available downtimes in forrmat: [{“hosts”: “”, “services”: “”}, {…}]

Return type

list of dict

real_time_acknowledgement_show_host(host_name)

This method is used to show all available real time acknowledgements for a host

Parameters

host_name (str) – Name of the host

Returns

Returns a list of real time acknowledgements

Return type

list of RealTimeAcknowledgement

real_time_acknowledgement_show_service(service_name)

This method is used to show all available real time acknowledgements for a service

Parameters

service_name (str) – Name of the service. Format: “host_name,service_description”

Returns

Returns a list of real time acknowledgements

Return type

list of RealTimeAcknowledgement

real_time_downtime_add_host(host_name, start_time, end_time, fixed, duration, description, apply_on_linked_services)

This method is used to add a downtime for a host

Parameters
  • host_name (str) – Name of the host

  • start_time (str) – Beginning of the downtime. Format YYYY/MM/DD HH:mm

  • end_time (str) – End of the downtime. Format YYYY/MM/DD HH:mm

  • fixed (bool) – Is the downtime fixed

  • duration (int) – Duration of a flexible downtime

  • description (int) – Description of the downtime

  • apply_on_linked_services (bool) – Should the downtime also be applied on the linked services

Returns

Returns True if the operation was successful

Return type

bool

real_time_downtime_add_host_group(host_group_name, start_time, end_time, fixed, duration, description, apply_on_linked_services)

This method is used to add a downtime for a host group

Parameters
  • host_group_name (str) – Name of the host group

  • start_time (str) – Beginning of the downtime. Format YYYY/MM/DD HH:mm

  • end_time (str) – End of the downtime. Format YYYY/MM/DD HH:mm

  • fixed (bool) – Is the downtime fixed

  • duration (int) – Duration of a flexible downtime

  • description (int) – Description of the downtime

  • apply_on_linked_services (bool) – Should the downtime also be applied on the linked services

Returns

Returns True if the operation was successful

Return type

bool

real_time_downtime_add_instance(instance_name, start_time, end_time, fixed, duration, description)

This method is used to add a downtime for a instance

Parameters
  • instance_name (str) – Name of the instance

  • start_time (str) – Start time

  • start_time – Beginning of the downtime. Format YYYY/MM/DD HH:mm

  • end_time (str) – End of the downtime. Format YYYY/MM/DD HH:mm

  • fixed (bool) – Is the downtime fixed

  • duration (int) – Duration of a flexible downtime

  • description (int) – Description of the downtime

Returns

Returns True if the operation was successful

Return type

bool

real_time_downtime_add_service(service_names, start_time, end_time, fixed, duration, description)

This method is used to add a downtime for a service

Parameters
  • service_names (list of str) – List of service names. Format [“host_name,service_name”, …]

  • start_time (str) – Start time

  • start_time – Beginning of the downtime. Format YYYY/MM/DD HH:mm

  • end_time (str) – End of the downtime. Format YYYY/MM/DD HH:mm

  • fixed (bool) – Is the downtime fixed

  • duration (int) – Duration of a flexible downtime

  • description (int) – Description of the downtime

Returns

Returns True if the operation was successful

Return type

bool

real_time_downtime_add_service_group(service_group_name, start_time, end_time, fixed, duration, description)

This method is used to add a downtime for a service group

Parameters
  • service_group_name (str) – Service group

  • start_time (str) – Start time

  • start_time – Beginning of the downtime. Format YYYY/MM/DD HH:mm

  • end_time (str) – End of the downtime. Format YYYY/MM/DD HH:mm

  • fixed (bool) – Is the downtime fixed

  • duration (int) – Duration of a flexible downtime

  • description (int) – Description of the downtime

Returns

Returns True if the operation was successful

Return type

bool

real_time_downtime_cancel(downtime_ids)

This method is used to cancel a downtime

Parameters

downtime_ids (list of int) – List of the ids of the downtimes

Returns

Returns True if the operation was successful

Return type

bool

real_time_downtime_show()

This method is used to show all available downtimes

Returns

Returns a list of all available downtimes

Return type

list of dict

real_time_downtime_show_host(host_name=None)

This method is used to list all downtimes for host objects or retrieve information about a specific downtime

Parameters

host_name (str) – Optional: Name of the host

Returns

Returns a list of downtimes for a host object

Return type

list of RealTimeDowntimeHost

real_time_downtime_show_service(service_name=None)

This method is used to list all downtimes for service objects or retrieve information about a specific service

Parameters

service_name (str) – Optional: Name of the service. Format “host_name,service_name”

Returns

Returns a list of downtimes for service objets

Return type

list of RealTimeDowntimeService

resource_cfg_add(macro_name, macro_value, instances, comment)

This method is used to add a new resource variable

Parameters
  • macro_name (str) – Name of the macro

  • macro_value (str) – Value of the macro

  • instances (list of str) – Instances that are tied to macros

  • comment (str) – Comment of the resource

Returns

Returns True if the operation was successful

Return type

bool

resource_cfg_del(resource_id)

This method is used to delete a resource variable

Parameters

resource_id (int) – ID of the resource

Returns

Returns True if the operation was successful

Return type

bool

resource_cfg_set_param(resource_id, param_name, param_value)

This method is used to set a parameter for a resource variable

Parameters
  • resource_id (int) – ID of the resource

  • param_name (ResourceCFGParam) – Name of the parameter

  • param_value (See ResourceCFGParam) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

resource_cfg_show()

This method is used to show the available resource variables

Returns

Returns a list of resource variables

Return type

list of ResourceCFG

service_add(host_name, service_description, service_template)

This method adds a new service to a host. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • service_template (str) – Template of the service. Only on service template can be defined

Returns

Returns True if the operation was successful

Return type

bool

service_add_contact(host_name, service_description, contacts)

This method is used to add a new contacts to the notification contact list. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • contacts (list of str) – Contacts which should be added

Returns

Returns True if the operation was successful

Return type

bool

service_add_contact_group(host_name, service_description, contact_groups)

This method is used to add contact groups to a service. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • contact_groups (list of str) – List of the contact groups

Returns

Returns True if the operation was successful

Return type

bool

service_add_host(host_name, service_description, host_names_new)

This method is used to tia a service to an extra host. The previous definitions will be appended. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • host_names_new (list of str) – List of the host names, the service should be linked to

Returns

Returns True if the operation was successful

Return type

bool

service_add_trap(host_name, service_description, trap_names)

This method is used to add traps to a service. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • trap_names (list of str) – List of the trap names

Returns

Returns True if the operation was successful

Return type

bool

service_category_add(service_category_name, service_category_description)

This method is used to add a new service category

Parameters
  • service_category_name (str) – Name of the service category

  • service_category_description (str) – Description of the service category

Returns

Returns True if the operation was successful

Return type

bool

service_category_add_service(service_category_name, service_names)

This method is used to add services to a service category

Parameters
  • service_category_name (str) – Name of the service category

  • service_names (list of str) – List of service names. Format [“host_name,service_name”, …]

Returns

Returns True if the operation was successful

Return type

bool

service_category_add_service_template(service_category_name, service_template_names)

This method is used to add service templates to a service category

Parameters
  • service_category_name (str) – Name of the service category

  • service_template_names (list of str) – List of service templates

Returns

Returns True if the operation was successful

Return type

bool

service_category_del(service_category_name)

This method is used to delete a service category

Parameters

service_category_name (str) – Name of the service category

Returns

Returns True if the operation was successful

Return type

bool

service_category_del_service(service_category_name, service_names)

This method is used to set service templates for a service category. Overwrites previous definitions.

Parameters
  • service_category_name (str) – Name of the service category

  • service_names (list of str) – List of services. Format [“host_name,service_name”, …]

Returns

Returns True if the operation was successful

Return type

bool

service_category_del_service_template(service_category_name, service_template_names)

This method is used to delete service templates from a service category.

Parameters
  • service_category_name (str) – Name of the service category

  • service_template_names (list of str) – List of service templates

Returns

Returns True if the operation was successful

Return type

bool

service_category_get_service(service_category_name)

This method is used to get the linked services of a service category

Parameters

service_category_name (str) – Name of the service category

Returns

Returns True if the operation was successful

Return type

bool

service_category_get_service_template(service_category_name)

This method is used to get the linked service templates of a service category

Parameters

service_category_name (str) – Name of the service category

Returns

Returns True if the operation was successful

Return type

bool

service_category_set_param(service_category_name, param_name, param_value)

This method is used to set a parameter for a service category

Parameters
  • service_category_name (str) – Name of the service category

  • param_name (ServiceCategoryParam) – Name of the parameter

  • param_value (See ServiceCategory) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

service_category_set_service(service_category_name, service_names)

This method is used to set services for a service category. Overwrites previous definitions.

Parameters
  • service_category_name (str) – Name of the service category

  • service_names (list of str) – List of service names. Format [“host_name,service_name”, …]

Returns

Returns True if the operation was successful

Return type

bool

service_category_set_service_template(service_category_name, service_template_names)

This method is used to set service templates for a service category. Overwrites previous definitions.

Parameters
  • service_category_name (str) – Name of the service category

  • service_template_names (list of str) – List of service templates

Returns

Returns True if the operation was successful

Return type

bool

service_category_set_severity(service_category_name, severity_level, severity_icon)

This method is used to turn a service category into a severity

Parameters
  • service_category_name (str) – Name of the service category

  • severity_level (int) – Level of the severity

  • severity_icon (str) – Icon of the severity

Returns

Returns True if the operation was successful

Return type

bool

service_category_show()

This method is used to show all available service categories

Returns

Returns a list of service categories

Return type

list of ServiceCategory

service_category_unset_severity(service_category_name)

This method is used to turn a severity in a regular service category

Parameters

service_category_name (str) – Name of the service category

Returns

Returns True if the operation was successful

Return type

bool

service_del(host_name, service_description)

This method is used to delete a service. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

Returns

Returns True if the operation was successful

Return type

bool

service_del_contact(host_name, service_description, contacts)

This method is used to remove contacts from the notification contact list. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • contacts (list of str) – List of the contacts to delete

Returns

Returns True if the operation was successful

Return type

bool

service_del_contact_group(host_name, service_description, contact_groups)

This method is used to delete contact groups of a service. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • contact_groups (list of str) – List of the contact groups

Returns

Returns True if the operation was successful

Return type

bool

service_del_host(host_name, service_description, host_names_to_delete)

This method is used to delete a relation between a host and a service. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Service description

  • host_names_to_delete (list of str) – List of hosts, which should be unlinked

Returns

Returns True if the operation was successful

Return type

bool

service_del_macro(host_name, service_description, macro_name)

This method is used to delete a macro. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • macro_name (str) – Name of the macro

Returns

Returns True if the operation was successful

Return type

bool

service_del_trap(host_name, service_description, trap_names)

This method is used to delete traps from a service. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • trap_names (list of str) – List of the trap names

Returns

Returns True if the operation was successful

Return type

bool

service_get_contact(host_name, service_description)

This method is used to list the available contacts of a service

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

Returns

Returns the available contacts

Return type

list of dict

service_get_contact_group(host_name, service_description)

This method is used to list the contact groups of a service

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

Returns

Returns the list of contact groups

Return type

list of dict

service_get_macro(host_name, service_description)

This method is used to view the custom macro list of a service

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

Returns

Returns a list of macros

Return type

list of Macro

service_get_trap(host_name, service_description)

This method is used to list the traps of a service.

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

Returns

Returns the traps

Return type

list of dict

service_group_add(service_group_name, service_group_alias)

This method is used to add a new service group. Generating configuration files and restarting the engine is required

Parameters
  • service_group_name (str) – Name of the service group

  • service_group_alias (str) – Alias of the service group

Returns

Returns True if the operation was successful

Return type

bool

service_group_add_host_group_service(service_group_name, host_group_services)

This method is used to add hostgroup services to a service group. Generating configuration files and restarting the engine is required

Parameters
  • service_group_name (str) – Name of the service group

  • host_group_services (list of str) – List of hostgroup services. Format [“host_group_name,service_name”, …]

Returns

Returns True if the operation was successful

Return type

bool

service_group_add_service(service_group_name, services)

This method is used to add services to a service group. Generating configuration files and restarting the engine is required

Parameters
  • service_group_name (str) – Name of the service group

  • services (list of str) – List of services. Format [“host_name,service_name”, …]

Returns

Returns True if the operation was successful

Return type

bool

service_group_del(service_group_name)

This method is used to delete a service group. Generating configuration files and restarting the engine is required

Parameters

service_group_name (str) – Name of the service group

Returns

Returns True if the operation was successful

Return type

bool

service_group_del_host_group_service(service_group_name, host_group_services)

This method is used to delete hostgroup services from a service group. Generating configuration files and restarting the engine is required

Parameters
  • service_group_name (str) – Name of the service group

  • host_group_services (list of str) – List of hostgroup services. Format [“host_group_name,service_name”, …]

Returns

Returns True if the operation was successful

Return type

bool

service_group_del_service(service_group_name, services)

This method is used to delete services from a service group. Generating configuration files and restarting the engine is required

Parameters
  • service_group_name (str) – Name of the service group

  • services (list of str) – List of services. Format [“host_name,service_name”, …]

Returns

Returns True if the operation was successful

Return type

bool

service_group_get_host_group_service(service_group_name)

This method is used to list all available hostgroup services that are linked to a service group

Parameters

service_group_name (str) – Name of the service group

Returns

Returns True if the operation was successful

Return type

bool

service_group_get_service(service_group_name)

This method is used to list all available services that are linked to a service group

Parameters

service_group_name (str) – Name of the service group

Returns

Returns a list of services

Return type

list of dict

service_group_set_host_group_service(service_group_name, host_group_services)

This method is used to set hostgroup services for a service group. Overwrites existing definitions. Generating configuration files and restarting the engine is required

Parameters
  • service_group_name (str) – Name of the service group

  • host_group_services (list of str) – List of hostgroup services. Format [“host_name,service_name”, …]

Returns

Returns True if the operation was successful

Return type

bool

service_group_set_param(service_group_name, param_name, param_value)

This method is used to set the parameter for a service group. Generating configuration files and restarting the engine is required

Parameters
  • service_group_name (str) – Name of the service group

  • param_name (ServiceGroupParam) – Name of the parameter

  • param_value (See ServiceGroupParam) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

service_group_set_service(service_group_name, services)

This method is used to set services for a service group. Overwrites existing definitions. Generating configuration files and restarting the engine is required

Parameters
  • service_group_name (str) – Name of the service group

  • services (list of str) – List of services. Format [“host_name,service_name”, …]

Returns

Returns True if the operation was successful

Return type

bool

service_group_show()

This method is used to show all available service groups

Returns

Returns a list of service groups

Return type

list of Service Group

service_set_contact(host_name, service_description, contacts)

This method is used to set the contacts for the notification contact list. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • contacts – List of contacts

Type

contacts: list of str

Returns

Returns True if the operation was successful

Return type

bool

service_set_contact_group(host_name, service_description, contact_groups)

This method is used to set contact groups to a service. Existing ones will be overwritten. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • contact_groups (list of str) – List of the contact groups

Returns

Returns True if the operation was successful

Return type

bool

service_set_host(host_name, service_description, host_names_new)

This method is used to tie a service to an extra host. The previous definitions will be overwritten. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • host_names_new (list of str) – List of new host names

Returns

Returns True if the operation was successful

Return type

bool

service_set_macro(host_name, service_description, macro_name, macro_value, macro_is_password, macro_description)

This method is used to set a macro for a service. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • macro_name (str) – Name of the macro

  • macro_value (str) – Value of the macro

  • macro_is_password (bool) – Is the macro a password?

  • macro_description (str) – Description of the macro

Returns

Returns True if the operation was successful

Return type

bool

service_set_param(host_name, service_description, param_name, param_value)

This method is used to set a parameter for a service. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • param_name (ServiceParam) – Name of the parameter

  • param_value (str) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

service_set_severity(host_name, service_description, severity_name)

This method is used to associate a severity level to a service

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • severity_name (str) – Name of the severity level

Returns

Returns True if the operation was successful

Return type

bool

service_set_trap(host_name, service_description, trap_names)

This method is used to set traps for a service. Generating configuration files and restarting the engine is required

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description of the service

  • trap_names (list of str) – List of the trap names

Returns

Returns True if the operation was successful

Return type

bool

service_show()

This method is used to list all available services

Returns

Returns a list of all available services

Return type

list of Service

service_status_get(*, viewType=None, fields=None, status=None, hostgoup=None, servicegroup=None, instance=None, search=None, searchHost=None, searchOutput=None, criticality=None, sortType=None, order=None, limit=None, number=None)

This method is used to get information about the service status from a service object

Parameters
  • viewType (str) – Select a predefined filter like in the monitoring view. One of all, unhandled, problems

  • fields (str) – The field list you want to get, separated by a “,”.

  • status (str) – The status of services you want to get. One of ok, warning, critical, unknown, pending, all

  • hostgoup (str) – Hostgroup id filter

  • servicegroup (str) – Servicegroup id filter

  • instance (str) – Instance id filter

  • search (str) – Search pattern applied on the service

  • searchHost (str) – Search pattern applied on the host

  • searchOutput (str) – Search pattern applied on the output

  • criticality (str) – A specific criticity

  • sortType (str) – The sort type, selected in the field list

  • order (str) – ASC or DESC

  • limit (int) – number of line you want

  • number (int) – page number

Returns

Returns a list of ServiceStatus

Return type

list of dict

service_template_add(template_description, template_alias, service_template='')

This method is used to add a service template. Generating configuration files and restarting the engine is required

Parameters
  • template_description (str) – Description of the service template

  • template_alias (str) – Alias of the template

  • service_template (str) – Optional: Service template the new template should inherit

Returns

Returns True if the operation was successful

Return type

bool

service_template_add_contact(template_description, contact_names)

This method is used to add contacts to a service template. Generating configuration files and restarting the engine is required

Parameters
  • template_description (str) – Description of the template

  • contact_names (list of str) – List of contact names

Returns

Returns True if the operation was successful

Return type

bool

service_template_add_contact_group(template_description, contact_group_names)

This method is used to add contact groups to a service template. Generating configuration files and restarting the engine is required

Parameters
  • template_description (str) – Description of the service template

  • contact_group_names (list of str) – List of contact group names

Returns

Returns True if the operation was successful

Return type

bool

service_template_add_host_template(service_template_description, host_templates)

This method is used to link host templates to a service template. Generating configuration files and restarting the engine is required

Parameters
  • service_template_description (str) – Description of the service template

  • host_templates (list of str) – List of host templates

Returns

Returns True if the operation was successful

Return type

bool

service_template_add_trap(template_description, trap_names)

This method is used to add traps to a service template. Generating configuration files and restarting the engine is required

Parameters
  • template_description (str) – Description of the service template

  • trap_names (list of str) – List of trap names

Returns

Returns True if the operation was successful

Return type

bool

service_template_del(template_description)

This method is used to delete a service template. Generating configuration files and restarting the engine is required

Parameters

template_description (str) – Description of the service template

Returns

Returns True if the operation was successful

Return type

bool

service_template_del_contact(template_description, contact_names)

This method is used to delete contacts from a service template. Generating configuration files and restarting the engine is required

Parameters
  • template_description (str) – Description of the service template

  • contact_names (list of str) – List of contact names

Returns

Returns True if the operation was successful

Return type

bool

service_template_del_host_template(service_template_description, host_templates)

This method is used to delete host templates from a service template. Generating configuration files and restarting the engine is required

Parameters
  • service_template_description (str) – Description of the service template

  • host_templates (list of str) – List of host templates

Returns

Returns True if the operation was successful

Return type

bool

service_template_del_macro(template_description, macro_name)

This method is used to delete a macro from a service template. Generating configuration files and restarting the engine is required

Parameters
  • template_description (str) – Description of the template

  • macro_name (str) – Name of the macro

Returns

Returns True if the operation was successful

Return type

bool

service_template_del_trap(template_description, trap_names)

This method is used to delete traps from a service template. Generating configuration files and restarting the engine is required

Parameters
  • template_description (str) – Description of the service template

  • trap_names (list of str) – List of trap names

Returns

Returns True if the operation was successful

Return type

bool

service_template_get_contact(template_description)

This method is used to get the contacts that are linked to the service template

Parameters

template_description (str) – Description of the template

Returns

Returns a list of contacts

Return type

list of dict

service_template_get_contact_group(template_description)

This method is used to get the contact groups that are linked to a service template

Parameters

template_description (str) – Description of the service template

Returns

Returns a list of contact groups

Return type

list of dict

service_template_get_macro(template_description)

This method is used to get a list of custom macros of a service template

Parameters

template_description (str) – Description of the template

Returns

Returns a list of macros

Return type

list of Macro

service_template_get_trap(template_description)

This method is used to get the trap list of a service template

Parameters

template_description (str) – Description of the service template

Returns

Returns a list of traps

Return type

list of dict

service_template_set_contact(template_description, contact_names)

This method is used to set the contacts for a service templates. Overwrites previous definitions. Generating configuration files and restarting the engine is required

Parameters
  • template_description (str) – Description of the service template

  • contact_names (list of str) – List of contact names

Returns

Returns True if the operation was successful

Return type

bool

service_template_set_contact_group(template_description, contact_group_names)

This method is used to set the contact group of a service template. Overwrites previous definitions. Generating configuration files and restarting the engine is required

Parameters
  • template_description (str) – Description of the service template

  • contact_group_names (list of str) – List of contact group names

Returns

Returns True if the operation was successful

Return type

bool

service_template_set_host_template(service_template_description, host_templates)

This method is used to link host templates to a service template. Overwrites previous definitions. Generating configuration files and restarting the engine is required

Parameters
  • service_template_description (str) – Description of the service template

  • host_templates (list of str) – List of host templates

Returns

Returns True if the operation was successful

Return type

bool

service_template_set_macro(template_description, macro_name, macro_value, macro_description=None, is_password=None)

This method is used to set a macro for a service template. Generating configuration files and restarting the engine is required

Parameters
  • template_description (str) – Description of the service template

  • macro_name (str) – Name of the macro

  • macro_value (str) – Value of the macro

  • macro_description (str) – Optional: Description of the macro

  • is_password (bool) – Optional: Is the value a password?

Returns

Returns True if the operation was successful

Return type

bool

service_template_set_param(template_description, param_name, param_value)

This method is used to set a parameter for a service template. Generating configuration files and restarting the engine is required

Parameters
Returns

Returns True if the operation was successful

Return type

bool

service_template_set_trap(template_description, trap_names)

This method is used to set the traps of a service template. Overwrites previous definitions. Generating configuration files and restarting the engine is required

Parameters
  • template_description (str) – Description of the service template

  • trap_names (list of str) – List of trap names

Returns

Returns True if the operation was successful

Return type

bool

service_template_show()

This method is used list all available service templates

Returns

Returns a list of service templates

Return type

list of ServiceTemplate

service_unset_severity(host_name, service_description)

This method is used to remove the severity from a service

Parameters
  • host_name (str) – Name of the host

  • service_description (str) – Description if the service

Returns

Returns True if the operation was successful

Return type

bool

settings_set_param(param_name: centreon_sdk.objects.base.settings.SettingsParam, param_value)

This method is used to set a parameter for the settings

Parameters
Returns

Returns True if the operation was successful

Return type

bool

settings_show()

This method is used to retrieve the current settings

Returns

Returns the settings

Return type

Settings

time_period_add(time_period_name, time_period_alias)

This method is used to add a new time period

Parameters
  • time_period_name (str) – Name of the time period

  • time_period_alias (str) – Alias of the time period

Returns

Returns True if the operation was successful

Return type

bool

time_period_del(time_period_name)

This method is used to delete a time period

Parameters

time_period_name (str) – Name of the time period

Returns

Returns True if the operation was successful

Return type

bool

time_period_del_exception(time_period_name, exception)

This method is used to delete a exception from a timeperiod

Parameters
  • time_period_name (str) – Name of the timeperiod

  • exception (str) – Exception to remove

Returns

Returns True if the operation was successful

Return type

bool

time_period_get_exception(time_period_name)

This method is used to retrieve the exception for a timeperiod

Parameters

time_period_name (str) – Name of the timeperiod

Returns

Returns a list of exceptions

Return type

list of TimePeriodException

time_period_set_exception(time_period_name, days, timerange)

This method is used to set a exception for a timeperiod

Parameters
  • time_period_name (str) – Name of the timeperiod

  • days (str) – Days to exclude

  • timerange (str) – Timerange to exclude

Returns

Returns True if the operation was successful

Return type

bool

time_period_set_param(time_period_name, param_name, param_value)

This method is used to set a parameter for a time period

Parameters
  • time_period_name (str) – Name of the time period

  • param_name (TimePeriodParam) – Name of the parameter

  • param_value (See TimePeriodParam) – Value of the parameter

Returns

Retuns True if the operation was successful

Return type

bool

time_period_show()

This method is used to list all available time periods

Returns

Retuns a list of time periods

Return type

list of TimePeriod

trap_add(trap_name, trap_oid)

This method is used to add a new trap

Parameters
  • trap_name (str) – Name of the trap

  • trap_oid (str) – OID of the trap

Returns

Returns True if the operation was successful

Return type

bool

trap_add_matching(trap_name, string, regexp, status)

This method is used to add a new matching rule to a trap

Parameters
  • trap_name (str) – Name of the trap

  • string (str) – String to match

  • regexp (str) – Matching regular expression

  • status (str) – Status to submit

Returns

Returns True if the operation was successful

Return type

bool

trap_del(trap_name)

This method is used to delete a trap

Parameters

trap_name (str) – Name of the trap

Returns

Returns True if the operation was successful

Return type

bool

trap_del_matching(trap_id)

This method is used to delete a matching rule from a trap

Parameters

trap_id (int) – ID of the trap

Returns

Returns True if the operation was successful

Return type

bool

trap_get_matching(trap_name)

This method is used to retrieve the available matching rules

Parameters

trap_name (str) – Name of the trap

Returns

Returns a list of matching rules

Return type

list of TrapMatching

trap_set_param(trap_name, param_name, param_value)

This method is used to set the parameter for a trap

Parameters
  • trap_name (str) – Name of the trap

  • param_name (TrapParam) – Name of the parameter

  • param_value (See TrapParam) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

trap_show()

This method is used to list all available traps

Returns

Returns a list of traps

Return type

list of Trap

trap_update_matching(matching_id, param_name, param_value)

This method is used to update a matching rule of a trap

Parameters
Returns

Returns True if the operation was successful

Return type

bool

vendor_add(vendor_name, vendor_alias)

This method is used to add a new vendor

Parameters
  • vendor_name (str) – Name of the vendor

  • vendor_alias (str) – Alias of the vendor

Returns

Returns True if the operation was successful

Return type

bool

vendor_del(vendor_name)

This method is used to delete a vendor

Parameters

vendor_name (str) – Name of the vendor

Returns

Returns True if the operation was successful

Return type

bool

vendor_generate_traps(vendor_name, mib_path)

This method is used to generate the traps from a given MIB file

Parameters
  • vendor_name (str) – Name of the vendor

  • mib_path (str) – Path to the MIB file

vendor_set_param(vendor_name, param_name, param_value)

This method is used to set a parameter for a vendor

Parameters
  • vendor_name (str) – Name of the vendor

  • param_name (VendorParam) – Name of the parameter

  • param_value (str) – Value of the parameter

Returns

Returns True if the operation was successful

Return type

bool

vendor_show()

This method is used to retrieve all available vendors

Returns

Returns a list of vendors

Return type

list of Vendor