Send Email on failure or restart of systemd service on Raspberry Pi
What you learn here about raspberry pi service failure or restart
- Send email on failure or restart of systemd service
Sometimes while working with raspberry pi we come to situation where we want to restart service automatically and need to send email to desired receiver right ! so here we will see how restart stopped or failed service automatically and how to send email on failure of Service.
Send email on failure or restart of systemd service
Please follow the following steps to know how to Send email on failure or restart of systemd service on raspberry pi using python
Please make sure that you have created service on your raspberry pi which you want to monitor
1)Please first sign in first your Gmail or Email account in the browser.
2)Now please click on the following link to enable security option so that you can send email using python
3)Now please click on the following link to enable the captcha option so that you can send an email using python without login the browser.
4)Now please download the following python code which will monitor service and send Email on restart or failure.Download Raspberry pi Service Autorestart and Email Send code (154 downloads)
5)Unzip the downloaded code and modify the following things which is shown below
6)Now please run the python code. You can also make this python code as service.
This post is contributed by Rahul Gusai. If you like to contribute bytesofgigabytes, you can also write an article using bytesofgigabytes contribute . See your article appearing on the bytesofgigabytes.com main page to help other people.