Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
maprobe / mackerel drinkup #7
FUJIWARA Shunichiro
PRO
April 24, 2018
Technology
0
48
maprobe / mackerel drinkup #7
FUJIWARA Shunichiro
PRO
April 24, 2018
Tweet
Share
More Decks by FUJIWARA Shunichiro
See All by FUJIWARA Shunichiro
fujiwara3
PRO
4
1.4k
fujiwara3
PRO
1
2.1k
fujiwara3
PRO
1
120
fujiwara3
PRO
22
21k
fujiwara3
PRO
4
2.9k
fujiwara3
PRO
8
10k
fujiwara3
PRO
18
7.8k
fujiwara3
PRO
9
3.6k
fujiwara3
PRO
0
1.6k
Other Decks in Technology
See All in Technology
hayatan
0
200
ihcomega56
1
580
khrd
1
640
nitya
0
310
tnmt
3
250
kanaugust
PRO
0
110
futo23
1
340
oliva
7
1.2k
aditya45
2
2.4k
shirayanagiryuji
1
280
mahito
0
220
korodroid
0
210
Featured
See All Featured
sachag
446
36k
chrislema
173
14k
danielanewman
1
520
hatefulcrawdad
257
17k
chriscoyier
779
240k
shpigford
165
19k
maltzj
502
36k
eileencodes
113
25k
bryan
100
11k
lara
590
61k
mza
80
4.1k
philnash
9
590
Transcript
maprobe Mackerel ͷϗετใͱ࿈ܞ͢Δ ֎ܗࢹΤʔδΣϯτ 2018.04.24 Mackerel Drinkup #7 @fujiwara
@fujiwara ٕज़෦ github.com/fujiwara sfujiwara.hatenablog.com
Mackerel ͷࢹͷྲྀΕ
None
ϗετͷμϯݕΛ͍͍͔Μ͡ʹ͍ͨ͠ • 7ఔ agent ͔Β్ઈ͠ͳ͍ͱμϯͱఆ͞Εͳ͍ • "connectivity" Ξϥʔτ Critical Ϩϕϧ͔͠ͳ͍
• ଟॏԽͯ͋͠ΔϗετͰେ͛͞
෦Ϧιʔεʹ֎ܗࢹΛ͍ͨ͠
None
maprobe ͭ͘Γ·ͨ͠ github.com/fujiwara/maprobe
None
maprobe works... 1. Mackerel API Λୟ͍ͯϗετใΛऔಘ • Service, Role ͰϑΟϧλϦϯά
2. ֤ϗετʹରͯ͠ probe(ping,tcp,http,command)Λ࣮ߦ 3. ಘΒΕͨ݁ՌΛϗετϝτϦοΫͱͯ͠ Mackerel ʹૹ৴ 4. 60ඵ͝ͱʹ܁Γฦ͠
ping probe production αʔϏε ͷ server ϩʔϧʹ ping Λૹ৴ probes:
- service: production role: server ping: address: '{{ .Host.IPAddresses.eth0 }}'
None
HTTP Probe production αʔϏε ͷ InternalELB ϩʔϧʹ HTTP probes: -
service: production role: InternalELB http: url: 'http://{{ .Host.CustomIdentifier }}/api/healthcheck' post: POST headers: Content-Type: application/json body: '{"hello":"world"}' expect_pattern: 'ok'
TCP Probe production αʔϏε ͷ redis ϩʔϧʹ TCP probes: -
service: production role: redis tcp: host: '{{ .Host.IPAddress.eth0 }}' port: 6379 send: "PING\n" expect_pattern: "PONG" quit: "QUIT\n"
Command Probe mackerel-plugin ޓίϚϯυ࣮ߦՄೳ probes: - service: production role: redis
command: command: "mackerel-plugin-redis -host {{ .Host.IPAddress.eth0 }} -tempfile /tmp/redis-{{ .Host.ID }}"
ίϚϯυ࣮ߦͷԠ༻ྫ probes: - service: production role: EC2 command: command: 'cleanup.sh
{{.Host.ID}} {{index .Host.Meta.Cloud.MetaData "instance-id"}}' Mackerel ϗετ ID ͱ EC2 Πϯελϯε ID Λݩʹࣗಈୀ͢ Δ
Blog ॻ͖·ͨ͠ https://sfujiwara.hatenablog.com/entry/2018/04/23/113316 Enjoy!