Skip to content

monitor

lucasheld edited this page Aug 3, 2022 · 23 revisions

lucasheld.uptime_kuma.monitor module -- Manages monitors.

Note

This module is part of the lucasheld.uptime_kuma collection (version 0.1.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 git+https://github.com/lucasheld/ansible-uptime-kuma.git.

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_statuscodes

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.

authDomain

string

The auth domain of the monitor.

authMethod

string

The auth method of the monitor.

Choices:

  • basic

  • ntlm

authWorkstation

string

The auth workstation of the monitor.

basic_auth_pass

string

The auth pass of the monitor.

basic_auth_user

string

The auth user of the monitor.

body

string

The http body of the monitor.

databaseConnectionString

string

The sqlserver connection string of the monitor.

databaseQuery

string

The sqlserver query of the monitor.

dns_resolve_server

string

The dns resolve server of the monitor.

dns_resolve_type

string

The dns resolve type of the monitor.

expiryNotification

boolean

True if certificate expiry notification is enabled.

Choices:

  • no

  • yes

headers

string

The http headers of the monitor.

hostname

string

The hostname of the monitor.

id

integer

The id of the monitor.

Only required if no name specified.

ignoreTls

boolean

True if ignore tls error is enabled.

Choices:

  • no

  • yes

interval

integer

The heartbeat interval of the monitor.

keyword

string

The keyword of the monitor.

maxredirects

integer

The redirects of the monitor.

maxretries

integer

The max retries of the monitor.

method

string

The http method of the monitor.

mqttPassword

string

The mqtt password of the monitor.

mqttSuccessMessage

string

The mqtt success message of the monitor.

mqttTopic

string

The mqtt topic of the monitor.

mqttUsername

string

The mqtt username of the monitor.

name

string

The name of the monitor.

Only required if no id specified.

notification_names

list / elements=string

The notification names of the monitor.

Only required if notificationIDList not specified.

notificationIDList

list / elements=integer

The notification ids of the monitor.

Only required if notification_names not specified.

port

integer

The port of the monitor.

proxy

dictionary

The proxy of the monitor.

host

string

The host of the proxy.

Only required if no proxyId specified.

port

integer

The port of the proxy.

Only required if no proxyId specified.

proxyId

integer

The proxy id of the monitor.

Only required if no proxy specified.

retryInterval

integer

The heartbeat retry interval 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

upsideDown

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