Comparing version 1.7.3 to 1.8.0
@@ -13,2 +13,5 @@ 'use strict'; | ||
exports.run = function (callback) { | ||
// '/dev/sda6 14674404 13161932 744012 95% /' | ||
// '/dev/sda3 80448976 67999076 8340248 90% /home/admin/' | ||
helper.execFile(command, function (err, stdout) { | ||
@@ -18,20 +21,23 @@ if (err) { | ||
} | ||
var metric = {}; | ||
var results = stdout.trim(); | ||
var lines = results.split('\n'); | ||
var root = lines.filter(function (line) { | ||
return line.match(/\/$/ig); | ||
}).join(''); | ||
lines.forEach(function(line) { | ||
if (line.match(/^\//)) { | ||
var match = line.match(/(\d+)%\s+(\/.*$)/); | ||
if (match) { | ||
metric[match[2]] = parseInt(match[1] || 0); | ||
} | ||
} | ||
}); | ||
// '/dev/disk1 487849760 454136600 33201160 94% /' | ||
metric['used_percent'] = metric['/'] || 0; | ||
var percent = root.match(/(\d+)%/); | ||
callback(null, { | ||
type: 'disk_usage', | ||
metrics: { | ||
'used_percent': parseInt(percent && percent[1]) || 0 | ||
} | ||
metrics: metric | ||
}); | ||
}); | ||
}; | ||
exports.reportInterval = 5 * 60 * 1000; // 5 minutes |
{ | ||
"name": "agentx", | ||
"version": "1.7.3", | ||
"version": "1.8.0", | ||
"description": "agentx is powered by alinode", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
36203
1199
1