34
ChatOps … a beginner’s guide ~$

Chat ops .. a beginner's guide

Embed Size (px)

Citation preview

Page 1: Chat ops .. a beginner's guide

ChatOps  …  a  beginner’s  guide  

~  $      

Page 2: Chat ops .. a beginner's guide

Jason  Hand  VictorOps    [email protected]        @jasonhand  

Page 3: Chat ops .. a beginner's guide

Agenda  • Introduc)on  to  ChatOps  • Origins    • Tools  • Benefits  • Examples  • Limita)ons  &  Concerns  • Ge>ng  Started  • Q&A  

Page 4: Chat ops .. a beginner's guide

What  do  you  do  over  and  over  again?    

Can  I  do  that  for  you?      

I’ll  think  about  it.  

@jasonhand    #ChatOps  

Page 5: Chat ops .. a beginner's guide

“puCng  tools  in  the  middle  of  the  conversaFon”    

ChatOps  

-­‐  GitHub  (2010)  

“everyone  is  pairing  all  of  the  Fme”  -­‐  Jesse  Newland  (Ops  –  GitHub)  

Page 6: Chat ops .. a beginner's guide

DevOps  

To  move  fast  and  maintain  stability  it’s  important  to  have  a  culture  of  automaFon,  measurement  and  sharing  

Culture  AutomaFon  Measurement  Sharing  

@jasonhand    #ChatOps  

Page 7: Chat ops .. a beginner's guide

Tools  

•  Chat  clients    •  (with  channels  or  rooms)  

•  Bots  •  Scripts  

@jasonhand    #ChatOps  

Page 8: Chat ops .. a beginner's guide

HipChat  

Campfire  

Slack  

Chat  

@jasonhand    #ChatOps  

Page 9: Chat ops .. a beginner's guide

Bots  

@jasonhand    #ChatOps  

Page 10: Chat ops .. a beginner's guide
Page 11: Chat ops .. a beginner's guide

Scripts  

@jasonhand    #ChatOps  

Page 12: Chat ops .. a beginner's guide

Benefits  

• Sharing  • Learning  • Speed  

@jasonhand    #ChatOps  

Page 13: Chat ops .. a beginner's guide

MulF-­‐user  terminal  

Share  learning  experiences  

Sharing  

Disseminate  knowledge  across  everyone  on  the  team    Share  learning  experiences  

@jasonhand    #ChatOps  

Page 14: Chat ops .. a beginner's guide

Learning  

@jasonhand    #ChatOps  

Page 15: Chat ops .. a beginner's guide

Speed  

How  many  clicks  

does  it  take  you?  

Page 16: Chat ops .. a beginner's guide

Jason:    Hey  Dan  …  did  you  see  that  spike  in  CPU  usage  on  Prod1..    ~  3  minutes  ago?  

Dan:    No.    Let  me  check.    brb  

Dan:    Shit.    Yeah,  I  see  it.    Looks  ok  now.    I  think  :-­‐/      

Jason:    Think  we  should  let  Mike  know?    He  might  want  to  dig  in  to  it  later.  

Dan:    Yeah,  I’ll  take  a  screenshot  and  email  it  to  him.  

Jason:    Would  anyone  else  need  to  know  about  it?  

Dan:    Prob.    I’ll  cc  the  DevOps  team  so  everyone  knows  

Old  methods  

Page 17: Chat ops .. a beginner's guide

Jason:    Hey  Dan.    My  code  is  ready  to  push  when  you  are.  

Dan:    Cool.    I’ll  commit  it  to  the  latest  branch  here  in  a  minute.  

Jason:    Great.    Also,  we  should  probably  sit  down  with  Nick  (new  guy)  and  show  him  how  to  do  that  soon.  

Dan:    Yeah.    Once  I  get  some  Fme,  I’ll  schedule  something.    :/  

Jason:    There’s  probably  a  bunch  more  stuff  to  show  him  too,  but  I’m  not  sure  I  even  know  all  of  the  steps  for  everything.  

Dan:    We’ve  got  a  wiki  for  most  things,  but  not  everything.    I’ll  see  what  I  can  find  and  email  him.  

Old  methods  

Page 18: Chat ops .. a beginner's guide

Jason:    Hey  Dan.    My  code  is  ready  to  push  when  you  are.  

Dan:    Cool.    I’ll  commit  it  to  the  latest  branch  here  in  a  minute.  

Jason:    Great.    Also,  we  should  probably  sit  down  with  Nick  (new  guy)  and  show  him  how  to  do  that  soon.  

Dan:    Yeah.    Once  I  get  some  Fme,  I’ll  schedule  something.    :/  

Jason:    There’s  probably  a  bunch  more  stuff  to  show  him  too,  but  I’m  not  sure  I  even  know  all  of  the  steps  for  everything.  

Dan:    We’ve  got  a  wiki  for  most  things,  but  not  everything.    I’ll  see  what  I  can  find  and  email  him.  

Old  methods  Chat  with  Jason  &  Dan  

Who  else  can  see    this  conversaFon?  

Nobody  !    

If  using  a  tradiFonal  chat  client  Such  as  Gchat  …  

@jasonhand    #ChatOps  

