Updown
Remote monitoring and dashboard for your Express apps.
User-Interface
Installation
$ npm install updown
Usage
First create service with updown.createService()
You must pass option ping:true
for simply check service status
google = updown;
Cronjob
To specify time to check service status, simply pass the cronTime
option with cron job format
google = updown;
Available Cron patterns
Asterisk. E.g. *
Ranges. E.g. 1-3,5
Steps. E.g. */2
Cron example
*/10 * * * * 1-2 Run every 10 seconds on Monday and Tuesday
00 */2 * * * * Run every 2 minutes everyday
00 30 09-10 * * * Run at 09:30 and 10:30 everyday
00 30 08 10 06 * Run at 08:30 on 10th June
* Use 0 for Sunday
Events
The following events are currently supported:
- `success` when service has up
- `error` when service has down
For example this may look something like the following:
google; google;
Processing Service
To processing service. First create service instance and don't pass ping
option, Updown not use url
option
to ping service status, so you can pass not only url but also pass string or service name you want.
we invoke done.error()
for service has down and done.success()
when service has up
database = updown; database;
You can pass object or string parameter to tell Updown what is response when processing service to show up on web UI
database;
On web interface when you pass data to done.success(data)
or done.error(data)
Send Mail
Calling updown.mailConfig()
with SMTP config to send mail when service change status from up to down
updown;
Pass the sendmail
option for service you want to send mail.
google = updown;
Connect with Express
Incorporate updown into your express app in just one step.
Add the Middleware to express
express = ;app = ;app;app;
Example Application
There is an example application at ./example To run it:
$ cd example
$ node server.js
Securing updown
Add authentication for your app by adding additional middleware like Connect's basicAuth()
app;
API
updown.createService( name, options)
url
- [REQUIRED] - The service location.ping
- [OPTIONAL] - Simply ping the url. don't use this option when useupdown.process()
.cronTime
- [OPTIONAL] - defaults to00 */1 * * * *
run every 1 minutes.
updown.setPath(path)
Set path to web interface. defaults is root path '/'
.
TODO
- Use Socket.io to update service status.
- Display both local and server time