Skip to content

Info

License: Free - No license required. Available in all tiers.

Memory Probe

The Memory probe monitors system memory and swap usage across all major operating systems, providing comprehensive metrics for physical memory, cache, buffers, and page file utilization.

Quick Start

Basic Configuration

# probes.d/10-memory.yaml — each file under probes.d/ is a YAML array of probes
- name: memory
  type: memory
  params:
    interval: 30  # Collection interval in seconds (default: 30)

Minimal Configuration

# probes.d/10-memory.yaml
- name: memory
  type: memory
  params: {}

The Memory probe requires no mandatory parameters and works out-of-the-box with default settings.

Supported Platforms

  • Windows: Windows Server 2012+ / Windows 10+
  • Linux: All modern distributions (Ubuntu, RHEL, CentOS, Debian, etc.)
  • macOS: macOS 10.13+
  • BSD: FreeBSD, OpenBSD, NetBSD

Platform-specific metrics are automatically detected and collected based on the operating system.

Key Metrics Summary

Cross-Platform Metrics

Metric Description Available On
memory_total Total physical memory (bytes) All platforms
memory_available Available memory for applications (bytes) All platforms
memory_used_percent Memory usage percentage (0-100%) All platforms
swap_total Total swap space (bytes) All platforms
swap_used Used swap space (bytes) All platforms
swap_used_percent Swap usage percentage (0-100%) All platforms

Unix/Linux/macOS Specific

Metric Description
memory_used Actively used memory (bytes)
memory_free Completely unused memory (bytes)
memory_cached Page cache memory (bytes)
memory_buffers Kernel buffer memory (bytes)
swap_free Available swap space (bytes)

Windows Specific

Metric Description
memory_committed Committed (virtual) memory (bytes)
memory_modified_page_list Modified pages waiting to be written (bytes)
memory_nonpaged_pool Non-pageable kernel memory (bytes)
memory_paged_pool Pageable kernel memory (bytes)
memory_cache System cache memory (bytes)
memory_page_faults Page faults per second
memory_pages_input Pages read from disk per second
memory_pages_output Pages written to disk per second
pagefile_usage Page file usage percentage
pagefile_usage_peak Peak page file usage percentage

Configuration Parameters

Parameter Must set Default Description
interval No 30 Collection interval in seconds

Example Configurations

High-frequency monitoring (every 10 seconds):

# probes.d/10-memory.yaml
- name: memory
  type: memory
  params:
    interval: 10

Standard monitoring (every minute):

# probes.d/10-memory.yaml
- name: memory
  type: memory
  params:
    interval: 60

Monitoring Tool Integration

PRTG Network Monitor

Access memory metrics in PRTG JSON format:

# All memory metrics
curl http://localhost:8080/api/{agentkey}/prtg/metrics

# Configure PRTG HTTP Advanced Sensor:
# - URL: http://agent-host:8080/api/{agentkey}/prtg/metrics
# - Method: POST
# - Request body: {"probe": "memory"}

PRTG Channels Available: - Memory Available (bytes) - Memory Used (%) - Memory Total (bytes) - Swap Used (%) - Page Faults/sec (Windows) - Cache Memory (bytes)

Nagios

Access memory metrics in Nagios format:

# All memory metrics with performance data
curl http://localhost:8080/api/{agentkey}/nagios/metrics?probe=memory

# Example output:
# OK - Memory monitoring active | memory_used_percent=65.2%;80;90 swap_used_percent=12.5%;50;75

Nagios Performance Data: - memory_used_percent - Memory usage with 80% warning, 90% critical - swap_used_percent - Swap usage with 50% warning, 75% critical - memory_available - Available memory in bytes

Web Interface

View memory metrics in the built-in dashboard:

http://localhost:8080/web/{agentkey}/dashboard

Features: - Real-time memory usage visualization - Memory breakdown (used, cached, buffers, free) - Swap usage monitoring - Historical memory trends

Use Cases

Memory Leak Detection

Monitor memory usage over time to identify: - Gradual memory consumption increase - Applications not releasing memory - Kernel memory leaks - Cache growth patterns

Capacity Planning

Track memory trends to plan: - When to add more RAM - Application memory requirements - Virtual machine sizing - Container memory limits

Performance Optimization

Analyze memory usage to: - Identify memory-constrained applications - Optimize cache utilization - Reduce swap usage - Balance memory allocation

System Health Monitoring

Monitor memory health: - Available memory for applications - Swap activity (performance impact) - Page fault rates (Windows) - Memory pressure indicators

Troubleshooting

No Metrics Collected

Check probe status:

# View agent logs with memory probe debugging
senhub-agent run --filter probe.memory

Verify probe is enabled:

# Check configuration (multi-file layout)
grep -rA5 "name: memory" /etc/senhub-agent/probes.d/

Windows: PDH Counter Errors

Symptom: Error messages about Performance Data Helper (PDH) counters

Solution: 1. Verify Performance Counter service is running:

Get-Service | Where-Object {$_.Name -eq "PerfHost"}

  1. Rebuild Performance Counters:

    lodctr /R
    

  2. Check Windows Event Log for PDH errors

