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
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 3m22s
This commit is contained in:
@@ -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] : [];
|
||||
|
||||
Reference in New Issue
Block a user