# Subroutine check_tr # # Check Traceroute to host sub check_tr { my ($server,$timeout)=@_; die("Insufficent Arguments passed to check_tr\n") unless (defined $timeout); my ($conn,$log); $log="Server $server - Traceroute - "; $conn=Net::Traceroute->new(host => $server,timeout => $timeout); if ($conn->found) { # Managed to trace my $hops = $conn->hops; $log.="Hops $hops\n"; } else { $log.="*** FAILED TO TRACE ***\n"; } return($log); }