Permalink
Browse files

Fxing default IP

  • Loading branch information...
MainframeEnzo committed Jan 3, 2012
1 parent 629cf2d commit 7b0f077deeb7ad572a902d732edba34f401dfd17
Showing with 4 additions and 2 deletions.
  1. +2 −2 modules/dao.js
  2. +2 −0 run/client.js
View
@@ -51,10 +51,10 @@ DaoManagerModule.prototype.postCloudwatch = function (metricName, unit, value) {
params['MetricData.member.1.Unit'] = unit;
params['MetricData.member.1.Value'] = value;
params['MetricData.member.1.Dimensions.member.1.Name'] = 'InstanceID';
- params['MetricData.member.1.Dimensions.member.1.Value'] = Module.constants.globals[Module.constants.strings.IP];
+ params['MetricData.member.1.Dimensions.member.1.Value'] = process.env[Module.constants.strings.IP];
Module.logger.write(Module.constants.levels.INFO, 'CloudWatch Namespace: ' + Module.constants.globals[Module.constants.strings.CLOUDWATCH_NAMESPACE]);
- Module.logger.write(Module.constants.levels.INFO, 'CloudWatch IP: ' + Module.constants.globals[Module.constants.strings.IP]);
+ Module.logger.write(Module.constants.levels.INFO, 'CloudWatch IP: ' + process.env[Module.constants.strings.IP]);
Module.logger.write(Module.constants.levels.INFO, 'CloudWatch MetricName: ' + metricName);
Module.logger.write(Module.constants.levels.INFO, 'CloudWatch Unit: ' + unit);
Module.logger.write(Module.constants.levels.INFO, 'CloudWatch Value: ' + value);
View
@@ -59,6 +59,8 @@ function NodeMonitor() {
utilities.autoPopulate(function () {
/* Set default IP */
constants.globals[constants.strings.IP] = constants.globals[constants.strings.LOCAL_IPV4];
+ process.env[constants.strings.IP] = constants.globals[constants.strings.LOCAL_IPV4];
+ logger.write(constants.levels.INFO, 'IP: ' + process.env[constants.strings.IP]);
/* Validate credentials */
credentials.check();

0 comments on commit 7b0f077

Please sign in to comment.