README.md 6.54 KB
Newer Older
Olivier Bazoud's avatar
Olivier Bazoud committed
1
Status Dashboard
Olivier Bazoud's avatar
Olivier Bazoud committed
2
=======
Olivier Bazoud's avatar
Olivier Bazoud committed
3

Olivier Bazoud's avatar
Olivier Bazoud committed
4 5
Status Dashboard is status page for your configured services or applications.

obazoud's avatar
obazoud committed
6
Demo @ [Heroku](http://heroku.com) : [http://statusdashboard-node.herokuapp.com](http://statusdashboard-node.herokuapp.com)
Olivier Bazoud's avatar
Olivier Bazoud committed
7 8 9 10

Screenshots
=======

Olivier Bazoud's avatar
Olivier Bazoud committed
11
<img src="http://blog.bazoud.com/images/ssd1.png" alt="">
Olivier Bazoud's avatar
Olivier Bazoud committed
12

Olivier Bazoud's avatar
Olivier Bazoud committed
13
<img src="http://blog.bazoud.com/images/ssd2.png" alt="">
Olivier Bazoud's avatar
Olivier Bazoud committed
14

Olivier Bazoud's avatar
Olivier Bazoud committed
15
<img src="http://blog.bazoud.com/images/ssd3.png" alt="">
Olivier Bazoud's avatar
Olivier Bazoud committed
16 17


Marc Trudel's avatar
Marc Trudel committed
18 19 20 21 22 23 24 25
Installation
============

* npm install statusdashboard
or
* npm install git+https://github.com/iobazoud/statusdashboard#master

Optionally, you can install as a global package
obazoud's avatar
Doc  
obazoud committed
26

Olivier Bazoud's avatar
Olivier Bazoud committed
27 28 29
Roadmap
=======
* Improve UI: scrollbars, filters, check type column, ...
30
* Add network services like SMTP, POP3, ...
Olivier Bazoud's avatar
Olivier Bazoud committed
31 32 33 34 35 36
* Improve REST API to get / push data
...

How To Use
=======

Marc Trudel's avatar
Marc Trudel committed
37
### As an application
Olivier Bazoud's avatar
Olivier Bazoud committed
38

Marc Trudel's avatar
Marc Trudel committed
39
Add your entry in settings.js.
Olivier Bazoud's avatar
Doc  
Olivier Bazoud committed
40

obazoud's avatar
Doc  
obazoud committed
41 42 43 44 45 46
<pre class="json">
settings['xxx'] = {
...
};
</pre>

obazoud's avatar
obazoud committed
47
* export APP_ENV=demo
Marc Trudel's avatar
Marc Trudel committed
48
* ./bin/statusdashboard
Olivier Bazoud's avatar
Olivier Bazoud committed
49

obazoud's avatar
obazoud committed
50 51 52 53
You can override settings with an external settings for private information like passwords, ..

* vi ~/.statusdashboard/settings.js
<pre class="json">
obazoud's avatar
obazoud committed
54 55 56 57 58 59 60 61 62 63
exports.create = function() {
  var appSettings = {
    port: 8081,
    services: [{
      name: 'FTP Local',
      password: 'xxx'
    }]
  };
  return appSettings;
};
obazoud's avatar
obazoud committed
64 65 66 67
}</pre>

* export APP_SETTINGS=~/.statusdashboard/settings.js

Marc Trudel's avatar
Marc Trudel committed
68 69
### As a node module

Jon de la Motte's avatar
Jon de la Motte committed
70
```
Marc Trudel's avatar
Marc Trudel committed
71
var dashboard = require('statusdashboard').dashboard(settings);
Jon de la Motte's avatar
Jon de la Motte committed
72
```
Marc Trudel's avatar
Marc Trudel committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96

#### Code

##### dashboard.api.addService(serviceObject)

Add a new service to be checked

##### dashboard.api.removeService(ServiceName)

Remove a service to be checked

##### dashboard.api.startChecking

Start the scheduled checks. Automatically is started by default when instanciating dashboard

##### dashboard.api.stopChecking

Stop the scheduled checks

##### dashboard.api.getStatus()

Return the current status of checked services

**All other calls available in api.js are to be used at your own risk. You have been warned**
obazoud's avatar
obazoud committed
97 98 99 100

Service
=======

