feat(ping): add logging for ping requests and CLI command for debugging purposes
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 3m22s

This commit is contained in:
2026-02-10 22:39:38 +07:00
parent b6df4af920
commit 18e488a8e8
+17
View File
@@ -337,6 +337,23 @@ async function pingViaInterface(req, res) {
body.count = Number(count) > 0 ? Number(count) : 5;
if (ifaceName) body.interface = ifaceName;
// Логируем фактический запрос и CLI-эквивалент для отладки
try {
const cliParts = [
'/tool/ping',
`address=${body.address}`,
`count=${body.count}`,
];
if (ifaceName) cliParts.push(`interface=${ifaceName}`);
console.log('[mikrotik][pingViaInterface]', {
serverId,
gatewayIp,
body,
cli: cliParts.join(' '),
});
} catch (_) {}
const pingRes = await client.command('tool/ping', body);
const raw = pingRes?.data;
const rows = Array.isArray(raw) ? raw : raw ? [raw] : [];