Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/salaah01/website_pinger
Pings a website to check if it is alive, failing which send an email
https://github.com/salaah01/website_pinger
curl devops devops-tools ping python python3 smtp webdev webdevelopment website-pinger
Last synced: 21 days ago
JSON representation
Pings a website to check if it is alive, failing which send an email
- Host: GitHub
- URL: https://github.com/salaah01/website_pinger
- Owner: Salaah01
- License: mit
- Created: 2021-03-04T23:55:25.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-10T17:27:10.000Z (almost 4 years ago)
- Last Synced: 2024-11-17T08:44:18.708Z (2 months ago)
- Topics: curl, devops, devops-tools, ping, python, python3, smtp, webdev, webdevelopment, website-pinger
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Website Pinger
[![GitHub issues](https://img.shields.io/github/issues/Salaah01/website_pinger)](https://github.com/Salaah01/website_pinger/issues) [![GitHub forks](https://img.shields.io/github/forks/Salaah01/website_pinger)](https://github.com/Salaah01/website_pinger/network) [![GitHub stars](https://img.shields.io/github/stars/Salaah01/website_pinger)](https://github.com/Salaah01/website_pinger/stargazers) [![GitHub license](https://img.shields.io/github/license/Salaah01/website_pinger)](https://github.com/Salaah01/website_pinger/blob/master/LICENSE)
Ping a server checking that it is alive. If it is not, then sends an email notifying the server is down.
Would recommend using this along with a cron job which would periodically run the script.
## Requirements
* Python 3## Usage
`website_pinger.sh server_address [options]`
```bash
-c, --config-file Path to the config file.
-f, --mail-from Email from address
-t, --mail-to Email to address
-i, --host Email host
-j, --port Email port
-u, --user Email user
-p, --password Email password
-s, --subject Subject
-a, --msg-prefix Text to the added to the beginning of the email body.
-z, --msg-suffix Text to be added to the end of the email body.
```Any parameters defined in the config file will be overwritten by any of the other optional arguments.
The config file should be a JSON file. Example is below. Do note, that not all keys need to be defined, some can be provided via the other arguments.
```json
{
"HOST": "smtp.host",
"PORT": 587,
"USER": "username",
"PASSWORD": "password",
"TO": "[email protected]",
"FROM": "[email protected]"
}
```Not all keys need to exist in the the config, those which are not in the config must be at least provided as arguments when calling the script.