Now the problem with this is that you need root privileges to use the icmp protocol - you could use udp or tcp instead but this is dependent on the echo service being available on the hosts being checked.#!/usr/bin/perl -w use Net::Ping; use strict; my @hosts = qw(www.gellyfish.com petunia.gellyfish.com); my $ping = Net::Ping->new('icmp'); foreach my $host ( @hosts ) { if ( $ping->ping($host) ) { print "$host OK\n"; } }
In reply to Re: shell execution question
by gellyfish
in thread shell execution question
by mojo_the_helper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |