Centreon icon

Centreon

Connect and manage Centreon using Centreon Web API (v2)

Actions12

Overview

This node integrates with Centreon, a monitoring software, via its Web API to manage services programmatically. Specifically, the "Service - Add" operation allows users to create new monitoring services on specified hosts within Centreon. This is useful for automating the setup of service checks in large or dynamic environments where manual configuration would be tedious and error-prone.

Typical use cases include:

  • Automatically adding new services to hosts when they are provisioned.
  • Applying predefined service templates to ensure consistent monitoring configurations.
  • Defining macros (custom variables) for services to customize their behavior or credentials.

For example, you might use this node to add an HTTP check service to a web server host, applying a standard template and setting macros for authentication tokens.

Properties

Name Meaning
API Version Version of the Centreon API to use (e.g., "latest", "v24.10").
Host Name or ID The target host where the new service will be created. Select from a list or specify an ID dynamically.
Service Name The name of the service to create on the selected host.
Template Name or ID The service template to apply to the new service. Select from a list or specify an ID dynamically.
Macros One or more macros to define for the service. Each macro includes:
- Name: Macro identifier.
- Value: Macro value.
- Is Password: Whether the macro value should be treated as a password (hidden).
- Description: Optional description of the macro.

Output

The node outputs JSON data representing the result of the API call to add the service. This typically includes confirmation of success or details about the created service. The output structure depends on the Centreon API response but generally contains status messages and timestamps.

No binary data output is produced by this operation.

Example output snippet (conceptual):

{
  "success": true,
  "message": "POST /configuration/services completed successfully",
  "timestamp": "2024-06-01T12:00:00Z"
}

Dependencies

  • Requires valid Centreon API credentials (username, password, base URL).
  • The node uses the Centreon Web API; thus, the Centreon server must be accessible from n8n.
  • The API version parameter must correspond to a supported Centreon API version.
  • Network connectivity and proper SSL settings (optionally ignoring SSL errors) are necessary.

Troubleshooting

  • Authentication failures: If the node cannot authenticate, verify the API credentials and that the Centreon server URL is correct and reachable.
  • Invalid host or template IDs: Ensure the selected host and service template exist in Centreon. Use the provided load options to select valid entries.
  • Macro format errors: Macros must have non-empty names and values. Password macros should be marked accordingly.
  • API version mismatch: Using an unsupported API version may cause unexpected errors. Confirm the API version string matches your Centreon installation.
  • Network issues: Timeouts or connection errors indicate network problems or incorrect server addresses.
  • Error messages from Centreon API: These are passed through; review the message for clues (e.g., permission denied, invalid parameters).

To resolve most issues, double-check input parameters, credentials, and network access.

Links and References

Discussion