Table of Contents
-
Sign up for (or log in to) your Twilio account (https://www.twilio.com/try-twilio)
-
Get a phone number with SMS (and MMS) capabilities from Twilio
-
Get your Twilio account SID and Auth Token
-
Use your own Gmail account or create a new one for the usage of this script
- If using a Rapsberry Pi, make sure to install your flavor of OS and run its appropriate updates, also make sure that python is installed and updated
python -V
- Install required packages:
- Twilio
pip3 install twilio
- Yagmail
pip3 install yagmail
-
Send an SMS message in Python via the REST API to make sure your account is properly setup https://www.twilio.com/docs/sms/tutorials/how-to-send-sms-messages-python#send-an-sms-message-in-python-via-the-rest-api
-
Test sending email with simple one liner:
yagmail.SMTP('mygmailusername').send('[email protected]', 'subject', 'This is the body')
For additonal help please refer to libraries documentation below:
-
Yagmail See the Yagmail Documentation for project description.
-
Twilio See the Twilio Documentation for project description.
- Clone the repo
git clone https://github.com/JDSanti/Server_Checker.git
- Setup your own email and password on script by replacing "email" and "password" with your own **NOTE: This method is not recommended, since you would be storing the full credentials to your account in your script in plain text. I did it for simplicity purposes but please refer to https://yagmail.readthedocs.io/en/latest/setup.html#configuring-credentials for proper storage of passwords.
yag = yagmail.SMTP('email', 'password')
- Setup your own phone numbers on script by replacing "from" and "to" variables with your own
from_='+15555555555', to='+15555555555' )
- Replace "server.com" with the domain of the web server you want to test. It can test multiple servers ["server.com","server2.com"]
servers_to_check=["server.com"]
- Run script
python3 server.py
- Setup as cron job
- Implement texting ability
- Implement email ability
- Setup as cron job on Pi Zero
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Jose Santiago - @Capt_Santiago - [email protected]
Project Link: https://github.com/JDSanti/Server_Checker