Modularization, dynamic service add/remove, refactoring and (possibly) bugfixing #36

merged 16 commits into from Jan 23, 2013

3 participants


First, my apologies. I REALLY went overboard with changing the code. Rest assured though that as far as I have seen it should all work.

This addresses mainly #35 and #34. I have already wrote a first integration in my application, and the service list basically updates itself using node-mdns. Pretty cool stuff :). Now I will be using the events from the api to enable and disable other higher level service across our architecture with it.

It also, I think, makes the code more readable, and standard (I jshinted the files I modified as I go). I fixed a few things here and there (see commit log).

I would still need to fix a thing or two before really having something ready (for instance, moving default config to server.js so that it is taken in consideration when starting statusdashboard from code), but I thought I should let you guys know of what I had done in terms of changes.

Again, apologies for the aggressive rewrites, but I hope you will find value in what is in this.

stelcheck added some commits Jan 15, 2013
@stelcheck stelcheck * Refactored api.js, now contains only api calls and the check loop
* Refactored server.js so that it can become embeddable as a ndoe module
* created bin/statusdashboard, to be used as a binary app instead of server.js
* created lib/sources, for creating different source check
* created lib/checks, for creating shared checks between sources
* All touched code should now pass standard jshint test
@stelcheck stelcheck * adding an entry specifying the binary 7a3e8ae
@stelcheck stelcheck * shuffled some functions around and added some comments for clarity fbeb664
@stelcheck stelcheck * reconfigure, start and stop for the scheduler 24283ec
@stelcheck stelcheck * Fixed double-callback issue with statusDashboard check sequence 45c35bb
@stelcheck stelcheck * new api function: addService and removeService
* some code refactoring to keep module internal variables close to what uses them
* renamed api.start/stop to startChecking/stopChecking
@stelcheck stelcheck * Updating the package.json a bit, and adding myself as a contributor c1887d9
@stelcheck stelcheck * Fixed logging: now uses the same logging strategy as the rest of th…
…e app
@stelcheck stelcheck * Updated the README file 6e28e0e
@stelcheck stelcheck * Bugfix: splice the status object as well to remove it from the stat…
… list
@stelcheck stelcheck * Adding callback for httpStatusCodeCheck
* Bugfix: incorrect path for static content delivery when used as a node submodule
@stelcheck stelcheck * Made the code use callback in http and https, instead of calling th…
…e controller.emit twice
@stelcheck stelcheck * bugfix: bin definition was wrong c6f4305
@stelcheck stelcheck * Adding possiblility of custom http checks 4911fc9
Statusdashboard project member

Not tested but looks like a very nice contribution!

Statusdashboard project member

Thanks for your contribution.
I need time to test.

Statusdashboard project member

After some tests, I think there is a bug in ftp check.
I can see in my log

 TypeError: Object [object Object] has no method 'command'

I think it is line 50

var ftp = new Ftp(service, stream);

this 'ftp object' does not have a command function.

With demo settings, it seems to block other checks.

@stelcheck stelcheck * Bugfix: Ftp methods were note prototype methods
* Uncaught exception now prints stacktrace instead of just the error message
Statusdashboard project member

I think callback is not defined

I have refactored ftp.js a bit now, that should solve the problem

Statusdashboard project member

I think that ftp is not defined

Just refactored, this should solve the problem. indeed, this should gave used this instead of ftp

Statusdashboard project member

Looks great.
@stelcheck thank you for this awesome contribution

@obazoud obazoud merged commit ec8f18e into statusdashboard:master Jan 23, 2013
Statusdashboard project member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment