core/hmdl.schema.json

490 lines
9.3 KiB
JSON
Raw Normal View History

2022-11-29 23:53:14 +01:00
{
"$defs": {
"active": {
"type": "boolean",
"default": true
},
"threshold": {
"description": "how often a condition has to occur in order to be reported",
"type": "integer",
"minimum": 1,
"default": 3
},
"annoy": {
"description": "whether notifications shall be kept sending after the threshold has been surpassed",
"type": "boolean",
"default": false
2022-11-29 23:53:14 +01:00
},
"schedule": {
"type": "object",
"additionalProperties": false,
"properties": {
2022-11-30 08:15:35 +01:00
"regular_interval": {
"description": "in seconds or as text: minute, hour, day, week",
"type": ["integer", "string"]
2022-11-30 08:15:35 +01:00
},
"attentive_interval": {
"description": "in seconds or as text: minute, hour, day, week",
"type": ["integer", "string"]
2022-11-29 23:53:14 +01:00
}
},
"required": [
2022-11-30 08:15:35 +01:00
"regular_interval"
2022-11-29 23:53:14 +01:00
]
},
"check_kind_test": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"const": "test"
},
"parameters": {
"type": "object",
"additionalProperties": false,
"properties": {
"condition": {
"type": "string",
"enum": [
"unknown",
"ok",
"warning",
"critical"
],
"default": "warning"
},
"output": {
"type": "string",
"default": ""
}
},
"required": [
]
}
},
"required": [
"kind",
"parameters"
]
},
"check_kind_script": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"const": "script"
},
"parameters": {
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"type": "string"
},
"arguments": {
"type": "array",
"item": {
"type": "string"
2022-11-29 23:53:14 +01:00
}
}
},
"required": [
"path"
]
}
},
"required": [
"kind",
"parameters"
]
},
"check_kind_file_timestamp": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"const": "file_timestamp"
},
"parameters": {
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"type": "string"
2022-11-29 23:53:14 +01:00
},
"warning_age": {
"type": "integer",
"exclusiveMinimum": 0,
"default": 3600
},
"critical_age": {
"type": "integer",
"exclusiveMinimum": 0,
"default": 86400
},
"condition_on_missing": {
"description": "which condition to report if file is missing",
"type": "string",
"enum": [
"unknown",
"ok",
"warning",
"critical"
],
"default": "warning"
},
"condition_on_implausible": {
"description": "which condition to report if the age is negative, i.e. the file is apparently from the future",
"type": "string",
"enum": [
"unknown",
"ok",
"warning",
"critical"
],
"default": "warning"
}
2022-11-29 23:53:14 +01:00
},
"required": [
"path"
]
}
},
"required": [
"kind",
"parameters"
]
},
"check_kind_http_request": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"const": "http_request"
},
"parameters": {
"type": "object",
"additionalProperties": false,
"properties": {
"request": {
"type": "object",
"additionalProperties": false,
"properties": {
"target": {
"description": "URL",
"type": "string"
},
"method": {
"type": "string",
"enum": [
"GET",
"POST"
],
"default": "GET"
}
2022-11-29 23:53:14 +01:00
},
"required": [
"target"
]
},
"response": {
"type": "object",
"additionalProperties": false,
"properties": {
"status_code": {
"description": "checks whether the response status code is this",
"type": ["null", "integer"],
"default": 200
},
"headers": {
"description": "conjunctively checks header key-value pairs",
"type": "object",
"additionalProperties": {
"description": "header value",
2022-11-29 23:53:14 +01:00
"type": "string"
},
"properties": {
2022-11-29 23:53:14 +01:00
},
"required": [
],
"default": {}
2022-11-29 23:53:14 +01:00
},
"body_part": {
"description": "checks whether the response body contains this string",
"type": "string"
}
},
"required": [
]
},
"as_warning": {
"description": "whether a violation of this check shall be exposed as warning instead of critical; default: false",
"type": "boolean",
"default": false
}
},
"required": [
"request"
]
}
},
"required": [
"kind",
"parameters"
]
},
"notification_channel_console": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"const": "console"
},
"parameters": {
"type": "object",
"additionalProperties": false,
"properties": {
},
"required": [
]
}
},
"required": [
"kind",
"parameters"
]
},
"notification_channel_file_touch": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"const": "file_touch"
},
"parameters": {
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"type": "string"
}
},
"required": [
"path"
]
}
},
"required": [
"kind",
"parameters"
]
},
"notification_channel_libnotify": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"const": "libnotify"
},
"parameters": {
"type": "object",
"additionalProperties": false,
"properties": {
"icon": {
"type": "string"
}
},
"required": [
]
}
},
"required": [
"kind",
"parameters"
]
},
"notification_channel_email": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"const": "email"
},
"parameters": {
"type": "object",
"additionalProperties": false,
"properties": {
"access": {
"type": "object",
"additionalProperties": false,
"properties": {
"host": {
"type": "string"
},
"port": {
"type": "integer"
},
"username": {
"type": "string"
},
"password": {
"type": "string"
}
},
"required": [
"host",
"port",
"username",
"password"
]
},
"sender": {
"type": "string"
},
"receivers": {
"type": "array",
"item": {
"type": "string"
2022-11-29 23:53:14 +01:00
}
},
"tags": {
"description": "list of strings, which will be placed in the e-mail subject",
"type": "array",
"item": {
"type": "string"
},
"default": []
}
},
"required": [
"access",
"sender",
"receivers"
]
}
},
"required": [
"kind",
"parameters"
]
},
"notifications": {
"type": "array",
"item": {
"anyOf": [
{
"$ref": "#/$defs/notification_channel_console"
},
{
"$ref": "#/$defs/notification_channel_file_touch"
},
{
"$ref": "#/$defs/notification_channel_email"
2022-11-29 23:53:14 +01:00
}
]
},
"default": [
{
"kind": "console",
"parameters": {
}
}
]
}
},
"type": "object",
"additionalProperties": false,
"properties": {
"defaults": {
"description": "default values for checks",
"type": "object",
"additionalProperties": false,
"properties": {
"active": {
"$ref": "#/$defs/active"
},
"threshold": {
"$ref": "#/$defs/threshold"
},
"annoy": {
"$ref": "#/$defs/annoy"
},
2022-11-29 23:53:14 +01:00
"schedule": {
"$ref": "#/$defs/schedule"
},
"notifications": {
"$ref": "#/$defs/notifications"
}
},
"required": [
]
},
"checks": {
"type": "object",
"additionalProperties": {
"allOf": [
{
"description": "should represent a specific check",
"type": "object",
"additionalProperties": false,
"properties": {
"title": {
"type": "string"
},
"active": {
"$ref": "#/$defs/active"
},
"threshold": {
"$ref": "#/$defs/threshold"
},
"annoy": {
"$ref": "#/$defs/annoy"
},
2022-11-29 23:53:14 +01:00
"schedule": {
"$ref": "#/$defs/schedule"
},
"notifications": {
"$ref": "#/$defs/notifications"
}
},
"required": [
]
},
{
"anyOf": [
2022-11-30 08:15:35 +01:00
{
"$ref": "#/$defs/check_kind_test"
2022-11-30 08:15:35 +01:00
},
2022-11-29 23:53:14 +01:00
{
"$ref": "#/$defs/check_kind_script"
2022-11-29 23:53:14 +01:00
},
{
"$ref": "#/$defs/check_kind_file_timestamp"
},
{
"$ref": "#/$defs/check_kind_http_request"
2022-11-29 23:53:14 +01:00
}
]
}
]
},
"properties": {
},
"required": [
]
}
},
"required": [
"defaults",
"groups"
]
}