Giter VIP home page Giter VIP logo

slackuptimemonitor's Introduction

Website Down Notifier on Slack

slack website up down notifier uptime ping

A simple, one file script that notifies you on slack when your website is down or have any other issue/error.

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-tokens

You 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"

slackuptimemonitor's People

Contributors

kramit9 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.