Repository: vcl Updated Branches: refs/heads/develop d0150becc -> a087631ac
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 Project: http://git-wip-us.apache.org/repos/asf/vcl/repo Commit: http://git-wip-us.apache.org/repos/asf/vcl/commit/a087631a Tree: http://git-wip-us.apache.org/repos/asf/vcl/tree/a087631a Diff: http://git-wip-us.apache.org/repos/asf/vcl/diff/a087631a Branch: refs/heads/develop Commit: a087631acf134dc06788cb855137f3d172831668 Parents: d0150be Author: Josh Thompson <[email protected]> Authored: Wed Jun 6 15:48:10 2018 -0400 Committer: Josh Thompson <[email protected]> Committed: Wed Jun 6 15:48:10 2018 -0400 ---------------------------------------------------------------------- managementnode/bin/install_perl_libs.pl | 1 + managementnode/lib/VCL/utils.pm | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/vcl/blob/a087631a/managementnode/bin/install_perl_libs.pl ---------------------------------------------------------------------- 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 @@ my @PERL_MODULES = ( 'LWP::Protocol::https', 'Mail::Mailer', 'Mo::builder', + 'Net::Ping::External', 'Net::SSH::Expect', 'Object::InsideOut', 'RPC::XML', http://git-wip-us.apache.org/repos/asf/vcl/blob/a087631a/managementnode/lib/VCL/utils.pm ---------------------------------------------------------------------- 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 Time::Local; 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 @@ sub nmap_port { 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 @@ sub _pingnode { } } - 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");
