GET ActivityĮvery time the uptime.py script is run, it's recorded in the database. Sites previously checked but removed from the list will return as down. You can get the current status of all websites checked with this end point: /getCurrentStatus Note: This will eventually be deprecated since the Sites component handles everything here and more. GET Current Status (Sites component replaces this) You can run the website checks manually with /updateStatus - it may take a few seconds to a minute to return something depends on how many sites are being checked. It will be a soft delete (visibility will be set to 0 instead of removing the row from the database). active - change the active status to either 1 (active) or 0 (inactive)ĭelete functionality will be coming in a future release.id - in order to edit a site, it must exist with an unique id in the database.
INTERNET UPTIME MONITOR RASPBERRY UPDATE
Along with the three properties above, send these additional two to update the site: You can update a site by using the /updateSite endpoint. New sites are automatically set to the active status, but can be turned off by changing the active property to 0.
INTERNET UPTIME MONITOR RASPBERRY HOW TO
The apache section below will cover how to run your flask app through apache.ĭetails on the Flask app will be posted later. Hostname will also work in some instances depending on your network setup. Substitute ip_addr for the IP address for your pi. You can now access it from any computer on your network (assuming there are no firewall settings blocking this) by going to. Once you have flask installed in your virtual environment, you can start flask with the following commands: The controller for the Flask app is upService.py.
To run apache in front of flask so that you can access your app without needing the port, read the Apache section below. So far, a few web service end points have been created. Note: The flask app is still under construction.
Most end points return JSON, some may return basic text. The flask app started as well as understand some of the basic endpoints. Web service end points have been created with Flask that can be connected to via a frontend web application or a simple Post request. I will add a way to programmatically update your settings in the future. You can also edit the initCron.py file and add a new method or edit an old one with your Cron settings and re-run the initCron.py script. You can also update the database manually. If you want to add or update your cron after you've run initCron.py, you can easily edit the official crontab with the following command: It will trigger an email from the sender to recipient email address as specified in config.py. If a site has been reported down 3 times in a row, Email Notification - a cron will run 1 minute after the sites are checked to get a count of how many times a particular site has been down.You can change the values in the init file or later in the crontab. This will NOT affect the red and yellow lights. This is the assumption that you will not be home to see the light. Enable/Disable Green LED - by default, the Green LED will be turned off between 12:30 AM and 5:30 PM on weekdays and 1 am and 8 am on weekends.Check Sites - by default, this will check sites every 15 minutes to see if they are online.Running initCron.py will clear your crontab and rewrite all defaults. This script will add the cron jobs listed below to crontab as well as to the cronSettings MySQL table. The following pin settings were used for this project: Optional protoboard and pins to make a hat for the Pi.Raspberry Pi - I use Zero W for this project.See deployment for notes on how to deploy the project on a live system. These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. There are also no physical LEDs associated with this, but virtual ones remain for a GUI that's in the works.Ĭlick image to watch demo on YouTube Table of Contents This app can be installed on any Linux system, not just Raspberry Pi. This is a newer implementation of the Raspberry Pi Website Uptime Monitor.