Skip to content

Commit

Permalink
Doc and license updated
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricss committed Oct 12, 2012
1 parent 22fe1a8 commit 8fc938a
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 2 deletions.
55 changes: 53 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,53 @@
server-monitor
==============
Server Monitoring based on Dropbox
==================================

Overview
--------

Monitor the health of your servers and receive alerts when something goes wrong.
This web application is built with the Opa technology and runs on top of a Dropbox-based database.

Demo
----

Main website and live demo at <a href="http://server-monitor.herokuapp.com/">http://server-monitor.herokuapp.com/</a>

Dropbox Storage
---------------
- All your configured jobs and logs are saved on your personal Dropbox account. Nothing is stored on the application server.
- If one of your sever goes down, a Dropbox popup will appear on your desktop.

The following code is a Dropbox database in Opa. Change the `@dropbox` annotation with `@mongo` and the app will run on top of MongoDB instead. It's that simple.

database monitor @dropbox {
stringmap(log) /logs
stringmap(job) /jobs
/logs[_]/status = { ok } // Define the default "status" value
}

function add(name, url, freq){
/monitor/jobs[name] <- (~{ url, freq })
}

__Note:__ This application is a proof of concept, aim to learn the <a href="http://opalang.org">Opa Framework</a> and to present a Dropbox-based database use case. The <a href="http://server-monitor.herokuapp.com/demo">demo</a> will stop monitoring your servers as soon as you close the page: fork the project and make you own production-ready version!

Compile
-------

<a href="http://opa.io">Download and install Opa</a>, then compile the single file:

opa main.opa


Run
---

<a href="https://www.dropbox.com/developers/apps">Create an app on Dropbox website</a> and use the app keys to start the application:

./main.js --db-remote:monitor app-key:app-secret


Tutorial
--------

Have a look at the <a href="https://github.com/cedricss/server-monitor/commits/master">commits list</a>: this is how the application was built, step by step.
10 changes: 10 additions & 0 deletions main.opa
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
Copyright © 2012 Cedric Soulas, MLstate
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

import stdlib.themes.bootstrap.{css, icons, responsive}

type status = { timeout } or { unreachable } or { unknown_error } or { error_simulation } or { ok }
Expand Down

0 comments on commit 8fc938a

Please sign in to comment.