From: Martin Mares Date: Mon, 31 Oct 2011 10:42:46 +0000 (+0100) Subject: Pings are optional X-Git-Tag: v3.0~54 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=578ff1f40c4eb4cfaa367972bf627e56bfcbb702;p=bex.git Pings are optional --- diff --git a/TODO b/TODO index b1b2a01..7b7081e 100644 --- a/TODO +++ b/TODO @@ -6,8 +6,7 @@ - bprun --curses - Locking - rsync, rsync-only -- Rename machine -> host +- Terminology: machine vs. host - ssh options - Detector of orphans (unused queue dirs, jobs on non-existent machines, non-queued jobs) - job failed => give a more explanatory message -- configurable ping diff --git a/brun b/brun index b22d5b6..449f8a1 100755 --- a/brun +++ b/brun @@ -44,6 +44,7 @@ sub update_status($$$$;$) { sub ping_machine($) { my ($mach) = @_; + return 1 unless $BEX::Config::ping_hosts; update_status($mach, '-', 'PING', undef); my $host = BEX::Config::host_name($mach); `ping -c1 -n $host >/dev/null 2>/dev/null`; diff --git a/lib/BEX/Config.pm b/lib/BEX/Config.pm index 90c5700..4526fae 100644 --- a/lib/BEX/Config.pm +++ b/lib/BEX/Config.pm @@ -25,6 +25,9 @@ our $job_epilog = 'epilog'; # Keep history of successfully completed jobs our $keep_history = 1; +# Before we try to connect to a host, ping it to check if it's alive +our $ping_hosts = 1; + # Various utility functions sub parse_machine_list(@);