Skip to content

monitor

lucasheld edited this page Aug 29, 2023 · 23 revisions

lucasheld.uptime_kuma.monitor module -- Manages monitors.

Note

This module is part of the lucasheld.uptime_kuma collection (version 1.2.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.

Synopsis

  • Manages monitors.

Requirements

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

  • uptime-kuma-api

Parameters

Parameter

Comments

accepted_statuscodes

list / elements=string

The accepted status codes of the monitor.

api_headers

dictionary

Headers that are passed to the socketio connection.

api_password

string

The Uptime Kuma password.

Only required if no api_token specified and authentication is enabled.

api_ssl_verify

boolean

true to verify SSL certificates, or false to skip SSL certificate verification,

allowing connections to servers with self signed certificates.

Choices:

  • no

  • yes ← (default)

api_timeout

float

How many seconds the client should wait for the connection, an expected event or a server response.

Default: 10

api_token

string

The Uptime Kuma login token.

Only required if no api_username and api_password specified and authentication is enabled.

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 and authentication is enabled.

api_wait_events

float

How many seconds the client should wait for the next event of the same type.

There is no way to determine when the last message of a certain type has arrived. Therefore, a timeout is required.

If no further message has arrived within this time, it is assumed that it was the last message.

Default: 0.2

authDomain

string

The auth domain of the monitor.

authMethod

string

The auth method of the monitor.

Choices:

  • basic

  • ntlm

  • mtls

  • oauth2-cc

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.

description

string

The description 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.

docker_container

string

The docker container of the monitor.

docker_host

integer

The docker host id of the monitor.

Only required if no docker_host_name specified.

docker_host_name

string

The docker host name of the monitor.

Only required if no docker_host specified.

expectedValue

string

Expected Value

expiryNotification

boolean

True if certificate expiry notification is enabled.

Choices:

  • no

  • yes

game

string

The game of the monitor.

gamedigGivenPortOnly

boolean

Guess Gamedig Port. The port used by Valve Server Query Protocol may be different from the client port. Try this if the monitor cannot connect to your server.

Choices:

  • no

  • yes

grpcBody

string

The grpc body of the monitor.

grpcEnableTls

boolean

True to enable grpc tls.

Choices:

  • no

  • yes

grpcMetadata

string

The grpc metadata of the monitor.

grpcMethod

string

The grpc method of the monitor.

grpcProtobuf

string

The grpc protobuf of the monitor.

grpcServiceName

string

The grpc service name of the monitor.

grpcUrl

string

The grpc url of the monitor.

headers

string

The http headers of the monitor.

hostname

string

The hostname of the monitor.

httpBodyEncoding

string

The body encoding 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.

invertKeyword

boolean

Invert Keyword. Look for the keyword to be absent rather than present.

Choices:

  • no

  • yes

jsonPath

string

Json Query

kafkaProducerAllowAutoTopicCreation

boolean

Enable Kafka Producer Auto Topic Creation

Choices:

  • no

  • yes

kafkaProducerBrokers

string

Kafka Broker list

kafkaProducerMessage

string

Kafka Producer Message

kafkaProducerSaslOptions

dictionary

Kafka SASL Options

kafkaProducerSsl

boolean

Enable Kafka SSL

Choices:

  • no

  • yes

kafkaProducerTopic

string

Kafka Topic Name

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.

oauth_auth_method

string

Authentication Method

oauth_client_id

string

Client ID

oauth_client_secret

string

Client Secret

oauth_scopes

string

OAuth Scope

oauth_token_url

string

OAuth Token URL

packetSize

integer

The packet size of the monitor.

parent

integer

Id of the parent monitor.

Only required if no parent_name specified.

parent_name

string

Name of the parent monitor.

Only required if no parent specified.

port

integer

The port of the monitor.

proxy

dictionary

The proxy of the monitor.

Only required if no proxyId specified.

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.

radiusCalledStationId

string

The radius called station id of the monitor.

radiusCallingStationId

string

The radius calling station id of the monitor.

radiusPassword

string

The radius password of the monitor.

radiusSecret

string

The radius secret of the monitor.

radiusUsername

string

The radius username of the monitor.

resendInterval

integer

The heartbeat resend interval of the monitor.

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

timeout

integer

Request Timeout

tlsCa

string

The tls ca of the monitor.

tlsCert

string

The tls cert of the monitor.

tlsKey

string

The tls key of the monitor.

type

string

The type of the monitor.

Choices:

  • group

  • http

  • port

  • ping

  • keyword

  • json-query

  • grpc-keyword

  • dns

  • docker

  • real-browser

  • push

  • steam

  • gamedig

  • mqtt

  • kafka-producer

  • sqlserver

  • postgres

  • mysql

  • mongodb

  • radius

  • redis

  • tailscale-ping

upsideDown

boolean

True if upside down mode is enabled.

Choices:

  • no

  • yes

url

string

The url of the monitor.

Examples

- name: Add a monitor
  lucasheld.uptime_kuma.monitor:
    api_url: http://127.0.0.1:3001
    api_username: admin
    api_password: secret123
    type: keyword
    name: Monitor 1
    url: http://127.0.0.1
    keyword: healthy
    state: present

- name: Edit a monitor
  lucasheld.uptime_kuma.monitor:
    api_url: http://127.0.0.1:3001
    api_username: admin
    api_password: secret123
    type: http
    name: Monitor 1
    url: http://127.0.0.1
    state: present

- name: Remove a monitor
  lucasheld.uptime_kuma.monitor:
    api_url: http://127.0.0.1:3001
    api_username: admin
    api_password: secret123
    name: Monitor 1
    state: absent

- name: Pause a monitor
  lucasheld.uptime_kuma.monitor:
    api_url: http://127.0.0.1:3001
    api_username: admin
    api_password: secret123
    name: Monitor 1
    state: paused

- name: Resume a monitor
  lucasheld.uptime_kuma.monitor:
    api_url: http://127.0.0.1:3001
    api_username: admin
    api_password: secret123
    name: Monitor 1
    state: resumed

Authors

  • Lucas Held (@lucasheld)

Issue Tracker Repository (Sources)