Initial commit: Debian Manager — управление Debian-серверами
- SSH/SFTP управление без агентов - Пакеты (apt), Docker, файлы, systemd, ufw, cron - Плейбуки, групповые операции, планировщик - Бэкапы, отчёты, Portainer, Proxmox VE, Gitea Deploy - Терминал, Telegram-уведомления, тёмная/светлая тема
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import asyncio
|
||||
import asyncssh
|
||||
import sys
|
||||
sys.path.insert(0, r"C:/Users/dimir/proects/debian-manager")
|
||||
|
||||
async def main():
|
||||
from app.core.ssh import SSHClient
|
||||
from app.core.monitor import _METRICS_CMD
|
||||
from app.db.models import Server
|
||||
|
||||
srv = Server(id=1, name="t", host="132.243.17.164", port=2292,
|
||||
username="dimon", password="123456789987654321")
|
||||
async with SSHClient(srv) as c:
|
||||
r = await c.run(_METRICS_CMD, timeout=30)
|
||||
print("STDOUT:")
|
||||
print(r.stdout)
|
||||
if r.stderr:
|
||||
print("STDERR:", r.stderr[:500])
|
||||
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user