Skip to content
This repository was archived by the owner on Aug 12, 2024. It is now read-only.

Latest commit

 

History

History
64 lines (48 loc) · 1.39 KB

File metadata and controls

64 lines (48 loc) · 1.39 KB

Icinga2 - Downtimes

add a downtime

add_downtime( params )

Example

param = {
  name: 'test',
  type: 'service',
  host: 'icinga2',
  comment: 'test downtime',
  author: 'icingaadmin',
  start_time: Time.now.to_i,
  end_time: Time.now.to_i + 20
}
@icinga.add_downtime( param )

remove a downtime

remove_downtime( params )

Example

remove all downtimes from the user icingaadmin and the comment test downtime

param = {
  comment: 'test downtime',
  author: 'icingaadmin'
}
@icinga.remove_downtime(param)

remove a downtime from a host but not the services filtered by the author name. This example uses filter variables explained in the advanced filters chapter from the official API documentation.

param = {
  filter: '"host.name == filterHost && !service && downtime.author == filterAuthor"',
  filter_vars: { filterHost: 'c1-mysql-1', filterAuthor: 'icingaadmin' }
)
@icinga.remove_downtime(param)

remove a downtime for service ping4 and host c1-mysql-1

param = {
  host_name: 'c1-mysql-1',
  service_name: 'ping4'
}
@icinga.remove_downtime(param)

list all downtimes

downtimes

Example

@icinga.downtimes