Coder Social home page Coder Social logo

sysadminace83 / chatops_slack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dennyzhang/chatops_slack

0.0 2.0 0.0 83 KB

:rocket: Python Slack ChatOps

Home Page: https://www.dennyzhang.com/tag/chatops

Dockerfile 4.70% Python 93.51% Shell 1.80%

chatops_slack's Introduction

Python slack ChatOps

Build Status Docker PRs Welcome

LinkedIn Github Slack

System Design

  • Limitation: Only Python3 is supported. (Use docker to deploy by default).

Major Default Slack Bots

DevOps ChatOps via Slack Commands. All commands starts with /chat*
- /chatclusterusage: Overall resource usage, and summary by role.
- /chatcloudexpense: Show cloud bills across different cloud providers.
- /chatqueryhost [substring of hostname]: Query host without manual ssh.
- /chathelp: Current online help usage
  • TODO: guide people to add their own, if they want

How To Use

1. Setup ChatOps Server via docker-compose

1.1. Prepare ssh_id_rsa and config.py

1.2. docker-compose up -d

2. Setup in client nodes

wget -O /usr/sbin/node_usage.py \
     https://raw.githubusercontent.com/DennyZhang/devops_public/tag_v6/python/node_usage/node_usage.py

3. Create slack commands in Slack setting page

Configure Slack Commands for each python flask endpoint.

4. Try the bots in Slack

Useful commands

Check: docker-entrypoint.sh

tail -f /tmp/uwsgi-wsgi.log

docker-compose down && docker-compose up -d \
  && docker exec -it devops_chatops tail -f /tmp/uwsgi-wsgi.log

Limitation

  1. Query nodes from slack, we use ssh private key. Here we assume one private key can login to all related nodes

More Resources

chatops_slack's People

Contributors

dennyzhang avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.