https://github.com/john-data-chen/grafana_slack_auto_report
https://github.com/john-data-chen/grafana_slack_auto_report
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/john-data-chen/grafana_slack_auto_report
- Owner: john-data-chen
- Created: 2022-10-23T03:45:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-21T05:09:20.000Z (over 3 years ago)
- Last Synced: 2025-06-23T15:52:08.258Z (12 months ago)
- Language: Python
- Size: 16.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Grafana Slack Auto Report
this is the crawler mimic a mobile browser to **get screenshots in Grafana Dashboard then send to slack**
# Why should we use this?
Grafana Reporting Tools with powerful functions, which cost ranges from **$99/mo to $3,500/mo**
we only need **simple screenshots and auto report to slack daily**
## how to create a slack webhook
please see to get more details
find your slack app in
add incoming-webhook
add incoming-webhook and files:write in app scopes
install app to slack workspace
find slack channel ID in channel details
write Bot OAuth Token and channel ID in conf.ini
invite bot to channel
## based on platform to change crop sizes
crop sizes are determined by : platform.system()
if it is Darwin, meaning you use a mac
if it is Linux, meaning you use a Linux
## how to use
python: 3.8
default OS = ubuntu 20.04 LTS, you can use other Linux, if you know how to use its commands
`sudo apt install python3-venv`
need to install google-chrome, chromedriver is not needed because of webdriver-manager installed
`python3 -m venv ./venv`
`source ./venv/bin/activate`
`pip install -r requirements.txt`
`python main.py`
## conf.ini
conf.ini which has username and password, it won't be in repository
you have to create this file by yourself
```
[credential]
url=https://github.com/
email=optional
password=optional
channel=channel ID
token=token of you slack app
```
## crontab
send screenshots to slack AM 09:30 everyday
30 9 * * * cd /home/john_chen/crawler_daily_jobs && /home/john_chen/crawler_daily_jobs/venv/bin/python /home/john_chen/crawler_daily_jobs/main.py >/dev/null 2>&1
## how to fix chrome didn't show characters correctly
sudo apt-get install fonts-noto-cjk