spm-agent-os
Advanced tools
Comparing version 1.30.8 to 1.30.9
@@ -85,3 +85,3 @@ /* | ||
cpuLastValues['cpu'] = {idle: 0, user: 0, system: 0, irq: 0, nice: 0, iowait: 0, softirq: 0, steal: 0, total: 0} | ||
linux.cpuStats(function (cpu) { | ||
@@ -119,5 +119,4 @@ if (!cpu || !cpu.cpu) { | ||
} | ||
}) | ||
}) | ||
linux.networkStats(function (data) { | ||
@@ -165,17 +164,38 @@ if (data) { | ||
} | ||
agent.addMetrics({ | ||
ts: time, | ||
type: 'os', | ||
name: 'osmem', | ||
filters: '', | ||
value: [ | ||
(vmstats.memory.used - (vmstats.memory.buffer + vmstats.memory.cache)) * 1024, | ||
vmstats.memory.free * 1024, | ||
vmstats.memory.cache * 1024, | ||
vmstats.memory.buffer * 1024, | ||
vmstat.swapd * 1024, | ||
vmstat.si, | ||
vmstat.so], | ||
sct: 'OS' | ||
}) | ||
var checkMemTotal = vmstats.memory.used + vmstats.memory.free + vmstats.memory.buffer + vmstats.memory.cache | ||
if (checkMemTotal <= vmstats.memory.total) { | ||
// should be equal on CentoOS 7.2 | ||
agent.addMetrics({ | ||
ts: time, | ||
type: 'os', | ||
name: 'osmem', | ||
filters: '', | ||
value: [ | ||
vmstats.memory.used * 1024, | ||
vmstats.memory.free * 1024, | ||
vmstats.memory.cache * 1024, | ||
vmstats.memory.buffer * 1024, | ||
vmstat.swapd * 1024, | ||
vmstat.si, | ||
vmstat.so], | ||
sct: 'OS' | ||
}) | ||
} else { | ||
agent.addMetrics({ | ||
ts: time, | ||
type: 'os', | ||
name: 'osmem', | ||
filters: '', | ||
value: [ | ||
(vmstats.memory.used - (vmstats.memory.buffer + vmstats.memory.cache)) * 1024, | ||
vmstats.memory.free * 1024, | ||
vmstats.memory.cache * 1024, | ||
vmstats.memory.buffer * 1024, | ||
vmstat.swapd * 1024, | ||
vmstat.si, | ||
vmstat.so], | ||
sct: 'OS' | ||
}) | ||
} | ||
if (vmstats.disks) { | ||
@@ -182,0 +202,0 @@ try { |
{ | ||
"name": "spm-agent-os", | ||
"version": "1.30.8", | ||
"version": "1.30.9", | ||
"description": "SPM Agent for monitoring operating system metrics", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
34969
607
3