Skip to content
Browse files

Adding path change so upstart job works and cd isn't needed

  • Loading branch information...
1 parent 49b8124 commit 8371d4a7a59857cfdb691eaf882ba441a9a18794 @franklovecchio franklovecchio committed
Showing with 9 additions and 12 deletions.
  1. +0 −11 plugins/free.js
  2. +2 −1 submodules/constants.js
  3. +7 −0 submodules/utilities.js
View
11 plugins/free.js
@@ -14,17 +14,6 @@ this.name = Plugin.name;
this.type = Plugin.type;
Plugin.format = function (data, system) {
- switch (system) {
- case 'darwin':
- Plugin.command = 'top -l 1 | awk \'/PhysMem/ {print $10}\'';
- break;
- case 'linux':
- break;
- default:
- Plugin.logger.write(Plugin.constants.levels.WARNING, 'Unaccounted for system: ' + system);
- break;
- }
-
data = data.replace(/(\r\n|\n|\r)/gm, '');
data = data.replace('M', '');
return data;
View
3 submodules/constants.js
@@ -15,8 +15,9 @@ ConstantsManagerModule.prototype.strings.AWS_SECRET_ACCESS_KEY = 'AWS_SECRET_ACC
ConstantsManagerModule.prototype.strings.PLUGIN_DIRECTORY = '../plugins';
ConstantsManagerModule.prototype.strings.LIB_DIRECTORY = '../lib';
ConstantsManagerModule.prototype.strings.MODULE_DIRECTORY = '../modules';
+ConstantsManagerModule.prototype.strings.CONFIG_DIRECTORY = '../config';
ConstantsManagerModule.prototype.strings.SUBMODULE_DIRECTORY = '../submodules';
-ConstantsManagerModule.prototype.strings.MONITOR_CONFIG_FILE = '../config/monitor_config';
+ConstantsManagerModule.prototype.strings.MONITOR_CONFIG_FILE = 'monitor_config';
ConstantsManagerModule.prototype.strings.INSTANCE_ID = 'instance-id';
ConstantsManagerModule.prototype.strings.LOCAL_IPV4 = 'local-ipv4';
ConstantsManagerModule.prototype.strings.PUBLIC_HOSTNAME = 'public-hostname';
View
7 submodules/utilities.js
@@ -20,6 +20,13 @@ UtilitiesManagerModule.prototype.parseCommandLineOptions = function (callback) {
};
UtilitiesManagerModule.prototype.parseConfig = function (configFile, callback) {
+ /* Switch to config directory */
+ try {
+ process.chdir(Module.constants.strings.CONFIG_DIRECTORY);
+ } catch (Exception) {
+ Module.logger.write(Module.constants.levels.SEVERE, 'Error switching to config directory: ' + Exception);
+ }
+
fs.readFile(configFile, function (error, fd) {
if (error) {
console.log('Error reading master config file, exiting application');

0 comments on commit 8371d4a

Please sign in to comment.
Something went wrong with that request. Please try again.