Slide 1

Slide 1 text

mkr + peco + tmux + ssh ͸ͯͳ id:y_uuki Mackerel Meetup #10 Tokyo

Slide 2

Slide 2 text

αʔϏεɾϩʔϧ໊Λ ͠΅Γ͜Έબ୒ͭͭ͠ɺ બΜͩϩʔϧͷϗετ܈ʹ ಉ࣌ϩάΠϯ

Slide 3

Slide 3 text

αʔϏεɾϩʔϧ໊Λ ͠΅Γ͜Έબ୒ͭͭ͠ɺ બΜͩϩʔϧͷϗετ܈ʹ ಉ࣌ϩάΠϯ 5ඵ

Slide 4

Slide 4 text

http://blog.yuuk.io/entry/tmux-ssh-mackerel

Slide 5

Slide 5 text

mkr + tmux + ssh

Slide 6

Slide 6 text

$ mkr hosts —service bookmark --role proxy

Slide 7

Slide 7 text

$ mkr hosts —service bookmark --role proxy | jq -rM “.[].name"

Slide 8

Slide 8 text

tssh = tmux + ssh https://github.com/yuuki/opstools/blob/master/tssh

Slide 9

Slide 9 text

$ tssh $(mkr hosts —service bookmark --role proxy | jq -rM “.[].name")

Slide 10

Slide 10 text

$ tssh $(roles bookmark proxy) (zsh functionԽ)

Slide 11

Slide 11 text

͸ͯͳʹ͸ϩʔϧ͕ͨ͘͞Μʂ 1000+ roles

Slide 12

Slide 12 text

ϩʔϧ໊֮͑ͯͳ͍໰୊

Slide 13

Slide 13 text

mkr + peco + tmux + ssh

Slide 14

Slide 14 text

function peco-mkr-roles() { local selected_role=$(mkr services | jq -rM '[.[] | .name as $name | .roles // [] | map("\($name) \ (.)")] | flatten | .[]' | peco) if [ -n "${selected_role}" ]; then local BUFFER="tssh \`roles "$ {selected_role}"\`" fi zle clear-screen } zle -N peco-mkr-roles

Slide 15

Slide 15 text

$ mkr services | jq -rM '[.[] | .name as $name | .roles // [] | map("\($name) \(.)")] | flatten | .[]' | peco

Slide 16

Slide 16 text

pecoͰ ϩʔϧͷ͠΅Γ͜ΈΛ͔͚ͨޙ $ tssh $(roles bookmark proxy) Λ࣮ߦ

Slide 17

Slide 17 text

1. Ctrl + w (೚ҙ) 2. ϩʔϧҰཡදࣔ 3. ͠΅Γ͜Έબ୒ 4. tssh࣮ߦ

Slide 18

Slide 18 text

1. Ctrl + w (೚ҙ) 2. ϩʔϧҰཡදࣔ 3. ͠΅Γ͜Έબ୒ 4. tssh࣮ߦ 5ඵ

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

Mackerel API ☓ ͍ͭ΋࢖͍ͬͯΔ πʔϧ

Slide 21

Slide 21 text

Mackerel API ☓ ͍ͭ΋࢖͍ͬͯΔ πʔϧ ΤϯδχΞΛ ϫΫϫΫͤ͞Δ