icinga modify-service
modifies a service object
Description
modifies a service object
Synopsis
icinga modify-service
[--site <site>]
[--cluster <cluster>]
--name <name>
--host_name <host_name>
[--groups <groups>]
[--vars <vars>]
[--check_command <check_command>]
Arguments
site
- (string)
Site where this command will be executed
Example: --site "site-1"
Default: input.site
Attributes: optional
cluster
- (string)
Name of Icinga cluster
Example: --cluster "icinga-default"
Default: icinga-default
Attributes: optional
name
- (string)
Name of the service object. Must be unique on a per-host basis
Example: --name "service1"
Default: _None_
Attributes: required
host_name
- (string)
The host this service belongs to. There must be a Host object with that name.
Example: --host_name "host1"
Default: _None_
Attributes: required
groups
- (string)
A list of service groups this service belongs to
Example: --groups "group1"
Default: _None_
Attributes: optional
vars
- (string)
A dictionary containing custom variables that are specific to this service.
Example: --vars "{"snmp_community":"public", "snmp_oid":"DISMAN-EVENT-MIB::sysUpTimeInstance"}"
Default: _None_
Attributes: optional
check_command
- (string)
The name of the check command.
Example: --check_command "snmp"
Default: _None_
Attributes: optional
Examples
Input:
! icinga modify-service --name "service1" --host_name "host1" --check_command "hostalive" --vars `{"snmp_community":"private"}`
{
"results": [
{
"code": 200,
"name": "host1!service1",
"status": "Attributes updated.",
"type": "Service"
}
]
}
Access Control
To use this command, you need access to the following:
Field | Value |
---|---|
Action | "update" |
Service Type | "icinga" |
Service Instance | cluster |
Namespace | |
Object Type | "service" |
Object ID | name |
Please see Access Control for details.