Skip to main content

Ping

Pings a host and returns latency and packet loss statistics. This node is essential for network diagnostics, monitoring server reachability, measuring network performance, and detecting connectivity issues.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Input

  • Host - Host (domain or IP address) to ping. The host will be automatically cleaned (protocol, path, and port will be stripped).

Options

  • Count - Number of ping packets to send (default: 4)
  • Timeout - Timeout in seconds for entire ping operation (default: 60 seconds)
  • Interval - Interval between pings in milliseconds (default: 1000ms)

Output

  • Result - Ping result object containing:
    • reachable (boolean) - Whether the host is reachable
    • minLatency (number) - Minimum round-trip time in milliseconds
    • avgLatency (number) - Average round-trip time in milliseconds
    • maxLatency (number) - Maximum round-trip time in milliseconds
    • packetLoss (number) - Percentage of packets lost (0-100)
    • packetsSent (number) - Total number of packets sent
    • packetsRecv (number) - Total number of packets received

How It Works

The Ping node sends ICMP echo requests to a host and measures response times. When executed, the node:

  1. Cleans the input host by removing protocol (http://, https://), path, and port
  2. Creates a pinger with specified count, timeout, and interval
  3. Sends ping packets using unprivileged mode (UDP)
  4. Collects statistics on response times and packet delivery
  5. Returns comprehensive network performance metrics
  6. If host is unreachable, returns reachable=false with 100% packet loss

Example Use Cases

Monitor Server Availability

Check if a server is responding to network requests:

// Input
Host: "api.example.com"
Count: 4
Timeout: 60
Interval: 1000

// Output - Server is reachable
{
"reachable": true,
"minLatency": 12.5,
"avgLatency": 15.3,
"maxLatency": 18.7,
"packetLoss": 0,
"packetsSent": 4,
"packetsRecv": 4
}

Detect Network Issues

Identify network instability through packet loss:

// Input
Host: "unstable-server.com"
Count: 10
Interval: 1000

// Output - Unstable connection
{
"reachable": true,
"minLatency": 25.0,
"avgLatency": 125.5,
"maxLatency": 450.2,
"packetLoss": 30.0, // 30% packet loss indicates issues
"packetsSent": 10,
"packetsRecv": 7
}

Measure Network Performance

Monitor latency for performance optimization:

// Input
Host: "cdn.example.com"
Count: 20
Interval: 500

// Output - Low latency, good performance
{
"reachable": true,
"minLatency": 5.2,
"avgLatency": 7.8,
"maxLatency": 12.1,
"packetLoss": 0,
"packetsSent": 20,
"packetsRecv": 20
}

Check Geographic Server Response

Test servers in different regions:

// Ping multiple servers to find best performance
// US Server
Host: "us-server.example.com"

// EU Server
Host: "eu-server.example.com"

// Asia Server
Host: "asia-server.example.com"

// Compare avgLatency to select optimal server

Detect Offline Hosts

Identify when a host becomes unreachable:

// Input
Host: "offline-server.com"
Count: 4

// Output - Host is down
{
"reachable": false,
"minLatency": 0,
"avgLatency": 0,
"maxLatency": 0,
"packetLoss": 100,
"packetsSent": 0,
"packetsRecv": 0
}

Network Baseline Monitoring

Establish baseline performance metrics:

// Run every hour for 24 hours
// Track avgLatency over time
// Alert when avgLatency exceeds baseline by 50%
// Identify patterns (peak hours, degradation)

Tips for Effective Use

  • Count Selection - Use 4-10 pings for quick checks, 20-50 for detailed analysis
  • Interval Tuning - Default 1000ms works for most cases; reduce for faster testing, increase to avoid rate limiting
  • Timeout Setting - Set timeout higher than (count * interval) to avoid premature termination
  • Packet Loss Thresholds:
    • 0% - Excellent connection
    • 1-5% - Acceptable, minor issues
    • 5-10% - Poor connection, investigate
    • over 10% - Severe issues, action required
  • Latency Interpretation:
    • less than 10ms - Excellent (local network)
    • 10-50ms - Good (same region)
    • 50-100ms - Acceptable (different region)
    • over 100ms - High latency, user impact
  • Clean Host Input - The node strips protocols and paths, but providing clean hostnames is more efficient
  • Use IP Addresses - For faster pings, use IP addresses to avoid DNS lookup time
  • Regular Monitoring - Schedule pings regularly to detect patterns and trends

Common Errors and Solutions

Error: "Host cannot be empty"

Cause: The Host input is missing or empty.

Solution: Ensure the Host input variable contains a valid hostname or IP address.

Reachable: false with all zeros

Cause: The host is not responding to ping requests.

Solution:

  • Verify the hostname or IP address is correct
  • Check if the host is online and accessible
  • Confirm firewall settings allow ICMP packets
  • Try pinging from another machine to verify
  • Check if host blocks ICMP (some servers disable ping)
  • Verify network connectivity

High Packet Loss (over 10%)

Cause: Network congestion, router issues, or unstable connection.

Solution:

  • Increase Timeout to allow more time for responses
  • Check network equipment (routers, switches)
  • Test from different network locations
  • Contact network administrator
  • Verify bandwidth availability

Timeout Exceeded

Cause: Ping operation took longer than the specified timeout.

Solution:

  • Increase the Timeout value
  • Reduce the Count to send fewer packets
  • Increase the Interval to space out packets more
  • Formula: Timeout should be > (Count * Interval / 1000) + buffer

All Packets Lost but Reachable: true

Cause: Packets were sent but none were received, yet some response was detected.

Solution:

  • This indicates severe network issues
  • Check intermediate network devices
  • Verify routing tables
  • Contact network support

Integration Examples

Multi-Host Health Dashboard

// Create array of critical servers
const servers = [
"web-01.example.com",
"web-02.example.com",
"db-01.example.com",
"cache-01.example.com"
];

// Ping each server
// Store results in data table
// Flag servers with:
// - reachable: false
// - packetLoss > 10%
// - avgLatency > 100ms
// Generate health report

Automatic Failover Detection

// Ping primary server
// If not reachable or high packet loss:
// - Switch to backup server
// - Send alert to administrators
// - Log incident
// Continue with backup until primary recovers

Network Performance SLA Monitoring

// Ping target every 5 minutes
// Track metrics:
// - Uptime percentage (reachable true/false)
// - Average latency over 24 hours
// - Packet loss percentage
// Alert if SLA thresholds breached:
// - Uptime < 99.9%
// - Avg latency > 50ms
// - Packet loss > 1%

Before/After Deployment Testing

// Before deployment:
// Ping servers, record baseline metrics

// After deployment:
// Ping servers again
// Compare latency and packet loss
// Rollback if performance degraded

Geographic Load Balancer Optimization

// For user in location X:
// Ping all available servers
// Select server with:
// 1. reachable: true
// 2. Lowest avgLatency
// 3. packetLoss < 5%
// Route user to optimal server

Network Troubleshooting Workflow

// 1. Ping external host (e.g., 8.8.8.8)
// - Tests internet connectivity
// 2. Ping gateway/router
// - Tests local network
// 3. Ping internal server
// - Tests internal infrastructure
// 4. Compare results to isolate issue

Continuous Availability Monitoring

// Every minute:
// Ping critical service
// If reachable: false for 3 consecutive checks:
// - Send urgent alert
// - Create incident ticket
// - Trigger failover process
// Log all ping results for historical analysis