Upgrade to Pro — share decks privately, control downloads, hide ads and more …

maprobe / mackerel drinkup #7

maprobe / mackerel drinkup #7

Ca6281fff64797dc419b78f51f25c0a5?s=128

FUJIWARA Shunichiro
PRO

April 24, 2018
Tweet

Transcript

  1. maprobe Mackerel ͷϗετ৘ใͱ࿈ܞ͢Δ ֎ܗ؂ࢹΤʔδΣϯτ 2018.04.24 Mackerel Drinkup #7 @fujiwara

  2. @fujiwara ٕज़෦ github.com/fujiwara sfujiwara.hatenablog.com

  3. Mackerel ͷ؂ࢹͷྲྀΕ

  4. None
  5. ϗετͷμ΢ϯݕ஌Λ͍͍͔Μ͡ʹ͍ͨ͠ • 7෼ఔ౓ agent ͔Β్ઈ͠ͳ͍ͱμ΢ϯͱ൑ఆ͞Εͳ͍ • "connectivity" Ξϥʔτ͸ Critical Ϩϕϧ͔͠ͳ͍

    • ଟॏԽͯ͋͠ΔϗετͰ͸େ͛͞
  6. ಺෦Ϧιʔεʹ֎ܗ؂ࢹΛ͍ͨ͠

  7. None
  8. maprobe ͭ͘Γ·ͨ͠ github.com/fujiwara/maprobe

  9. None
  10. maprobe works... 1. Mackerel API Λୟ͍ͯϗετ৘ใΛऔಘ • Service, Role ͰϑΟϧλϦϯά

    2. ֤ϗετʹରͯ͠ probe(ping,tcp,http,command)Λ࣮ߦ 3. ಘΒΕͨ݁ՌΛϗετϝτϦοΫͱͯ͠ Mackerel ʹૹ৴ 4. 60ඵ͝ͱʹ܁Γฦ͠
  11. ping probe production αʔϏε ͷ server ϩʔϧʹ ping Λૹ৴ probes:

    - service: production role: server ping: address: '{{ .Host.IPAddresses.eth0 }}'
  12. None
  13. 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'
  14. 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"
  15. Command Probe mackerel-plugin ޓ׵ίϚϯυ΋࣮ߦՄೳ probes: - service: production role: redis

    command: command: "mackerel-plugin-redis -host {{ .Host.IPAddress.eth0 }} -tempfile /tmp/redis-{{ .Host.ID }}"
  16. ίϚϯυ࣮ߦͷԠ༻ྫ probes: - service: production role: EC2 command: command: 'cleanup.sh

    {{.Host.ID}} {{index .Host.Meta.Cloud.MetaData "instance-id"}}' Mackerel ϗετ ID ͱ EC2 Πϯελϯε ID Λݩʹࣗಈୀ໾͢ Δ
  17. Blog ॻ͖·ͨ͠ https://sfujiwara.hatenablog.com/entry/2018/04/23/113316 Enjoy!