Skip to content

Simple Node app to do health checks and send notifications to a slack channel

License

Notifications You must be signed in to change notification settings

nclr/health-check-slack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

127e3d4 Β· Apr 8, 2018

History

12 Commits
Mar 28, 2018
Apr 7, 2018
Mar 28, 2018
Apr 8, 2018
Apr 2, 2018

Repository files navigation

health-check-slack πŸ€–

Simple Node app to do health checks on 1 or more urls and send notifications to a slack channel

Install πŸŒŸπŸ“¦

git clone https://github.com/nclr/health-check-slack.git
cd health-check-slack
npm install

Usage βœ¨πŸš€

Simply edit config.json and add the urls to check along with the desired interval (in milliseconds) for each loop like the example below:

{
    "urls": {
        "rest service": {
            "url": "https://example.com/app/to/check",
            "interval": "20000"
        },
        "Website": {
            "url": "https://example.com",
            "interval": "3000"
        }
    }
}

Then set up an Incoming Webhook to one of your slack channels and you're good to go! πŸ˜‰

Error Handling

When a 404 status code incurs it sends "LinkName is not reachable!" and when the error with the specified link is resolved (and a 200 status code is returned) it automatically responds with "LinkName is reachable again!". Every "fail" notification requires at least two failed attempts in a row to reach the desired URL. This minimizes the possibility of some temporary connection problem on the health-check server masqueraded as a URL problem.

About

Simple Node app to do health checks and send notifications to a slack channel

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published