Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Redis & node.js powered dashboard skeleton

branch: master
README.md

dashboard

This is a simple dashboard-skeleton, which allows the submission of events into a rotating buffer. New events push out old ones, and we cap the events to the the most recent 1000.

Submission is handled via node.js, and storage is handled by Redis.

This server was discussed in the article Building a simple dashboard with redis and node.js .

Installation

Assuming you have node.js and redis installed then you may launch the server by running:

 nodejs ./dashboard.js

This will result in a process accepting UDP submissions on port 4433.

Submitting Events

Submitting events is as simple as firing UDP packets at the server which is now running.

NOTE: The server will bind on all available interfaces, so you should firewall submissions from malicious hosts.

There is a sample perl-client included to submit events to the dashboard.js server running on the localhost.

perl submit.pl "This is a test"
perl submit.pl "I like cake."

Viewing Events

There is a simple Ruby-based server supplied which would make a good starting point for a more featureful event-viewer.

Assuming you have Ruby, and the sinatra + redis gems installed you can launch the server with:

 cd ./viewer/
 ./server

This will launch a server which will process two URLs:

  • http://localhost:9999/
    • The front-page of the application.
  • http://localhost:9999/events/
    • Return a JSON array of hashes, corresponding to each message.

The front-page uses jQuery to dynamically load the JSON array and display it. You can see a screenshot here.

Problems

Please report any issue via the github repository:

License

BSD 3-clause.

Author

Steve Kemp steve@steve.org.uk

Something went wrong with that request. Please try again.