Python slack ChatOps
-
Check more: https://www.dennyzhang.com/tag/chatops
- Limitation: Only Python3 is supported. (Use docker to deploy by default).
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
1.1. Prepare ssh_id_rsa and config.py
1.2. docker-compose up -d
wget -O /usr/sbin/node_usage.py \
https://raw.githubusercontent.com/DennyZhang/devops_public/tag_v6/python/node_usage/node_usage.py
Configure Slack Commands for each python flask endpoint.
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
- Query nodes from slack, we use ssh private key. Here we assume one private key can login to all related nodes