Skip to content

System Monitor Module

The System Monitor module provides real-time visibility into running processes, system activity, and potential malicious behavior. It is designed to help applications detect unusual patterns before they escalate into full threats.


Monitor Running Processes

Use the monitor.processes() method to retrieve a list of processes along with their risk levels.

JavaScript

const alerts = await shield.monitor.processes();
console.log(alerts);

Python

alerts = shield.monitor_processes()
print(alerts)

Example Output

{
  "alerts": [
    {
      "process": "unknown.exe",
      "pid": 4721,
      "risk": "high",
      "reason": "Untrusted binary with suspicious behavior",
      "timestamp": "2025-01-15T12:20:45Z"
    }
  ]
}

Field Descriptions

Field Description
process Name of the running application.
pid Process ID for identification.
risk Risk level: low, medium, or high.
reason Reason CyberShield flagged the process.
timestamp Time when the event was recorded.

Monitor System Health

Some SDK implementations provide system-level metrics:

JavaScript

const metrics = await shield.monitor.system();
console.log(metrics);

Python

metrics = shield.monitor_system()
print(metrics)

Sample System Metrics Output

{
  "cpuUsage": "72%",
  "memoryUsage": "65%",
  "networkActivity": "high",
  "suspiciousPorts": [445, 3389]
}

Error Handling

Monitoring may fail due to:

  • Missing system permissions
  • Unsupported operating system
  • Restricted execution environment
  • Monitoring blocked by antivirus or OS security settings

Example (JavaScript)

try {
  const alerts = await shield.monitor.processes();
} catch (err) {
  console.error("Monitoring failed:", err.message);
}

Next Step

For common issues and solutions, see the

Troubleshooting Guide