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

Brandon Olin

May 05, 2017
Tweet

More Decks by Brandon Olin

Other Decks in Technology

Transcript

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

    github.com/devblackops devblackops.io PS>Get-Presenter
  2. 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
  3. “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
  4. 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!
  5. 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!
  6. 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…
  7. 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
  8. 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
  9. 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