+sub runPing()
+{
+ # This command generates ping output by pinging the host specified in the
+ # ping command still within @ARGV. However, if the host listed therein is
+ # a VE, the HN must be pinged instead.
+
+ # Get the host
+ my $host = shift(@ARGV);
+ my $cmd = join(' ', @ARGV);
+
+ # Find $host in the list of VEs
+ loadVeList();
+ my $hostname = gethostbyaddr(gethostbyname($host), AF_INET);
+ mydie "Host $host not found" if (!defined($hostname));
+ my $ve = getVeEntry('hostname', $hostname);
+ if (defined($ve)) {
+ $hostname = $ve->{'HN'};
+ mydie "HN is undefined for host $host" if (!defined($hostname));
+ $cmd =~ s/$host/$hostname/g;
+ print $dbgf ": ping request for $host remapped to HN $hostname\n";
+ }
+
+ cmdExecOrEval($cmd);
+}
+