-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_specific_ip.js
More file actions
32 lines (24 loc) · 995 Bytes
/
test_specific_ip.js
File metadata and controls
32 lines (24 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const ping = require('ping');
async function testSpecificIP() {
console.log('Testing 10.13.37.13 with network-performance-monitor config...');
const target = '10.13.37.13';
// Use the exact same config as network-performance-monitor
const config = {
timeout: 5000 / 1000, // 5 seconds
extra: process.platform === 'win32' ? ["-n", "1"] : ["-c", "1"]
};
console.log('Config:', config);
console.log('Platform:', process.platform);
try {
const result = await ping.promise.probe(target, config);
console.log('Full result object:', result);
console.log('Processed result:');
console.log('- alive:', result.alive);
console.log('- time:', result.time);
console.log('- packetLoss:', result.packetLoss);
console.log('- output:', result.output);
} catch (error) {
console.log('Error:', error.message);
}
}
testSpecificIP().catch(console.error);