2016-12-12 16:28:26 +01:00
|
|
|
---
|
|
|
|
layout: "icinga2"
|
|
|
|
page_title: "Icinga2: service"
|
|
|
|
sidebar_current: "docs-icinga2-resource-service"
|
|
|
|
description: |-
|
|
|
|
Configures a service resource. This allows service to be configured, updated and deleted.
|
|
|
|
---
|
|
|
|
|
|
|
|
# icinga2\_service
|
|
|
|
|
|
|
|
Configures an Icinga2 service resource. This allows service to be configured, updated,
|
2017-02-18 23:48:50 +01:00
|
|
|
and deleted.
|
2016-12-12 16:28:26 +01:00
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
2017-04-17 12:17:54 +02:00
|
|
|
```hcl
|
2016-12-12 16:28:26 +01:00
|
|
|
# Configure a new service to be monitored by an Icinga2 Server
|
|
|
|
provider "icinga2" {
|
2017-02-18 23:48:50 +01:00
|
|
|
api_url = "https://192.168.33.5:5665/v1"
|
2016-12-12 16:28:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "icinga2_service" "my-service" {
|
2017-02-18 23:48:50 +01:00
|
|
|
hostname = "c1-mysql-1"
|
|
|
|
servicename = "ssh"
|
2016-12-12 16:28:26 +01:00
|
|
|
check_command = "ssh"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
2017-02-18 23:48:50 +01:00
|
|
|
* `check_command` - (Required) The name of an existing Icinga2 CheckCommand object that is used to determine if the service is available on the host.
|
2016-12-12 16:28:26 +01:00
|
|
|
* `hostname` - (Required) The host to check the service's status on
|
|
|
|
* `servicename` - (Required) The name of the service.
|
|
|
|
|