[add] "custom"-Feld für http_request-Prüfung
This commit is contained in:
parent
aa5c2eac95
commit
ca658816e8
|
|
@ -589,6 +589,10 @@
|
|||
"host": {
|
||||
"type": "string"
|
||||
},
|
||||
"port": {
|
||||
"type": "integer",
|
||||
"default": 443
|
||||
},
|
||||
"strict": {
|
||||
"description": "whether a violation of this check shall be leveled as critical instead of concerning",
|
||||
"type": "boolean",
|
||||
|
|
@ -689,6 +693,10 @@
|
|||
"description": "whether a violation of this check shall be leveled as critical instead of concerning",
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"custom": {
|
||||
"description": "custom data, which shall be attached to notifications",
|
||||
"default": null
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
|||
20
examples/http_request.hmdl.json
Normal file
20
examples/http_request.hmdl.json
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"checks": [
|
||||
{
|
||||
"name": "test",
|
||||
"kind": "http_request",
|
||||
"parameters": {
|
||||
"request": {
|
||||
"target": "http://ich-bin-keine-domain.org"
|
||||
},
|
||||
"custom": {
|
||||
"foo": true,
|
||||
"bar": {
|
||||
"baz": "BAZ",
|
||||
"qux": 2.718
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -15,6 +15,6 @@
|
|||
]
|
||||
},
|
||||
"includes": [
|
||||
"tls_certificate.hmdl.json"
|
||||
"http_request.hmdl.json"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,10 @@ class implementation_check_kind_http_request(interface_check_kind):
|
|||
"type": "boolean",
|
||||
"default": True
|
||||
},
|
||||
"custom": {
|
||||
"description": "custom data, which shall be attached to notifications",
|
||||
"default": None
|
||||
},
|
||||
},
|
||||
"required": [
|
||||
"request"
|
||||
|
|
@ -90,6 +94,7 @@ class implementation_check_kind_http_request(interface_check_kind):
|
|||
"status_code": 200
|
||||
},
|
||||
"strict": True,
|
||||
"custom": None,
|
||||
},
|
||||
node,
|
||||
True
|
||||
|
|
@ -139,6 +144,7 @@ class implementation_check_kind_http_request(interface_check_kind):
|
|||
"faults": [
|
||||
translation_get("checks.http_request.request_failed"),
|
||||
],
|
||||
"custom": parameters["custom"],
|
||||
}
|
||||
}
|
||||
else:
|
||||
|
|
@ -204,6 +210,7 @@ class implementation_check_kind_http_request(interface_check_kind):
|
|||
# "body": response.text,
|
||||
},
|
||||
"faults": faults,
|
||||
"custom": parameters["custom"],
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue