https://github.com/nickromano/serverless-ping
Monitoring Service using AWS Lambda
https://github.com/nickromano/serverless-ping
alerting monitoring ping python serverless
Last synced: 7 months ago
JSON representation
Monitoring Service using AWS Lambda
- Host: GitHub
- URL: https://github.com/nickromano/serverless-ping
- Owner: nickromano
- License: mit
- Created: 2018-01-14T00:29:56.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2022-05-25T21:29:02.000Z (almost 4 years ago)
- Last Synced: 2025-04-22T13:54:45.640Z (11 months ago)
- Topics: alerting, monitoring, ping, python, serverless
- Language: Python
- Homepage:
- Size: 1.17 MB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Serverless Ping
[](http://www.serverless.com)
[](https://travis-ci.org/nickromano/serverless-ping)
[](https://coveralls.io/github/nickromano/serverless-ping?branch=master)
Once a minute this lambda function will check to see if your endpoint is up. If so it will send the response time to Cloudwatch. A Cloudwatch alarm will then email you when the endpoint is down (`ALARM`) or if the lambda function stops working (`INSUFFICENT RESULTS`).
`Cloudwatch Event (1 minute)` > `AWS Lambda` > `Cloudwatch Data` > `Cloudwatch Alarm` > `SNS Topic` > `SNS Email Subscription`
Estimated Costs: **$0.05/month** *(not including free tier)* [source](https://s3.amazonaws.com/lambda-tools/pricing-calculator.html)
## Setup
Install the serverless commandline tools
```
npm install -g serverless
```
Deploy this service to AWS (swap out parameters for your needs)
```
serverless deploy \
--ping-name=google \
--ping-host=https://google.com \
--ping-alarm-email=alertme@gmail.com
```
That's it! 🎉
### Cleanup
To remove all resources created run
```
serverless remove \
--ping-name=google \
--ping-host=https://google.com \
--ping-alarm-email=alertme@gmail.com
```
### Additional Options
Alarm namespace - By default the cloudwatch data will be put under the `Serverless/Ping` namespace. You can override it using `--ping-alarm-namespace`.
```
--ping-alarm-namespace=MyNamespace/Ping
```
Exception Monitoring - Any exceptions thrown in the lambda function will be logged to CloudWatch Logs. If you would like them also sent to sentry add the DSN as another paramter to the `serverless deploy` command above.
```
--ping-sentry-dsn=https://*********:*******@sentry.io/*****
```
## Contributing
Installing dependencies. Vendored dependencies are included in the git repo to make it easier for users to deploy this.
```
pip3 install -t vendored/ -r requirements.txt --upgrade
```