Coder Social home page Coder Social logo

cwd's Introduction

CWD - Cron Watch Dog

tmkdev llc - 2016

I needed a simple web service to monitor small applications that are dependant on cron jobs running.

I found some SaaS solutions - none of them were exactly what I was looking for. (https://steward.io/, https://deadmanssnitch.com/, webcron.com)

So I wrote this.

Released as https://opensource.org/licenses/GPL-2.0 - GPL-2.0 opensource.

Setup:

Install the python requirements: sqlalchemy bottle bottle-sqlalchemy db driver of choice (Mysql and sqlite tested)

  1. Copy configuration_dist.py to configuration.py. Edit with your values.

  2. Add to apache. Or run as a stand alone service using Bottle.py's built in service. Or your favorite WSGI server.

    • if you use app.py and bottle's built in wsgi, it will start a thread for cwd_checker. Ignore 3.
  3. Set the job monitor service to run. #CRONENTRY @reboot /usr/bin/python cwd_checker.py > logfile.log 2>&1;

  4. Log in. Bottle starts service at 8080. Your apache conf should start it where you tell it.

  5. Set up cwd_status.sh to run before and after your monitored jobs. Set up the URL vars as needed. cwd_status.sh jobnametomonitor start
    jobname && cwd_status.sh jobnametomonitor end
    || cwd_status.sh jobnametomonitor fail

  6. Edit the periodicity of your job and SLA levels in the GUI.

Apache sample site conf (Needs Mod-wsgi) <Virtualhost *:80>

    WSGIPassAuthorization on
  	WSGIDaemonProcess cwd user=www-data group=www-data processes=1 threads=5
    WSGIScriptAlias /cwd /home/ubuntu/cwd/app.wsgi

	<Directory /home/ubuntu/cwd>
    	WSGIProcessGroup cwd
    	WSGIApplicationGroup %{GLOBAL}
	    Require all granted
    	Order deny,allow
	</Directory>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.