Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrsarm/wt-check
Webtask cron script that checks an URL response
https://github.com/mrsarm/wt-check
cron-script javascript-library slack webtask webtask-platform
Last synced: 11 days ago
JSON representation
Webtask cron script that checks an URL response
- Host: GitHub
- URL: https://github.com/mrsarm/wt-check
- Owner: mrsarm
- License: apache-2.0
- Created: 2016-07-03T18:44:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-04T12:10:44.000Z (over 8 years ago)
- Last Synced: 2025-01-05T17:52:49.390Z (25 days ago)
- Topics: cron-script, javascript-library, slack, webtask, webtask-platform
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Webtask script to check sites status and health
===============================================Small app that runs as a cron script on [Webtask](https://webtask.io)
platform and **checks if an URL get a response**, and allows also to check
if the **body match** with a given string or a regex expression.If the check fails posts a message in a [Slack](https://slack.com) channel.
![Message posted to a Slack channel with wt-check](https://mrdev-public.s3.amazonaws.com/wt-check/wt-check_slack_msg.png)
Run
---Install on Webtask platform as a cron service running every 2 minutes with:
$ wt cron schedule \
-n checkcron \
--secret "URL=http://theurltocheck.com/path/to/uri" \
--secret STATUS=200 \
--secret TIMEOUT=5000 \
--secret "BODY=Text expected" \
--secret "REGEX=Regex expression" \
--secret SLACK_TOKEN=THETOKEN \
--secret SLACK_CHANNEL=CHANNELNAME \
"*/2 * * * *" \
check.js### Options
* `-n checkcron`: the name of the cron process.
* `--secret URL`: The URL to check.
* `--secret STATUS`: (optional) The status expected, default 200.
* `--secret TIMEOUT`: (optional) Milliseconds to wait the response
before aborting the request, default 10000 (10 seconds).
* `--secret BODY`: (optional) A text expected in the body.
* `--secret REGEX`: (optional), regex expression expected to match with
the body.
* `--secret SLACK_TOKEN`: the Slack API token, go to https://api.slack.com/web#authentication
to get a token.
* `--secret SLACK_CHANNEL`: the channel where to post the alerts.
* `"*/2 * * * *"`: _cron_ configuration (eg. run every 2 min).You can also install the script directly to Webtask platform without
having this project downloaded in your local machine with:$ wt cron schedule [OPTIONS] \
https://raw.githubusercontent.com/mrsarm/wt-check/master/check.jsTo see more options of _Webtask CLI_ go to https://webtask.io/docs.
About
-----**Source code**: https://github.com/mrsarm/wt-check
**Author**: Mariano Ruiz ([email protected])
2016 | Apache-2.0