Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/quagliato/nodejs-health-check
A health check ping using node.js that notifies a e-mail address when the url is down or no responding 200 codes for a specific set of parameters.
https://github.com/quagliato/nodejs-health-check
Last synced: 9 days ago
JSON representation
A health check ping using node.js that notifies a e-mail address when the url is down or no responding 200 codes for a specific set of parameters.
- Host: GitHub
- URL: https://github.com/quagliato/nodejs-health-check
- Owner: quagliato
- License: mit
- Created: 2015-10-27T05:18:06.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-02-11T09:28:35.000Z (almost 2 years ago)
- Last Synced: 2024-04-29T22:31:15.410Z (7 months ago)
- Language: JavaScript
- Size: 1.11 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README
# nodejs-health-check
**NOT A STATE OF THE ART CODE, I'M JUST MESSING AROUND!**
A health check ping using node.js that notifies a e-mail address when the
url is down or no responding 200 codes for a specific set of parameters.## Instructions
### Create a configuration JSON
You can use the `config-example.json` file as an example to you configuration
JSON.In the JSON, you need to fill the SMTP info (host, port, user and password).
There is 2 ways to do it:1. One `smtp_settings` for all apps, right on the root of the object;
2. One `smtp_settings` for each app;
App's `smtp_settings` will always override root's `smtp_settings`.
You also need to fill the array `targets` with objects containing the following
properties:* **url**: The URL you want to monitor using http:// or https://;
* **method**: The HTTP method you want to use. If nothing is provided, GET will be used;
* **app\_name**: This name will be used to the email's subject and content;
* **report\_email**: The email to which the report will be sent;
* **body**: If the response should have any specific body, fill it here.Place the call in the crontab of a server and that's it!
### Setting your configuration
There are 3 ways to inject your JSON configuration to the app:
1. Set an environment variable ` HEALTH_CHECK_CONFIG_FILE` with the path to the
file;2. Set an environment variable `HEALTH_CHECK_CONFIG` with the whole
configuration JSON;3. Set an environment variable `HEALTH_CHECK_CONFIG_URL` with and URL to a plain
text configuration JSON, the app will request it via GET and parse it;### Run
Simple as `$ npm start`.
## Support
Got doubts? E-mail me at [[email protected]](mailto:[email protected]). ;)