Skip to main content
Glama

ssh_alert_setup

Configure monitoring alerts for SSH servers by setting CPU, memory, and disk usage thresholds to detect performance issues.

Instructions

Configure health monitoring alerts and thresholds

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverYesServer name
actionYesAction: set thresholds, get config, or check current metrics against thresholds
cpuThresholdNoCPU usage threshold percentage (e.g., 80)
memoryThresholdNoMemory usage threshold percentage (e.g., 90)
diskThresholdNoDisk usage threshold percentage (e.g., 85)
enabledNoEnable or disable alerts (default: true)

Implementation Reference

  • The 'ssh_alert_setup' tool is listed in the monitoring tool group in the centralized TOOL_GROUPS registry, used for conditional registration and validation of MCP tools based on user configuration.
    monitoring: [ 'ssh_health_check', 'ssh_service_status', 'ssh_process_manager', 'ssh_monitor', 'ssh_tail', 'ssh_alert_setup' ],
  • Supporting utilities for alert setup including creating alert configurations with thresholds, commands to save/load alert config JSON on remote servers, and checking if current metrics exceed thresholds. These functions provide the core logic for implementing the ssh_alert_setup tool.
    */ export function createAlertConfig(thresholds) { const defaults = { cpu: 80, memory: 90, disk: 85, enabled: true }; return { ...defaults, ...thresholds, created_at: new Date().toISOString() }; } /** * Build command to save alert config */ export function buildSaveAlertConfigCommand(config, configPath = '/etc/ssh-manager-alerts.json') { const jsonData = JSON.stringify(config, null, 2); const escapedJson = jsonData.replace(/'/g, '\'\\\'\''); return `echo '${escapedJson}' > "${configPath}"`; } /** * Build command to load alert config */ export function buildLoadAlertConfigCommand(configPath = '/etc/ssh-manager-alerts.json') { return `cat "${configPath}" 2>/dev/null || echo '{}'`; } /** * Check if thresholds are exceeded */ export function checkAlertThresholds(metrics, thresholds) { const alerts = []; if (thresholds.cpu && metrics.cpu && metrics.cpu.percent > thresholds.cpu) { alerts.push({ type: 'cpu', severity: 'warning', message: `CPU usage (${metrics.cpu.percent}%) exceeds threshold (${thresholds.cpu}%)`, value: metrics.cpu.percent, threshold: thresholds.cpu }); } if (thresholds.memory && metrics.memory && metrics.memory.percent > thresholds.memory) { alerts.push({ type: 'memory', severity: 'warning', message: `Memory usage (${metrics.memory.percent}%) exceeds threshold (${thresholds.memory}%)`, value: metrics.memory.percent, threshold: thresholds.memory }); } if (thresholds.disk && metrics.disks) { for (const disk of metrics.disks) { if (disk.percent > thresholds.disk) { alerts.push({ type: 'disk', severity: 'warning', message: `Disk usage on ${disk.mount} (${disk.percent}%) exceeds threshold (${thresholds.disk}%)`, mount: disk.mount, value: disk.percent, threshold: thresholds.disk }); } } } return alerts; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bvisible/mcp-ssh-manager'

If you have feedback or need assistance with the MCP directory API, please join our Discord server