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

Invoke-ChatOps - ChatOps For PowerShell Users

Invoke-ChatOps - ChatOps For PowerShell Users

A talk about the benefits of ChatOps in organizations

C44fc6d582b47ebc3da0e059730dddfd?s=128

Brandon Olin

May 05, 2017
Tweet

Transcript

  1. Invoke-ChatOps ChatOps For PowerShell Users PS>Start-Presentation

  2. whoami Brandon Olin Lead Systems Engineer @ Columbia Sportswear @devblackops

    github.com/devblackops devblackops.io PS>Get-Presenter
  3. My first PowerShell script *To the best of my knowledge

    ls *.ps1 -recurse -file | sort lastwritetime | select -first 1 PS>Get-Script | Select-Object –First 1
  4. PS>Get-Help –Name ChatOps

  5. “We're taking the things we're already doing and putting them

    in line with the conversations we're already having” -James Fryman (StackStorm) PS>Get-Help –Name ChatOps
  6. PS>Get-ChatClient #irc

  7. PS>Get-BotFramework Pick your poison. There are as many bot frameworks

    as there are languages to build them.
  8. Social Benefits PS>Get-Benefit –Type Social

  9. Knowledge Sharing PS>Get-Benefit –Type Social

  10. Team Empowerment PS>Get-Benefit –Type Social

  11. Situational Awareness PS>Get-Benefit –Type Social

  12. Faster Onboarding PS>Get-Benefit –Type Social

  13. Enable Retrospectives PS>Get-Benefit –Type Social

  14. Technical Benefits PS>Get-Benefit –Type Technical

  15. Increased Automation PS>Get-Benefit –Type Technical

  16. Reduced MTTR PS>Get-Benefit –Type Technical

  17. Better History & Logging PS>Get-Benefit –Type Technical

  18. Improved Safety PS>Get-Benefit –Type Technical

  19. The Old and Busted PS>Get-OldWay Bob: Hey Sally, a user

    called me and said the server hq-frodo1 fell over again. I'm not sure what's wrong. Can you take a look? Sally: Ok, I don't know much about that server but I think John does. I'll try and track him down. 2 hours later... Sally: try now Bob: It works! What ever you did fixed it! Thanks a bunch!
  20. PS>Get-OldWay

  21. The New Hotness PS>Get-NewWay JoeUser: Hey Bob, we got a

    report that hq-frodo1 is not responding. Can you take a look? Bob: Sure, one sec. Bob: bender test-application --computer hq-frodo1 Bender: Application [MyAwesomeApp] on hq-frodo1 is not responding :( Bob: bender get-diskusage --computer hq-frodo1 Bender: hq-frodo1 disk usage: Volume Size Used Free C:\ 50GB 50GB 0GB Bob: bender clean-disk --computer hq-frodo1 Bender: Cleaned up temp files on hq-frodo1: Before: Volume Size Used Free C:\ 50GB 50GB 0GB After: Volume Size Used Free C:\ 50GB 22GB 28GB Bob: bender test-application --computer hq-frodo1 Bender: Application [MyAwesomeApp] on hq-frodo1 is responding normally :) JoeUser: Thanks Bob!
  22. PS>Get-NewWay

  23. So what can Bots Do? PS>Get-ChatBotScript • Restart services •

    Get / set /resolve Service Desk ticket • Query APIs • Modify AD group membership • Create VMs • Check status of automated processes • Get performance graphs • Query monitoring system for alerts • Deploy code / Kick off pipeline • Anything really…
  24. Real World Examples PS>Get-ChatBotExample

  25. Undisputed Street Fighter Champion PS>Get-ChatBot –Name Ryu

  26. PS>Get-ChatBotExample

  27. What About PowerShell? PS>Get-ChatBot –Type PowerShell

  28. PS>Get-PoshBot PoshBot PowerShell-based bot framework • PowerShell 5 • Class-based

    • Modules for bot command packaging/distribution • Roll-based Access Control • Command/event/regex triggers • Multiple chat networks* github.com/poshbotio/PoshBot
  29. PS>Get-PoshBotArchitecture Bot Backend Storage Plugin Manager Plugin1 Plugin2 Plugin3 Role

    Manager Executor
  30. Useful PoshBot Plugins PS>Get-PoshBotPlugin ServiceNow • !get-tickets --last 5 •

    !resolve-ticket --id 12345 --message ‘I fixed all the things’ vSphere • !new-vm --dc 'MyDatacenter01' --vcpu 2 -ram 4 • !snapshot-vm --name server01 --description 'Hold my beer, I'm going to try something' --keepdays 2 CMDB • !get-cmdbinfo --name server01 Monitoring • !get-alerts --computername server01 –critical • !run-smoketest --computername server01 --test componantA
  31. PS>Start-Demo

  32. Brandon Olin @devblackops github.com/devblackops devblackops.io Get-Links PoshBot: https://github.com/poshbotio/PoshBot Other Interesting

    Projects Watchmen: https://github.com/devblackops/watchmen PSHealthZ: https://github.com/devblackops/PSHealthZ POSHOrigin: https://github.com/devblackops/POSHOrigin POSHOrigin_vSphere: https://github.com/devblackops/POSHOrigin_vSphere NetScaler: https://github.com/devblackops/NetScaler PasswordState: https://github.com/devblackops/PasswordState