Skip to content

Commit

Permalink
Adding until empty check for df.h, system log
Browse files Browse the repository at this point in the history
  • Loading branch information
hackerappliances committed Jan 2, 2012
1 parent 7d1c149 commit b225dfd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/df.js
Expand Up @@ -38,7 +38,8 @@ this.poll = function (constants, utilities, logger, callback) {
for (var i = 0; i < splitBuffer.length; i++) {
var disk = splitBuffer[i];
self.logger.write(self.constants.levels.INFO, 'Disk to check: ' + disk);
if (disk != '' && disk != 'none' && disk != 'undefined') disks.push(disk);
if (!utilities.isEmpty(disk))
disks.push(disk);

}

Expand All @@ -47,7 +48,10 @@ this.poll = function (constants, utilities, logger, callback) {
var exec = require('child_process').exec,
child;
child = exec(Plugin.command, function (error, stdout, stderr) {
callback(Plugin.name, 'DiskSpace', 'Percent', stdout.toString().replace('%', ''), Plugin.format(diskToCheck, stdout.toString()));
/* Misconfigured disk */
if (!utilities.isEmpty(stdout.toString().replace('%', '')))
callback(Plugin.name, 'DiskSpace', 'Percent', stdout.toString().replace('%', ''), Plugin.format(diskToCheck, stdout.toString()));

});
});
});
Expand Down
1 change: 1 addition & 0 deletions run/client.js
Expand Up @@ -72,5 +72,6 @@ nodeMonitor.init(function () { /* Debug */
for (var i in nodeMonitor.constants.globals) {
console.log('Global parameter: ' + i + ', with value: ' + nodeMonitor.constants.globals[i]);
}
console.log('Running on platform: ' + process.platform.toString());
nodeMonitor.plugins.start();
});

0 comments on commit b225dfd

Please sign in to comment.