Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AndreiD/SlackUptimeMonitor
Receive notifications in Slack when your websites/api/services are down
https://github.com/AndreiD/SlackUptimeMonitor
Last synced: 3 months ago
JSON representation
Receive notifications in Slack when your websites/api/services are down
- Host: GitHub
- URL: https://github.com/AndreiD/SlackUptimeMonitor
- Owner: AndreiD
- Created: 2016-10-18T10:29:05.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-01T20:50:37.000Z (about 4 years ago)
- Last Synced: 2024-06-28T05:36:45.491Z (5 months ago)
- Language: Python
- Size: 43 KB
- Stars: 16
- Watchers: 3
- Forks: 58
- Open Issues: 41
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Website Down Notifier on Slack
#### A simple, one file script that notifies you on slack when your website is down.
## Configuration
### Step 1 - Get the script
Simply copy paste the script uptimemonitor.py into your server. After you test it add it to cron with your preferred check interval
Example for checks every minute
~~~~
$crontab -e
* * * * * /home/uptimemonitor/uptimemonitor.py > /root/uptimenotifier.log
$service cron restart
$tail -f /root/uptimenotifier.log
~~~~Note that the script is written in Python3.5.
### Step 2 - Setup the config variables
URLS_TO_CHECK = ["http://facebook.com",
"https://youtube.com:9540"]#### You have to have a token so you can send messages to a slack channel! Get one here
https://api.slack.com/docs/oauth-test-tokensYou need then to export it as an environmental variable or hardcoded
~~~~
export SLACK_TOKEN = 'your_token_here'
~~~~SLACK_TOKEN = os.environ.get('SLACK_TOKEN')
#### Where you want to receive your notifications ?
you can get it using list_channels and channel_info or click on the channel name
click on add app or integration and you can view it's id in the webpage redirection (you have to be fast because it redirects it to another page)
~~~~
CHANNEL_ID = "G2LCBCXGF"
~~~~### Step 3 - ???
### Step 4 - Profit
### Remember to star this repository and fork it.
#### Bugs / Issues / Suggestions -> write me a message on "Issues"