Skip to content

monitor

lucasheld edited this page Aug 2, 2022 · 23 revisions

lucasheld.uptime_kuma.monitor module -- Manages monitors.

Note

This module is part of the lucasheld.uptime_kuma collection (version 1.0.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install lucasheld.uptime_kuma.

To use it in a playbook, specify: lucasheld.uptime_kuma.monitor.

  • Manages monitors.

The below requirements are needed on the host that executes this module.

  • uptime-kuma-api

Parameter

Comments

accepted_status_codes

list / elements=string

The accepted status codes of the monitor.

api_password

string

The Uptime Kuma password.

Only required if no api_token specified.

api_token

string

The Uptime Kuma login token.

Only required if no api_username and api_password specified.

api_url

string

The Uptime Kuma URL.

Default: "http://127.0.0.1:3001"

api_username

string

The Uptime Kuma username.

Only required if no api_token specified.

auth_domain

string

The auth domain of the monitor.

auth_method

string

The auth method of the monitor.

Choices:

  • basic

  • ntlm

auth_pass

string

The auth pass of the monitor.

auth_user

string

The auth user of the monitor.

auth_workstation

string

The auth workstation of the monitor.

certificate_expiry_notification

boolean

True if certificate expiry notification is enabled.

Choices:

  • no

  • yes

dns_resolve_server

string

The dns resolve server of the monitor.

dns_resolve_type

string

The dns resolve type of the monitor.

heartbeat_interval

integer

The heartbeat interval of the monitor.

heartbeat_retry_interval

integer

The heartbeat retry interval of the monitor.

hostname

string

The hostname of the monitor.

http_body

string

The http body of the monitor.

http_headers

string

The http headers of the monitor.

http_method

string

The http method of the monitor.

id

integer

The id of the monitor.

Only required if no name specified.

ignore_tls_error

boolean

True if ignore tls error is enabled.

Choices:

  • no

  • yes

keyword

string

The keyword of the monitor.

max_redirects

integer

The max redirects of the monitor.

mqtt_password

string

The mqtt password of the monitor.

mqtt_success_message

string

The mqtt success message of the monitor.

mqtt_topic

string

The mqtt topic of the monitor.

mqtt_username

string

The mqtt username of the monitor.

name

string

The name of the monitor.

Only required if no id specified.

notification_ids

list / elements=integer

The notification ids of the monitor.

notification_names

list / elements=string

The notification names of the monitor.

port

integer

The port of the monitor.

proxy

dictionary

The proxy of the monitor.

host

string

The host of the proxy.

id

integer

The id of the proxy.

port

integer

The port of the proxy.

retries

integer

The retries of the monitor.

sqlserver_connection_string

string

The sqlserver connection string of the monitor.

sqlserver_query

string

The sqlserver query of the monitor.

state

string

Set to present to create/update a monitor.

Set to absent to delete a monitor.

Set to paused to pause a monitor.

Set to resumed to resume a monitor.

Choices:

  • present ← (default)

  • absent

  • paused

  • resumed

type

string

The type of the monitor.

Choices:

  • http

  • port

  • ping

  • keyword

  • dns

  • push

  • steam

  • mqtt

  • sqlserver

upside_down_mode

boolean

True if upside down mode is enabled.

Choices:

  • no

  • yes

url

string

The url of the monitor.

- name: Add a monitor
  lucasheld.uptime_kuma.monitor:
    api_url: http://192.168.1.10:3001
    api_username: admin
    api_password: secret
    type: keyword
    name: Peer 1
    url: http://192.168.20.135
    keyword: healthy
    state: present

- name: Edit a monitor
  lucasheld.uptime_kuma.monitor:
    api_url: http://192.168.1.10:3001
    api_username: admin
    api_password: secret
    type: http
    name: Peer 1
    url: http://192.168.20.135
    state: present

- name: Remove a monitor
  lucasheld.uptime_kuma.monitor:
    api_url: http://192.168.1.10:3001
    api_username: admin
    api_password: secret
    name: Peer 1
    state: absent

- name: Pause a monitor
  lucasheld.uptime_kuma.monitor:
    api_url: http://192.168.1.10:3001
    api_username: admin
    api_password: secret
    name: Peer 1
    state: paused

- name: Resume a monitor
  lucasheld.uptime_kuma.monitor:
    api_url: http://192.168.1.10:3001
    api_username: admin
    api_password: secret
    name: Peer 1
    state: resumed

Authors

  • Lucas Held (@lucasheld)

Collection links

Issue Tracker Repository (Sources)

Clone this wiki locally