10 # Check if a Bacula client is alive. By Phil Stracchino.
13 # -1 Program error or no host specified
14 # 0 Success, FD found and responding
15 # 1 Client alive but FD not listening
16 # 2 Client not found on network
19 my ($host, $p, $ret, $verbose);
20 GetOptions('verbose' => \$verbose,
23 $host = shift || die "No host specified!\n";
25 $p = Net::Ping->new();
28 print "Host $host is alive\n" if ($verbose);
29 my $t = new Net::Telnet (Timeout => 10,
31 Prompt => '/bash\$ $/');
34 print "Bacula-FD listening on port 9102\n" if ($verbose);
39 print "Bacula-FD not found\n" if ($verbose);
46 print "$host is unreachable\n" if ($verbose);
51 print "Returning value $ret\n" if ($verbose);