This repository has been archived by the owner on Nov 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 151
/
cloudprober_validator.cfg
73 lines (68 loc) · 2.13 KB
/
cloudprober_validator.cfg
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
68
69
70
71
72
73
# Following probe demonstrates the use of data integrity validator. It probes
# the local HTTP server (configured below) and verifies that the response is
# made up of the repeated pattern "cloudprober".
#
# Since the HTTP server below is configured to use the pattern "cloudprobe",
# we'll see validation failures. Generated monitoring data and logs will look
# like this:
# labels=ptype=http,probe=http_localhost,dst=localhost total=5 success=0 latency=0.000 timeouts=0 resp-code=map:code,200:5 resp-body=map:resp validation_failure=map:validator,data-integrity:5
# E1130 14:33:20.131399 27197 integrity.go:71] bytes are not in the expected format. payload[0-Replica]=[99 108 111 117 100 112 114 111 98 101 99], pattern=[99 108 111 117 100 112 114 111 98 101 114]
probe {
name: "http_localhost"
type: HTTP
targets {
host_names: "localhost"
}
interval_msec: 10000 # Probe every 10s
timeout_msec: 1000
http_probe {
relative_url: "/data_4096"
port: 3141
}
# This validator will fail as HTTP server is configured to use the pattern
# "cloudprobe".
validator {
name: "data-integrity"
integrity_validator {
pattern_string: "cloudprober"
}
}
}
server {
type: HTTP
http_server {
port: 3141
# Return a repeated pattern of "cloudprobe" at the URL /data_4096.
pattern_data_handler {
response_size: 4096
pattern: "cloudprobe"
}
}
}
# Following probe demonstrates the use of HTTP status code and regex
# validators.
probe {
name: "http_google"
type: HTTP
targets {
host_names: "www.google.com"
}
interval_msec: 10000 # Probe every 10s
timeout_msec: 1000
# This validator should succeed.
validator {
name: "status_code_2xx_and_HSTS"
http_validator {
success_status_codes: "200-299"
success_header: {
name: "Strict-Transport-Security"
value_regex: "max-age=31536000"
}
}
}
# This validator will fail, notice missing 'o' in our regex.
validator {
name: "gogle_re"
regex: "gogle"
}
}