VCL-1089 - Change ping module to use Net::Ping::External
-applied patch submitted by Mike Jennings that changes utils.pm
_pingnode function to use Net::Ping::External rather than Net::Ping so
that vcld doesn't require root level rights
-moved "use Net::Ping::External qw(ping);" line to top of file with other
calls to "use"
-updated description of _pingnode function
diff --git a/managementnode/bin/install_perl_libs.pl b/managementnode/bin/install_perl_libs.pl
index 812b957..a61042d 100755
--- a/managementnode/bin/install_perl_libs.pl
+++ b/managementnode/bin/install_perl_libs.pl
@@ -85,6 +85,7 @@
'LWP::Protocol::https',
'Mail::Mailer',
'Mo::builder',
+ 'Net::Ping::External',
'Net::SSH::Expect',
'Object::InsideOut',
'RPC::XML',
diff --git a/managementnode/lib/VCL/utils.pm b/managementnode/lib/VCL/utils.pm
index 0e9a4ea..c704fe4 100644
--- a/managementnode/lib/VCL/utils.pm
+++ b/managementnode/lib/VCL/utils.pm
@@ -58,7 +58,7 @@
use DBI;
use DBI::Const::GetInfoType;
use diagnostics;
-use Net::Ping;
+use Net::Ping::External qw(ping);
use Fcntl qw(:DEFAULT :flock);
use FindBin;
use Getopt::Long;
@@ -2131,8 +2131,8 @@
Parameters : $node
Returns : boolean
- Description : Uses Net::Ping to check if a node is responding to ICMP echo
- ping.
+ Description : Uses Net::Ping::External to check if a node is responding to ICMP
+ echo ping.
=cut
@@ -2156,9 +2156,7 @@
}
}
- my $p = Net::Ping->new("icmp");
- my $result = $p->ping($remote_connection_target, 1);
- $p->close();
+ my $result = ping(host => $remote_connection_target, timeout => 1);
if ($result) {
#notify($ERRORS{'DEBUG'}, 0, "$node_string is responding to ping");