101
Daemon init script for node.js: [https://gist.github.com/1123553](https://gist.github.com/1123553)
obazoud's avatar
Doc  
obazoud committed
102

obazoud's avatar
Doc  
obazoud committed
103 104 105 106
Plugins
=======

Some plugins are available out-of-the-box:
obazoud's avatar
obazoud committed
107

obazoud's avatar
Doc  
obazoud committed
108
* Console
Olivier Bazoud's avatar
Olivier Bazoud committed
109 110 111
* Graphite, send service state in [Graphite](http://graphite.wikidot.com/)
* Heartbeat
* History, save service state in <a href="http://redis.io">Redis</a> (Thanks to <a href="https://github.com/sreeix">sreeix</a> initial pull request) and graph it!
obazoud's avatar
Doc  
obazoud committed
112
* IRC bot
Olivier Bazoud's avatar
Olivier Bazoud committed
113
* Mail
obazoud's avatar
Doc  
obazoud committed
114
* Twitter
Olivier Bazoud's avatar
Olivier Bazoud committed
115
* Webhook
Christophe Hamerling's avatar
Christophe Hamerling committed
116
* XMPP
obazoud's avatar
obazoud committed
117

Olivier Bazoud's avatar
Olivier Bazoud committed
118
<img src="http://blog.bazoud.com/images/ssd7a.png" alt="">
obazoud's avatar
obazoud committed
119

Olivier Bazoud's avatar
Olivier Bazoud committed
120
<img src="http://blog.bazoud.com/images/ssd8a.png" alt="">
obazoud's avatar
Doc  
obazoud committed
121

122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
External Plugins
================

You can develop independent plugins and load them into Status Dashboard by using the external plugin feature. A plugin example is available at [http://github.com/chamerling/sd-plugin-sample](http://github.com/chamerling/sd-plugin-sample).

Plugins can be installed using npm CLI (from the status-dashboard directory):

    npm install sd-plugin-sample

Or by adding them as dependency in the status-dashboard package.json descriptor.

In order to activate plugins, you have to add them to the plugins.json file (\["sd-plugin-sample"\], \["my_plugin"\]) and turn on the external plugins feature in settings.js:

    plugins : {
      external: {
        enable : true,
        file : __dirname + '/plugins.json'
      },
      ...
    }

obazoud's avatar
obazoud committed
143
REST API
obazoud's avatar
obazoud committed
144
=======
obazoud's avatar
obazoud committed
145

obazoud's avatar
Doc  
obazoud committed
146
* List services
obazoud's avatar
obazoud committed
147 148
<pre class="terminal">
$ curl http://127.0.0.1:8080/api/services
obazoud's avatar
obazoud committed
149
{"last":"Fri, 17 Jun 2011 22:33:03 GMT","services":[{"name":"couchdb","label":"Couchdb server @ local","status":"up","statusCode":200,"message":""},{"name":"bazoud.free.fr","label":"Olivier Bazoud blog","status":"up","statusCode":200,"message":""},{"name":"bazoud.free.fr","label":"Olivier Bazoud blog test.php","status":"up","statusCode":200,"message":""},{"name":"redis","label":"Redis server @ local","status":"up","statusCode":0,"message":""},{"name":"FTP Local","label":"Ftp @ local","status":"down","statusCode":0,"message":"ECONNREFUSED, Connection refused"},{"name":"PID file","label":"Pid @ local","status":"unknown","statusCode":9,"message":"EBADF, Bad file descriptor '/tmp/terminal.pid'"}],"lastupdate":"Fri, 17 Jun 2011 22:33:08 GMT","summarize":{"lastupdate":"Fri, 17 Jun 2011 22:33:08 GMT","up":3,"critical":0,"down":1,"unknown":2}}
obazoud's avatar
obazoud committed
150
</pre>
obazoud's avatar
obazoud committed
151

obazoud's avatar
Doc  
obazoud committed
152
* Retrieve a specific service
obazoud's avatar
obazoud committed
153 154
<pre class="terminal">
$ curl http://127.0.0.1:8080/api/services/couchdb
obazoud's avatar
obazoud committed
155
{"name":"couchdb","label":"Couchdb server @ local","status":"up","statusCode":200,"message":""}
obazoud's avatar
obazoud committed
156
</pre>
obazoud's avatar
obazoud committed
157

obazoud's avatar
Doc  
obazoud committed
158
* Retrieve a summary
obazoud's avatar
obazoud committed
159 160
<pre class="terminal">
$ curl http://127.0.0.1:8080/api/summarize
obazoud's avatar
obazoud committed
161
{"up":4,"critical":0,"down":1,"unknown":1}
obazoud's avatar
obazoud committed
162
</pre>
obazoud's avatar
obazoud committed
163

obazoud's avatar
obazoud committed
164 165 166 167 168 169
* Version of application
<pre class="terminal">
$ curl -iX GET http://127.0.0.1:8080/api/version
{"commit":"641b97cbcfdc53b1b2b825d588afe08e412471d4","author":"obazoud","committer":"obazoud","date":"Fri, 12 Aug 2011 10:15:27 GMT"}
</pre>

obazoud's avatar
obazoud committed
170
* And plugin can contribute to statusdashboard REST API
obazoud's avatar
obazoud committed
171
<pre class="terminal">
obazoud's avatar
obazoud committed
172
$ curl http://127.0.0.1:8080/api/history/service/couchdb
obazoud's avatar
obazoud committed
173 174 175 176
["{\"time\":1310024374699,\"status\":\"up\",\"message\":\"\",\"code\":200}","{\"time\":1310024379591,\"status\":\"up\",\"message\":\"\",\"code\":200}", ...]
</pre>


obazoud's avatar
obazoud committed
177

obazoud's avatar
obazoud committed
178 179 180
Early adopters
=======

obazoud's avatar
Doc  
obazoud committed
181
* [Exoplatform](http://status.exoplatform.org)
obazoud's avatar
obazoud committed
182

Olivier Bazoud's avatar
Olivier Bazoud committed
183
<img src="http://blog.bazoud.com/images/ssd4.png" alt="status.exoplatform.org">
obazoud's avatar
obazoud committed
184

obazoud's avatar
Doc  
obazoud committed
185
* [Shufflr](https://twitter.com/shufflr)
obazoud's avatar
obazoud committed
186

Olivier Bazoud's avatar
Olivier Bazoud committed
187
<img src="http://blog.bazoud.com/images/ssd5.png" alt="">
obazoud's avatar
obazoud committed
188

obazoud's avatar
Doc  
obazoud committed
189 190
* [Ekino](http://www.ekino.com)

Olivier Bazoud's avatar
Olivier Bazoud committed
191
<img src="http://blog.bazoud.com/images/ssd9.png" alt="">
obazoud's avatar
Doc  
obazoud committed
192 193

* IRC Plugin screenshot @ exoplatform
obazoud's avatar
obazoud committed
194

Olivier Bazoud's avatar
Olivier Bazoud committed
195
<img src="http://blog.bazoud.com/images/ssd6.png" alt="">
obazoud's avatar
obazoud committed
196

Olivier Bazoud's avatar
Olivier Bazoud committed
197 198 199 200 201 202 203 204 205 206 207 208 209 210
Contribute
=======

Here's the most direct way to get your work merged into the project.

1. Fork the project
2. Clone down your fork
3. Create a feature branch
4. Hack away and add tests, not necessarily in that order
5. Make sure everything still passes by running tests
6. If necessary, rebase your commits into logical chunks without errors
7. Push the branch up to your fork
8. Send a pull request for your branch

obazoud's avatar
obazoud committed
211 212 213 214
In the news
=======

* IT Wars: [StatusDashboard monitoring avec Node.js](http://www.it-wars.com/article265/statusdashboard-monitoring-avec-node-js)
Olivier Bazoud's avatar
Olivier Bazoud committed
215
* William Durand blog: [Services Status Dashboard](http://williamdurand.fr/2012/01/16/services-status-dashboard/)
Christophe Hamerling's avatar
Christophe Hamerling committed
216 217
* C.Hamerling blog: [Node.js client for Status Dashboard](http://chamerling.wordpress.com/2012/10/23/node-js-client-for-status-dashboard/)
* C.Hamerling blog: [Monitoring Tool in the Cloud in (less than) 2 minutes...](http://chamerling.wordpress.com/2013/01/24/monitoring-tool-in-the-cloud-in-less-than-2-minutes/)
Olivier Bazoud's avatar
Olivier Bazoud committed
218 219 220 221 222 223

Licence
=======

Statusdashboard is provided under Apache Software Licence 2.0.