Add Asterisk configuration and diagnostics support

- Updated .env.example to include Asterisk templates path.
- Modified docker-compose.yml to mount the templates directory.
- Enhanced backend Dockerfile to copy templates into the container.
- Introduced Asterisk diagnostics functionality in asterisk_profiles.py, allowing for baseline checks and diagnostics reporting.
- Integrated Asterisk diagnostics into the device diagnostics workflow in graph.py.
- Added formatting for Asterisk baseline drift reports in diagnostic_format.py.
- Updated SKILL.md to document new config baseline drift feature for Asterisk.

This commit enhances the system's capabilities for managing Asterisk configurations and diagnostics, improving overall troubleshooting processes.
This commit is contained in:
2026-06-15 07:49:10 +03:00
parent 0375b20bb4
commit 9fc35e86fe
13 changed files with 773 additions and 4 deletions

View File

@@ -17,7 +17,11 @@ from app.agent.json_utils import parse_json as _parse_json
from app.agent.playbooks import playbook_for
from app.agent.pfsense_profiles import run_pfsense_diagnostics
from app.agent.proxmox_profiles import enrich_proxmox_device, run_proxmox_diagnostics
from app.agent.asterisk_profiles import asterisk_container_name
from app.agent.asterisk_profiles import (
ASTERISK_CATALOG_KEYS,
asterisk_container_name,
run_asterisk_diagnostics,
)
from app.agent.tool_runner import invoke_connect, invoke_tool
from app.core.crypto import decrypt_secret
from app.config import settings
@@ -249,6 +253,7 @@ async def _run_device_diagnostics(
*,
title: str = "",
issue: str = "",
vessel_context: dict | None = None,
) -> list[dict]:
"""Connect to one onboard device and run read-only playbook diagnostics."""
from app.models.enums import DeviceType as DT
@@ -279,6 +284,18 @@ async def _run_device_diagnostics(
max_diagnostics=8,
)
if device.get("catalog_key") in ASTERISK_CATALOG_KEYS or dtype == DT.asterisk:
return await run_asterisk_diagnostics(
task_id,
device,
manager,
_emit,
title=title,
issue=issue,
vessel_context=vessel_context,
max_diagnostics=MAX_DIAGNOSTICS_PER_DEVICE,
)
pb = playbook_for(dtype, device.get("mcp_server"), device.get("catalog_key"))
if not pb:
@@ -395,6 +412,10 @@ async def diagnose_node(state: AgentState) -> AgentState:
manager,
title=state.get("title") or "",
issue=state.get("issue") or "",
vessel_context={
"vessel_name": state.get("vessel_name"),
"vessel_public_ip": state.get("vessel_public_ip"),
},
)
)
return {"diagnostics": diagnostics}