Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w system("nslookup domain domain"); #if returns on 5th line "Address: xxx.xxx.xxx.110" do nothing - if no +t send mail system("ping hostname"); # if this returns "alive" then do: my $ssh = Net::SSH::Perl->new("hostname"); $ssh->cmd("3dpipe virtual xx.xxx.xxx.110:443 disabled"); $ssh->cmd("3dpipe virtual xx.xxx.xxx.110:443 disabled"); $ssh->cmd("3dpipe virtual xx.xxx.xxx.110:443 enable"); $ssh->cmd("3dpipe virtual xx.xxx.xxx.110:443 enable"); $ssh->cmd("3dpipe wideip hostname pool pool_sde_primary virtual show a +ll"); $ssh->cmd("3dpipe wideip hostname pool pool_sde_primary virtual show a +ll");
Edit by BazB: obsure IP address missed by OP, retitle from "Net::SSH schtuff...."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Handling output from nslookup and ping.
by zakzebrowski (Curate) on May 04, 2004 at 22:11 UTC | |
by Fletch (Bishop) on May 05, 2004 at 01:41 UTC | |
by bigmacbear (Monk) on May 07, 2004 at 15:40 UTC | |
|
Re: Handling output from nslookup and ping.
by eXile (Priest) on May 04, 2004 at 23:46 UTC | |
|
Re: Handling output from nslookup and ping
by jbaribeault (Novice) on May 06, 2004 at 14:41 UTC | |
|
Re: Handling output from nslookup and ping
by bluto (Curate) on May 06, 2004 at 16:27 UTC |