#!/usr/bin/perl # IP adress or hostname of the remote machine to test $remote = "192.168.0.2"; if(system("ping -c 1 $remote 1> /dev/null")) { print "$remote is down\n"; } else { print "$remote is up\n"; }