Permalink
Browse files

Moving ip get to client.js

  • Loading branch information...
1 parent 4952064 commit 251dedf24c5fc52ccf6deb20acb206d879531edb @MainframeEnzo MainframeEnzo committed Jan 3, 2012
Showing with 9 additions and 7 deletions.
  1. +1 −1 bin/node-monitor.sh
  2. +0 −5 modules/dao.js
  3. +5 −1 run/client.js
  4. +3 −0 submodules/utilities.js
View
@@ -9,7 +9,7 @@ case "$1" in
cd ~/node-monitor/run
#node client.js > /dev/null 2>&1 &
- node client.js ec2=true debug=false console=false cloudwatch=true
+ node client.js ec2=true debug=false console=false cloudwatch=true &
;;
'stop')
View
@@ -14,11 +14,6 @@ DaoManagerModule = function (constants, utilities, logger, dao) {
Module.logger = logger;
Module.dao = dao;
- Module.utilities.getInternalIP(function (ip) {
- Module.logger.write(Module.constants.levels.INFO, 'IP: ' + ip);
- process.env[Module.constants.strings.IP] = ip;
- });
-
/* Setup dependencies */
for (var name in modules) {
eval('var ' + name + ' = require(\'' + modules[name] + '\')');
View
@@ -56,7 +56,11 @@ function NodeMonitor() {
utilities.parseCommandLineOptions(function () {
/* Validate credentials */
credentials.check(function () {
- callback();
+ utilities.getInternalIP(function (ip) {
+ logger.write(constants.levels.INFO, 'IP: ' + ip);
+ process.env[Module.constants.strings.IP] = ip;
+ callback();
+ });
});
});
});
@@ -50,6 +50,7 @@ UtilitiesManagerModule.prototype.getInstanceId = function (callback) {
} else { /* Debug */
/* console.log('Read ec2 parameter: ' + parameter + ', with value: ' + stdout); */
callback(stdout);
+ return;
}
});
});
@@ -69,6 +70,7 @@ UtilitiesManagerModule.prototype.getPublicHostname = function (callback) {
} else { /* Debug */
/* console.log('Read ec2 parameter: ' + parameter + ', with value: ' + stdout); */
callback(stdout);
+ return;
}
});
});
@@ -88,6 +90,7 @@ UtilitiesManagerModule.prototype.getInternalIP = function (callback) {
} else { /* Debug */
/* console.log('Read ec2 parameter: ' + parameter + ', with value: ' + stdout); */
callback(stdout);
+ return;
}
});
});

0 comments on commit 251dedf

Please sign in to comment.