Unix/Linux: Permission Denied

Symptom: Cannot read /proc/meminfo or system files

Solution: Run the agent with appropriate permissions:

# Option 1: Run as root
sudo senhub-agent run

# Option 2: Grant capabilities (Linux)
sudo setcap cap_sys_admin=eip /opt/senhub/bin/senhub-agent

High Memory Usage from Agent

Symptom: Agent itself consuming significant memory

Solution: 1. Increase collection interval:

- name: memory
  type: memory
  params:
    interval: 60  # Collect every minute instead of 30 seconds

  1. Check for memory leaks in other probes

  2. Review system available memory

Missing Swap Metrics

Unix/Linux: Verify swap is configured:

# Check swap status
swapon --show

# View swap usage
free -h

Windows: Verify page file is configured:

# Check page file settings
Get-CimInstance -ClassName Win32_PageFileUsage

Performance Considerations

Collection Overhead

The Memory probe has minimal overhead: - Windows: ~5ms per collection (PDH counters) - Unix/Linux: ~20ms per collection (gopsutil library) - macOS: ~15ms per collection (system calls)

Memory Usage

Typical memory footprint per collection: - Base probe: ~200 KB - Metrics storage: ~10 KB per collection - Example: 30-second interval = ~500 KB total

Use Case Interval Reason
Real-time monitoring 10-15s Detect rapid memory changes
Standard monitoring 30-60s Balance accuracy and overhead
Long-term trending 120-300s Reduce storage and overhead

Advanced Configuration

Multi-Instance Monitoring

Monitor memory with different collection frequencies:

# probes.d/10-memory.yaml
- name: memory_realtime
  type: memory
  params:
    interval: 10

- name: memory_trending
  type: memory
  params:
    interval: 300

Note: This will create duplicate metrics. Use unique probe names for different collection intervals.

Integration with Other Probes

Correlate memory metrics with other system metrics:

# probes.d/00-host.yaml
- name: cpu
  type: cpu
  params:
    interval: 30

- name: memory
  type: memory
  params:
    interval: 30

- name: logicaldisk
  type: logicaldisk
  params:
    interval: 60

This provides comprehensive system monitoring with aligned collection intervals.

Authentication

The Memory probe requires no authentication as it collects local system metrics only.

Requirements

Windows

  • Windows Server 2012+ or Windows 10+
  • Performance Counter service enabled
  • No special permissions required (runs as service account)

Linux/Unix/macOS

  • Read access to /proc/meminfo (Linux)
  • Read access to /proc/vmstat (Linux)
  • System information APIs (macOS, BSD)

Network

  • No network access required (local metrics only)
  • HTTP strategy required for remote access to metrics

Metric reference

Every metric this probe can emit. Metric is the OpenTelemetry name the OTLP, Prometheus and Zabbix outputs derive theirs from. Name is what a Nagios check and the API metrics= filter match. PRTG channel is the label PRTG shows, placeholders filled from the series' tags.

Metric Name PRTG channel Unit Description
system.memory.limit memory_total Memory Total bytes Total physical memory installed on the system
system.memory.usage memory_available Memory Available bytes Amount of physical memory immediately available for allocation
system.memory.usage memory_committed Memory Committed bytes Amount of virtual memory that has been committed by the memory manager
system.memory.usage memory_modified_page_list Memory Modified Page List bytes Amount of memory whose contents have been modified but not yet written to disk
system.memory.usage memory_nonpaged_pool Memory Nonpaged Pool bytes Amount of kernel memory that cannot be paged out to disk
system.memory.usage memory_paged_pool Memory Paged Pool bytes Amount of kernel memory that can be paged out to disk
system.memory.usage memory_cache Memory Cache bytes Amount of physical memory used by the system file cache
system.memory.usage memory_used Memory Used bytes Amount of physical memory currently in use by the system and applications
system.memory.usage memory_free Memory Free bytes Amount of physical memory not being used at all
system.memory.usage memory_cached Memory Cached bytes Amount of physical memory used for caching file data and metadata
system.memory.usage memory_buffers Memory Buffers bytes Amount of physical memory used for kernel buffer cache
system.memory.utilization memory_used_percent Memory Usage % Percentage of total physical memory currently in use
senhub.system.paging.faults memory_page_faults Memory Page Faults # Rate of page faults per second including both hard and soft faults
senhub.system.paging.operations memory_pages_input Memory Pages Input # Rate of pages read from disk per second to resolve hard page faults
senhub.system.paging.operations memory_pages_output Memory Pages Output # Rate of pages written to disk per second to free physical memory
system.paging.utilization pagefile_usage Pagefile Usage % Percentage of the system pagefile currently in use
senhub.system.paging.utilization_peak pagefile_usage_peak Pagefile Usage Peak % Peak percentage of the system pagefile used since last reboot
senhub.system.paging.limit swap_total Swap Total bytes Total swap space configured on the system
system.paging.usage swap_used Swap Used bytes Amount of swap space currently in use
system.paging.usage swap_free Swap Free bytes Amount of swap space not in use
system.paging.utilization swap_used_percent Swap Usage % Percentage of total swap space currently in use