Page 19: Chat ops .. a beginner's guide

What  do  you  do  over  and  over  again?    

Can  I  do  that  for  you?      

Heck  yeah!    :D  

@jasonhand    #ChatOps  

Page 20: Chat ops .. a beginner's guide

•      Run  MySQL  command  (as  read-­‐only  user)  •  Authorize  users  (assign  and  enforce  user-­‐based  roles)    •  Take  a  server  offline  •  Bring  a  server  online  •  Deploy  code  to  a  repository  •  Displaying  the  status  of  a  JIRA  Fcket  •  Adding  comments  and  changing  their  status  on  Fckets  •  Query  the  status  of  API's  (internal  &  external)  •  VM  interacFon  to  see  host  health  •  Monitoring  service  interacFon  to  trigger  status  checks  •  Hubot  scripts  can  be  wrinen  in  CoffeeScript  or  Javascript  •  NoFfy  people  not  present  in  a  chatroom  that  they  were  menFoned  •  Fetch  logs  •  Rebalance  shards  across  its  file  servers  •  List  currently  running  jobs/processes  •  Kill  jobs/processes  •  Tail  a  job/process  •  Track  Customer  signups  •  Sharing  graphs  for  context  •  Store  staFc  links,  mapping  those  links  to  simple,  easy  to  remember  commands  

Examples  

In  GitHub  Opening  issues  Closing  issues  CommenFng  on  issues  LisFng  issues  Merge  pull  requests  

jhand.ml/scripts  jhand.ml/heroku  

@jasonhand    #ChatOps  

Page 21: Chat ops .. a beginner's guide

Example  script  

Show  current  GitHub  status  and  messages  

jhand.ml/script1  

@jasonhand    #ChatOps  

Page 22: Chat ops .. a beginner's guide

hubot  github  status      -­‐  Returns  the  current  system  status  and  Fmestamp.  

hubot  github  status  last      -­‐  Returns  the  last  human  communicaFon,  status,  and  Fmestamp.  

hubot  github  status  messages      -­‐  Returns  the  most  recent  human  communicaFons  with  status  and  Fmestamp.  

Hubot:    github  status:  new  file:  Chatops.txt  116  seconds  ago  

Jason:    hubot  github  status  

@jasonhand    #ChatOps  

Page 23: Chat ops .. a beginner's guide

Jason:    Hey  Dan.    My  code  is  ready  to  push  when  you  are.  

Dan:    Cool.    I’ll  commit  it  to  the  latest  branch  here  in  a  minute.  

Jason:    Great.    Also,  we  should  probably  sit  down  with  Nick  (new  guy)  and  show  him  how  to  do  that  soon.  

Dan:    Yeah.    Once  I  get  some  Fme,  I’ll  schedule  something.    :/  

Jason:    There’s  probably  a  bunch  more  stuff  to  show  him  too,  but  I’m  not  sure  I  even  know  all  of  the  steps  for  everything.  

Dan:    We’ve  got  a  wiki  for  most  things,  but  not  everything.    I’ll  see  what  I  can  find  and  email  him.  

New  and  improved!  Chat  Room  

Who  else  can  see    this  conversaFon?  

Erybody  !  

Jason  Members  

Dan  Nick  Mike  Jeff  Doug  Tara  

@jasonhand    #ChatOps  

Page 24: Chat ops .. a beginner's guide

Jason:    Hubot  graphite  load  1  min  on  serverABC    

Jason:    @Dan    …  you  seeing  this?      

Dan:    Yeah.  

New  method    w/  bots  

Hubot:  

Mike:  That  was  me.    I  was  running  a  giant  report.    Should  be  fine  now  

Nick  (new  guy):  Cool.    Thanks  for  showing  me  how  to  do  that.    ;-­‐)  

Page 25: Chat ops .. a beginner's guide

Big  Whoop  

Why  is  this    important?  

Page 26: Chat ops .. a beginner's guide

Graphs  or  it  didn’t  happen  

@jasonhand    #ChatOps  

Page 27: Chat ops .. a beginner's guide

@ngrieb:  hubot  graphite  load  1  min  on  serverABC  @jasonhand    #ChatOps  

Page 28: Chat ops .. a beginner's guide

@jasonhand    #ChatOps  

Page 29: Chat ops .. a beginner's guide

GeCng  Started  

Install  bot    jhand.ml/installhubot  

Create  repo  Download  exisFng  scripts  

 jhand.ml/scripts  Create  your  own  scripts  Ask  others  what  needs  to  be  automated    

@jasonhand    #ChatOps  

Page 30: Chat ops .. a beginner's guide

Concerns  

Page 31: Chat ops .. a beginner's guide

LimitaFons  

@jasonhand    #ChatOps  

Page 32: Chat ops .. a beginner's guide

jhand.ml/SOoncall  

What  I’d  like  to  learn  from  you  :    

Are  you  doing  ChatOps?    

@jasonhand    #ChatOps  

Are  you  on-­‐call?  

Page 33: Chat ops .. a beginner's guide

Automate  !  

@jasonhand    #ChatOps  

Page 34: Chat ops .. a beginner's guide

Jason  Hand  VictorOps    [email protected]        @jasonhand