Skip to main content
Glama

get_fail2ban_status

Check Fail2Ban service status to monitor intrusion prevention across all jails or specific ones like sshd for server security management.

Instructions

Récupère les informations du service Fail2Ban, pour toutes les jails ou une jail spécifique.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aliasYesAlias du serveur cible.
jailNoNom d'une jail spécifique à inspecter (ex: sshd). Laissez vide pour un statut général.

Implementation Reference

  • The handler function executes the tool by queuing an SSH command to run 'sudo fail2ban-client status' on the specified server alias, optionally for a specific jail, waits for completion, and returns the raw output or a structured error.
    async (params) => { try { const cmd = `sudo fail2ban-client status ${params.jail || ''}`.trim(); const job = queue.addJob({ type: 'ssh', alias: params.alias, cmd: cmd }); ssh.executeCommand(job.id); const result = await waitForJobCompletion(job.id, config.syncTimeout); if (!result || result.status !== 'completed') { throw new Error(result ? result.error : `Timeout de la commande de monitoring pour ${params.alias}`); } // Pour cette version, nous retournons la sortie brute. return { content: [{ type: "text", text: result.output }] }; } catch (e) { const errorPayload = { toolName: "get_fail2ban_status", errorCode: "MONITORING_ERROR", errorMessage: e.message }; return { content: [{ type: "text", text: JSON.stringify(errorPayload, null, 2) }], isError: true }; } } );
  • The tool metadata including title, description, and Zod input schema defining 'alias' (required) and 'jail' (optional).
    { title: "Obtenir le statut de Fail2Ban", description: "Récupère les informations du service Fail2Ban, pour toutes les jails ou une jail spécifique.", inputSchema: z.object({ alias: z.string().describe("Alias du serveur cible."), jail: z.string().optional().describe("Nom d'une jail spécifique à inspecter (ex: sshd). Laissez vide pour un statut général.") }) },
  • server.js:341-342 (registration)
    The MCP server tool registration call for 'get_fail2ban_status', passing schema and handler.
    server.registerTool( "get_fail2ban_status",

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/fkom13/mcp-sftp-orchestrator'

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