Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Ping Monitoring

The simplest monitor is a ping script. One ping is usually enough for most cases. You can pass a timeout to ping, but Stylus will automatically kill processes if they run too long.

Basic Ping Script

#!/bin/bash
ping -c 1 ${STYLUS_MONITOR_ID}

Ping with Custom Host

#!/bin/bash
ping -c 1 8.8.8.8

Ping with Timeout

#!/bin/bash
ping -c 1 -W 5 ${STYLUS_MONITOR_ID}

When to Use Ping

Ping monitoring is ideal for:

  • Basic connectivity testing
  • Simple network reachability checks
  • Quick health checks for network devices
  • Testing internet connectivity

For more complex monitoring scenarios, consider using SSH, SNMP, or HTML/API scraping.