forked from zampat/icinga2-monitoring-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1011a-st_http.sh
67 lines (57 loc) · 1.29 KB
/
1011a-st_http.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
#Service template: HTTP
#
#
#Service template
#
RES=`icingacli director service exists "generic_http"`
if [[ $RES =~ "does not exist" ]]
then
echo "Service 'generic_http' does not exists"
icingacli director service create generic_http --json '
{
"check_command": "http",
"imports": [
"generic_service"
],
"object_name": "generic_http",
"object_type": "template",
"vars": {
"http_critical_time": 30,
"http_timeout": 60,
"http_warn_time": 20
}
}
'
fi
RES=`icingacli director service exists "http_website_availability"`
if [[ $RES =~ "does not exist" ]]
then
echo "Service 'http_website_availability' does not exists"
icingacli director service create http_website_availability --json '
{
"imports": [
"generic_http"
],
"object_name": "http_website_availability",
"object_type": "template"
}
'
fi
RES=`icingacli director service exists "http_certificate_validity"`
if [[ $RES =~ "does not exist" ]]
then
echo "Service 'http_certificate_validity' does not exists"
icingacli director service create http_certificate_validity --json '
{
"imports": [
"generic_http"
],
"object_name": "http_certificate_validity",
"object_type": "template",
"vars": {
"http_certificate": 30
}
}
'
fi