### Running Vigil Server with Configuration Source: https://context7.com/valeriansaliou/vigil/llms.txt This section provides command-line examples for running the Vigil server. It demonstrates how to start Vigil using a configuration file, both directly and via Cargo for development builds. It also includes an example for running Vigil using Docker, mounting a configuration file and exposing the necessary port. ```bash # Run with configuration file ./vigil -c /path/to/config.cfg # Or via Cargo cargo run --release -- -c config.cfg # Via Docker docker run -p 8080:8080 \ -v /path/to/config.cfg:/etc/vigil.cfg \ valeriansaliou/vigil:v1.28.6 ``` -------------------------------- ### Install Vigil Package (Debian/Ubuntu) Source: https://github.com/valeriansaliou/vigil/blob/master/README.md Installs the Vigil package after the repository has been added. This command updates the package list and then installs the Vigil server, making it available for configuration and execution. ```bash apt-get install vigil ``` -------------------------------- ### Install Vigil Server via Cargo Source: https://github.com/valeriansaliou/vigil/blob/master/README.md Installs the Vigil server directly using Rust's Cargo package manager. This method requires Cargo to be installed and assumes your PATH environment variable is correctly configured to access the installed binaries. ```bash cargo install vigil-server ``` -------------------------------- ### Example Shell Script Probe Configuration Source: https://github.com/valeriansaliou/vigil/blob/master/README.md This example demonstrates how to configure a custom probe using a shell script in Vigil. The script's return code determines the replica's health status (0 for healthy, 1 for sick, 2+ for dead). Scripts are passed as literal strings enclosed in triple quotes. ```shell scripts = [ ''' # Do some work... exit 1 ''' ] ``` -------------------------------- ### Example Webhook Payload Structure Source: https://github.com/valeriansaliou/vigil/blob/master/README.md This is an example of a JSON-formatted payload that Vigil sends via Webhook upon any status change. It includes alert details and can also include reminders if configured. This payload can be used to integrate Vigil with custom notification systems. ```json { "type": "changed", "status": "dead", "time": "08:58:28 UTC+0200", "replicas": [ "web:core:tcp://edge-3.pool.net.crisp.chat:80" ], "page": { "title": "Crisp Status", "url": "https://status.crisp.chat/" } } ``` -------------------------------- ### Add Vigil APT Repository (Debian/Ubuntu) Source: https://github.com/valeriansaliou/vigil/blob/master/README.md This snippet adds the Vigil APT repository to your system's sources list, allowing you to install Vigil using apt-get. It requires curl and gpg to fetch and store the repository's GPG key for secure package verification. ```bash echo "deb [signed-by=/usr/share/keyrings/valeriansaliou_vigil.gpg] https://packagecloud.io/valeriansaliou/vigil/debian/ bookworm main" > /etc/apt/sources.list.d/valeriansaliou_vigil.list curl -fsSL https://packagecloud.io/valeriansaliou/vigil/gpgkey | gpg --dearmor -o /usr/share/keyrings/valeriansaliou_vigil.gpg apt-get update ``` -------------------------------- ### Compile Vigil from Source Source: https://github.com/valeriansaliou/vigil/blob/master/README.md Compiles the Vigil project from its source code using Cargo. This command builds a release version of Vigil, with the compiled binaries located in the `./target/release` directory. Ensure you have `libssl-dev` and optionally `libstrophe-dev` installed for SSL and XMPP support respectively. ```bash cargo build --release ``` -------------------------------- ### Get Report via MCP Source: https://context7.com/valeriansaliou/vigil/llms.txt Exposes an MCP endpoint for AI agents to query status reports when `mcp_server = true` is configured. ```APIDOC ## POST /mcp/probes ### Description When `mcp_server = true` is configured, Vigil exposes an MCP endpoint for AI agents to query status. This allows AI agents to use the `get_report` tool. ### Method POST ### Endpoint https://status.example.com/mcp/probes ### Parameters #### Headers - **Content-Type** (string) - Required - application/json #### Request Body - **jsonrpc** (string) - Required - Must be "2.0". - **method** (string) - Required - Must be "tools/call". - **params** (object) - Required - Parameters for the tool call. - **name** (string) - Required - The name of the tool, must be "get_report". - **arguments** (object) - Required - Arguments for the `get_report` tool (currently empty). - **id** (integer) - Required - The request ID. ### Request Example ```json { "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "get_report", "arguments": {} }, "id": 1 } ``` ### Response #### Success Response (200) - The response contains the same data as the `/status/report` endpoint. The MCP server also provides instructions for AI agents. #### Response Example ```json { "jsonrpc": "2.0", "result": { "message": "Vigil MCP Server. Use this server to get the status report of all Vigil Status Page services and nodes.", "data": { ... status report data ... } }, "id": 1 } ``` ``` -------------------------------- ### Get Alert Ignore Rules Source: https://context7.com/valeriansaliou/vigil/llms.txt Retrieves the current duration for silencing downtime reminders. Requires manager authentication. ```APIDOC ## GET /manager/prober/alerts/ignored ### Description Retrieves the current reminder ignore duration (for silencing alerts). ### Method GET ### Endpoint https://status.example.com/manager/prober/alerts/ignored ### Parameters #### Headers - **Authorization** (string) - Required - Basic authentication with manager token. ### Response #### Success Response (200) - **reminders_seconds** (integer or null) - The duration in seconds for which reminders are silenced. Returns `null` if no ignore is active. #### Response Example ```json { "reminders_seconds": 450 } ``` ``` -------------------------------- ### Get Full Status Report Source: https://context7.com/valeriansaliou/vigil/llms.txt Fetches a comprehensive JSON report detailing the health status of all probes, nodes, and replicas. This provides a granular view of the system's health, including specific component statuses. ```bash # Get detailed status report curl https://status.example.com/status/report # Response: { "health": "healthy", "page": { "name": "Crisp Status", "url": "https://status.crisp.chat/" }, "probes": [ { "name": "Web nodes", "status": "healthy", "nodes": [ { "name": "Core main router", "status": "healthy", "replicas": ["healthy", "healthy"] }, { "name": "Core main load balancer", "status": "healthy", "replicas": ["healthy", "healthy", "healthy"] } ] }, { "name": "Relay nodes", "status": "sick", "nodes": [ { "name": "Visitor realtime sockets", "status": "sick", "replicas": ["healthy", "sick"] } ] } ] } ``` -------------------------------- ### Get Report via MCP Source: https://context7.com/valeriansaliou/vigil/llms.txt Exposes an MCP endpoint for AI agents to query the status report. This is enabled when `mcp_server = true` is configured. ```bash # MCP endpoint is available at /mcp/probes # This allows AI agents to use the get_report tool # Example MCP tool call (JSON-RPC format): curl -X POST https://status.example.com/mcp/probes \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "get_report", "arguments": {} }, "id": 1 }' ``` -------------------------------- ### Get Status Badge Source: https://context7.com/valeriansaliou/vigil/llms.txt Generates an SVG badge image representing the current system status. This is ideal for embedding in README files or other documentation to visually indicate service availability. ```bash # Get color badge (shows status with color) curl https://status.example.com/badge/color -o status-badge.svg # Get icon badge (shows status with icon) curl https://status.example.com/badge/icon -o status-icon.svg # Embed in Markdown: #  ``` -------------------------------- ### List Published Announcements (HTTP GET) Source: https://github.com/valeriansaliou/vigil/blob/master/PROTOCOL.md Retrieves a list of all published announcements from the Vigil Manager API. Requires Basic authentication with a manager token. ```http HTTP GET https://status.example.com/manager/announcements/ ``` -------------------------------- ### Get Alert Ignore Rules via API Source: https://context7.com/valeriansaliou/vigil/llms.txt Retrieves the current duration for silencing downtime reminders. Requires a manager token for authorization. ```bash # Check current ignore rules curl https://status.example.com/manager/prober/alerts/ignored \ -H "Authorization: Basic $(echo -n ':YOUR_MANAGER_TOKEN' | base64)" ``` -------------------------------- ### Get Overall Status as Text Source: https://context7.com/valeriansaliou/vigil/llms.txt Retrieves the current overall health status of the system as a plain text string. This endpoint is useful for quick checks and integrations where only the high-level status is needed. ```bash # Get current status as plain text curl https://status.example.com/status/text # Response (plain text): healthy ``` -------------------------------- ### List Prober Alerts (HTTP GET) Source: https://github.com/valeriansaliou/vigil/blob/master/PROTOCOL.md Retrieves a list of prober alerts from the Vigil Manager API. Requires Basic authentication with a manager token. ```http HTTP GET https://status.example.com/manager/prober/alerts/ ``` -------------------------------- ### Resolve Prober Alert Ignore Rules (HTTP GET) Source: https://github.com/valeriansaliou/vigil/blob/master/PROTOCOL.md Retrieves the current ignore rules for prober alerts from the Vigil Manager API. Requires Basic authentication with a manager token. ```http HTTP GET https://status.example.com/manager/prober/alerts/ignored/ ``` -------------------------------- ### Script Probes Configuration Source: https://github.com/valeriansaliou/vigil/blob/master/README.md How to configure custom probes using shell scripts and the expected return codes for health status. ```APIDOC ## Script Probes Configuration ### Description Allows users to create custom monitoring probes by writing shell scripts. The script's exit code determines the health status of the monitored node. ### Method Configuration (not an HTTP endpoint) ### Endpoint N/A ### Parameters #### Configuration - **scripts** (array of strings) - A list of shell scripts to be executed for monitoring. - Scripts are passed as literal strings enclosed in `'''`. ### Script Return Codes - **`rc=0`**: `healthy` - **`rc=1`**: `sick` - **`rc=2` and higher**: `dead` ### Configuration Example ``` scripts = [ ''' # Do some work... exit 1 ''' ] ``` ### Notes - Scripts are executed in a system shell ran by a Vigil-owned sub-process. - It is recommended to run Vigil as a user with limited privileges to prevent security risks. ``` -------------------------------- ### Basic Server Configuration Source: https://context7.com/valeriansaliou/vigil/llms.txt TOML configuration for the Vigil server, including logging, network settings, worker count, MCP server enablement, and API tokens. ```toml # config.cfg [server] log_level = "error" # debug, info, warn, error inet = "[::1]:8080" # Listen address (IPv4/IPv6) workers = 4 # Number of HTTP workers mcp_server = false # Enable MCP server for AI agents manager_token = "secret123" # Token for Manager API reporter_token = "secret456" # Token for Reporter API [assets] path = "./res/assets/" # Path to static assets [branding] page_title = "Status Page" page_url = "https://status.example.com/" company_name = "My Company" icon_color = "#1972F5" icon_url = "https://example.com/icon.png" logo_color = "#1972F5" logo_url = "https://example.com/logo.svg" website_url = "https://example.com/" support_url = "mailto:support@example.com" ``` -------------------------------- ### Report Node Metrics via Reporter API Source: https://context7.com/valeriansaliou/vigil/llms.txt Reports CPU and RAM load from an application node for 'push' mode monitoring. Requires a reporter token for authorization and sends metrics in JSON format. Handles errors for invalid values, not found probes/nodes, or incorrect push mode configurations. ```bash # Report metrics from an application node curl -X POST https://status.example.com/reporter/web/api \ -H "Authorization: Basic $(echo -n ':YOUR_REPORTER_TOKEN' | base64)" \ -H "Content-Type: application/json; charset=utf-8" \ -d '{ "replica": "192.168.1.10", "interval": 30, "load": { "cpu": 0.45, "ram": 0.72 } }' # Response: 200 OK (empty body on success) # Error responses: # 400 Bad Request - Invalid load values # 404 Not Found - Probe/node not found # 412 Precondition Failed - Node is not in push mode ``` -------------------------------- ### Pull and Run Vigil Docker Image Source: https://github.com/valeriansaliou/vigil/blob/master/README.md Pulls a specific version of the Vigil Docker image from Docker Hub and runs it. This command maps port 8080 and mounts a local configuration file into the container. Ensure the configuration file has `server.inet` set to `0.0.0.0:8080` and `assets.path` set to `./res/assets/`. ```bash docker pull valeriansaliou/vigil:v1.28.6 docker run -p 8080:8080 -v /path/to/your/vigil/config.cfg:/etc/vigil.cfg valeriansaliou/vigil:v1.28.6 ``` -------------------------------- ### Create Announcement via API Source: https://context7.com/valeriansaliou/vigil/llms.txt Creates a new announcement on the status page. Requires a manager token for authorization and sends announcement details in JSON format. ```bash curl -X POST https://status.example.com/manager/announcement \ -H "Authorization: Basic $(echo -n ':YOUR_MANAGER_TOKEN' | base64)" \ -H "Content-Type: application/json; charset=utf-8" \ -d '{ "title": "Scheduled Maintenance", "text": "We will be performing scheduled maintenance on our database servers on Saturday, January 15th from 2:00 AM to 4:00 AM UTC. Some services may be temporarily unavailable during this time." }' ``` -------------------------------- ### Enabling ICMP Probes on Linux with setcap Source: https://context7.com/valeriansaliou/vigil/llms.txt This command uses `setcap` to grant the Vigil executable the necessary capabilities to create raw sockets on Linux. This is required for Vigil to perform ICMP probes, which are used for network-level reachability checks. Ensure the path to the Vigil binary is correct. ```bash # Allow Vigil to create raw sockets for ICMP probes setcap 'cap_net_raw+ep' /bin/vigil ``` -------------------------------- ### Create Announcement Source: https://context7.com/valeriansaliou/vigil/llms.txt Creates a new announcement to be displayed on the status page. Requires manager authentication. ```APIDOC ## POST /manager/announcement ### Description Creates a new announcement to be displayed on the status page. ### Method POST ### Endpoint https://status.example.com/manager/announcement ### Parameters #### Headers - **Authorization** (string) - Required - Basic authentication with manager token. - **Content-Type** (string) - Required - application/json; charset=utf-8 #### Request Body - **title** (string) - Required - The title of the announcement. - **text** (string) - Required - The main content of the announcement. ### Request Example ```json { "title": "Scheduled Maintenance", "text": "We will be performing scheduled maintenance on our database servers on Saturday, January 15th from 2:00 AM to 4:00 AM UTC. Some services may be temporarily unavailable during this time." } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the created announcement. #### Response Example ```json { "id": "550e8400-e29b-41d4-a716-446655440000" } ``` ``` -------------------------------- ### Probe Configuration Source: https://context7.com/valeriansaliou/vigil/llms.txt TOML configuration for defining services, nodes, and probes, supporting both poll (HTTP, TCP, SSH, ICMP) and push modes. ```toml # HTTP/TCP/SSH/ICMP Poll Mode [probe] [[probe.service]] id = "web" label = "Web Services" [[probe.service.node]] id = "api" label = "API Servers" mode = "poll" replicas = [ "https://api.example.com/health", "https://api2.example.com/health" ] http_body_healthy_match = "\"status\":\"ok\"" # Optional: regex to match response body [[probe.service.node]] id = "router" label = "Network Router" mode = "poll" replicas = [ "icmp://router.example.com", "tcp://router.example.com:80", "ssh://router.example.com:22" ] # Push Mode (for Vigil Reporter) [[probe.service]] id = "apps" label = "Application Servers" [[probe.service.node]] id = "backend" label = "Backend Services" mode = "push" reveal_replica_name = true # Show replica IPs on status page ``` -------------------------------- ### Vigil Notification Configuration Source: https://context7.com/valeriansaliou/vigil/llms.txt This TOML configuration block details various notification settings for Vigil. It includes options for startup notifications, reminder intervals and backoff functions, and specific configurations for Slack, email, Telegram, and webhook notifiers. This allows users to customize how and where alerts are sent. ```toml [notify] startup_notification = true reminder_interval = 300 # Seconds between reminder notifications reminder_backoff_function = "linear" # none, linear, square, cubic reminder_backoff_limit = 3 [notify.slack] hook_url = "https://hooks.slack.com/services/xxx/yyy/zzz" mention_channel = true reminders_only = false [notify.email] from = "status@example.com" to = "alerts@example.com" smtp_host = "smtp.example.com" smtp_port = 587 smtp_username = "user" smtp_password = "pass" smtp_encrypt = true [notify.telegram] bot_token = "123456:ABC-DEF" chat_id = "-1001234567890" [notify.webhook] hook_url = "https://example.com/webhook/vigil" # Webhook payload format: # { # "type": "changed", # "changed" or "reminder" # "status": "dead", # "healthy", "sick", or "dead" # "time": "08:58:28 UTC+0200", # "replicas": ["web:api:https://api.example.com/health"], # "page": {"title": "Status Page", "url": "https://status.example.com/"} # } ``` -------------------------------- ### List Prober Alerts via API Source: https://context7.com/valeriansaliou/vigil/llms.txt Retrieves all current alerts, including sick and dead replicas, from the prober system. Requires a manager token for authorization. ```bash # Get all active alerts curl https://status.example.com/manager/prober/alerts \ -H "Authorization: Basic $(echo -n ':YOUR_MANAGER_TOKEN' | base64)" ``` -------------------------------- ### Vigil Metrics Tuning Configuration Source: https://context7.com/valeriansaliou/vigil/llms.txt This TOML configuration block specifies parameters for tuning Vigil's metrics collection and polling. It covers intervals, retries, HTTP status codes for health, delays for dead/sick states, and parallelism for polling and script execution. These settings allow for fine-tuning performance and responsiveness. ```toml [metrics] poll_interval = 120 # Seconds between poll checks poll_retry = 2 # Retries for failed polls poll_retry_wait = 500 # Milliseconds between retries poll_http_status_healthy_above = 200 poll_http_status_healthy_below = 400 poll_delay_dead = 10 # Seconds response time = dead poll_delay_sick = 5 # Seconds response time = sick poll_parallelism = 4 # Concurrent poll threads push_delay_dead = 20 # Seconds without report = dead push_system_cpu_sick_above = 0.90 push_system_ram_sick_above = 0.90 script_interval = 300 # Seconds between script runs script_parallelism = 2 # Concurrent script threads local_delay_dead = 40 # Seconds without local report = dead ``` -------------------------------- ### List Prober Alerts Source: https://context7.com/valeriansaliou/vigil/llms.txt Retrieves all current alerts, including sick and dead replicas, from the prober system. Requires manager authentication. ```APIDOC ## GET /manager/prober/alerts ### Description Retrieves all current alerts (sick and dead replicas). ### Method GET ### Endpoint https://status.example.com/manager/prober/alerts ### Parameters #### Headers - **Authorization** (string) - Required - Basic authentication with manager token. ### Response #### Success Response (200) - **dead** (array of objects) - List of dead replicas. Each object contains: - **probe** (string) - The probe identifier. - **node** (string) - The node identifier. - **replica** (string) - The replica URL or address. - **sick** (array of objects) - List of sick replicas. Each object contains: - **probe** (string) - The probe identifier. - **node** (string) - The node identifier. - **replica** (string) - The replica URL or address. #### Response Example ```json { "dead": [ { "probe": "web", "node": "api", "replica": "https://api.example.com/health" } ], "sick": [ { "probe": "relay", "node": "socket-client", "replica": "192.168.1.50" } ] } ``` ``` -------------------------------- ### List Announcements via Manager API Source: https://context7.com/valeriansaliou/vigil/llms.txt Retrieves a list of all published announcements currently displayed on the status page. Requires a manager token for authorization and returns an array of announcement objects, each with an ID and title. ```bash # List all announcements curl https://status.example.com/manager/announcements \ -H "Authorization: Basic $(echo -n ':YOUR_MANAGER_TOKEN' | base64)" # Response: [ { "id": "550e8400-e29b-41d4-a716-446655440000", "title": "Scheduled Maintenance" }, { "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "title": "Database Migration in Progress" } ] ``` -------------------------------- ### Insert New Announcement (HTTP POST) Source: https://github.com/valeriansaliou/vigil/blob/master/PROTOCOL.md Inserts a new announcement into the Vigil Manager API. Requires Basic authentication with a manager token and sends announcement title and text as JSON. ```json { "title": "