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

maprobe / mackerel drinkup #7

maprobe / mackerel drinkup #7

FUJIWARA Shunichiro

April 24, 2018
Tweet

More Decks by FUJIWARA Shunichiro

Other Decks in Technology

Transcript

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

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

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

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

    {{.Host.ID}} {{index .Host.Meta.Cloud.MetaData "instance-id"}}' Mackerel ϗετ ID ͱ EC2 Πϯελϯε ID Λݩʹࣗಈୀ໾͢ Δ