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

僕の mackerel-agent.conf 公開します

僕の mackerel-agent.conf 公開します

Yuichiro SAITO

August 23, 2017
Tweet

More Decks by Yuichiro SAITO

Other Decks in Programming

Transcript

  1. ๻ͷ mackerel-agent.conf ެ։͠·͢ • 2017-08-23 @ CAMPFIRE • Mackerel User

    Group Meeting Vol.3 • Yuichiro Saito (@koemu) 1 © Yuichiro Saito (koemu), 2017
  2. ࣗݾ঺հ - @koemu • ΃ͪͺʔͰ͢ SRE͡Όͳ͍Ͱ͢ • Mackerel Standard Plan

    ՝ۚϢʔβͰ͢ • ͍͔ͭ͘ϓϥάΠϯʹίϯτϦϏϡʔτ͠·ͨ͠ • Apache • MySQL • Linux • ͩͱࢥ͏ 2 © Yuichiro Saito (koemu), 2017
  3. ؂ࢹ͍ͯ͠Δαʔόʹ͍ͭͯ • ݸਓར༻ͷ͘͞ΒVPS • WordpressΛ࢖ͬͨϒϩάαʔό • MySQL 5.6 • PHP

    7.0 • memcached • ͳͲͳͲ͕ಈ͍͍ͯΔ 3 © Yuichiro Saito (koemu), 2017
  4. Ͳ͏͍͏ઃఆΛ͍ͯ͠Δͷ͔ • ࢮ׆؂ࢹͱϝτϦοΫ؂ࢹ • ࢮ׆؂ࢹ • ਖ਼ৗʹϓϩηεɾαʔϏε͕ಈ࡞͍ͯ͠Δ͔Λ֬ೝ͢Δ • നࠇ͚ͭ΍͍͢ •

    NagiosϓϥάΠϯΛ࢖͏ͷָ͕ • ϝτϦοΫ؂ࢹ • ҰఆҎ্ͷෛՙ͕͔͔͍ͬͯΔ͔/ҰఆҎ্ͷύϑΥʔϚϯε͕ग़͍ͯΔ͔ • εϖΫτϥϜͳͷͰനࠇ͚ͭͮΒ͍ ؂ࢹઃఆ࣌ʹํ਑ܾఆ͕ඞཁ • ੵۃతʹMackerelϓϥάΠϯΛར༻͍ͯ͘͠ 13 © Yuichiro Saito (koemu), 2017
  5. ࢮ׆؂ࢹͷྫ1 • ϓϩηε؂ࢹ • ઃఆ໊ plugin.checks.check_procs_* ͱ͍ͯ͠Δͱ͜Ζɻ • nagios/plugins/check_procs -w

    1: -a [PROCNAME]ɹͰઃఆͰ ͖Δɻ • ʮ͋Εͬɺ͋ͷσʔϞϯ্͛๨Εͯͳ͍͔ͳʁʯʮσʔϞϯউखʹ ࢮΜͰো֐ʹͳ͍ͬͯͳ͍͔ͳʁʯ͕؆୯͔࣮ͭ֬ʹ؂ࢹͰ͖Δɻ • ઃఆ͸ͱͯ΋؆୯ɻ 15 © Yuichiro Saito (koemu), 2017
  6. ࢮ׆؂ࢹͷྫ2 • ઀ଓ؂ࢹ (httpsͷૄ௨֬ೝͳͲ) • ઃఆ໊ plugin.checks.check_http_* ͳͲɻ • nagios/plugins/check_http

    ͳͲΛ࢖͏ɻ • ʮηογϣϯᷓΕͯ઀ଓෆೳʯʮσʔϞϯ͕த్൒୺ʹࢮΜͰ઀ଓෆೳʯ͕ ؆୯ʹ؂ࢹͰ͖Δɻ • ໰୊͸λΠϜΞ΢τΛ͍ͭ͘ʹ͢Δ͔ɻ • ฏ࣌ͷϨεϙϯελΠϜΛ͋Β͔͡Ίଌ͓͍ͬͯͯɺ3ഒఔ౓Λᮢ஋ʹ͢Δɻ 16 © Yuichiro Saito (koemu), 2017
  7. ͜Μͳײ͡Ͱௐ΂͓͖ͯ·͢ • ͍͍ͩͨฏۉ30msecͰԠ౴Λฦ͍ͤͯΔɻ • ϒϩάͳͷͰɺ100msecҎ಺ʹฦ͍ͤͯΕ͹·ͣ໰୊͸ى͖ͳ͍ɻ • ·ͨɺ͜ͷฏۉ஋ʹۙ͗͢Δ஋Λᮢ஋ʹ͢Δͱޡใ͕ଟൃ͔͠Ͷͳ͍ɻ • Ҏ্͔ΒɺWarning: 100msec,

    Critical: 300msec, Timeout: 1,000msecͱઃఆɻ $ check_http -w 0.1 -c 0.3 -t 1 -I localhost -H www.koemu.com -u /blog/about/ -S -s 'koemu' HTTP OK: HTTP/1.1 200 OK - 70677 bytes in 0.026 second response time |time=0.026307s;0.100000;0.300000;0.000000 size=70677B;;;0 $ check_http -w 0.1 -c 0.3 -t 1 -I localhost -H www.koemu.com -u /blog/about/ -S -s 'koemu' HTTP OK: HTTP/1.1 200 OK - 70692 bytes in 0.025 second response time |time=0.025080s;0.100000;0.300000;0.000000 size=70692B;;;0 $ check_http -w 0.1 -c 0.3 -t 1 -I localhost -H www.koemu.com -u /blog/about/ -S -s 'koemu' HTTP OK: HTTP/1.1 200 OK - 70677 bytes in 0.032 second response time |time=0.032058s;0.100000;0.300000;0.000000 size=70677B;;;0 17 © Yuichiro Saito (koemu), 2017