It checks URL's from a text file and sends an email if an error occurs. For the backend, we are using Sqlite3 with a simple table that holds domains once they have issues.
Currently working for GNU/Linux Operating Systems only.
How to use:
Setup
This was developed with python 2.5 and has not been tested with earlier versions of Python. Make sure the files are executable by doing:
chmod -r 755 webstatus*
Run setup.py to copy the files needed for webstatus to work.
python setup.py install
This will copy webstatus to /etc/init.d/ and the rest to /etc/webstatus and will create the log file in /var/log/webstatus/log.
Domains to check
Use the config.ini file to place the domains you want to check. Use the same convention to add new domains as the example domains in config.ini
I have created this to be used with a (your) gmail account. To be able to receive emails, you need to edit webstatus and subwebstatus.
Go to the notify function on both scripts and fill out the empty quotes ('user', 'passwd' and 'to').
Ready to go!
Finally, when the files are all copied and ready to go run:
sudo /etc/init.d/webstatus start
You should see a small message indicating that webstatus is now running on the background along with the PID number.
Log File
They are extremely rudimentary and output is not being redirected nicely but is still working nevertheless. This will definitely have to improve. The log file is located in
/var/log/webstatus/log
Uninstall/Remove
If you don't want the application on your system anymore, or want to "reinstall" you have to run setup.py again:
python setup.py remove
This will remove (as in delete) all the copied files in your system.
Extras
There are some additional options you may want to use with the tools provided via the command line.
Database
The database script (dbwork.py) currently accepts 3 types of requests: Insert: Inserts a value into the database with "-i" option. Example:
python dbwork.py -i "http://example.com"
Delete: Removes a record in the database with the "-d" option. Example:
python dbwork.py -d "http://example.com"
Query: Queries the database and prints out the list of all the records found with the "-q" option. Example:
python dbwork.py -q
Subwebstatus
The only parameter subwebstatus takes is the url you want to check. Example:
python subwebstatus "http://example.com"
Testing
This is not working yet. Testing of the whole setup is needed to make sure all parameters are ok.