![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Where are my sites hosted?
I have 5 public websites (2 different datacenters)
1. production datacenter 2. Backup datacenter. I have a global site selector which will load balance the site based on availability and load. I would like to have a script that can tell me exactly where my sites are in 2 columns. example.... www.site1.com 10.1.1.1 (public IPs of course) www.site2.com 172.16.0.0 (public IPs of course) Thanks in advance for your help. I'm using ubuntu 9.10 Last edited by kmaq7621; 12-01-2009 at 11:08 AM.. Reason: Removed automatic url tags. |
|
|||
|
|
|
|||
|
figured it out.
#!/bin/bash
# where_are_you.sh #do a dig against the public DNS servers and spit out the current IP of the sites. array=( www.site1.com www.site2.com www.site3.com ) for i in "${array[@]}" do dig @4.2.2.2 $i a | grep -v ';' |grep $i | awk '{print $5," "$1}' done |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Broker BGC Offers Hosted Co-Located CEP to Clients | Linux Bot | Complex Event Processing RSS News | 0 | 03-14-2009 06:40 PM |
| Part 2: Configure and Use ZFS-Hosted iSCSI Guest Storage Within the Sun xVM Hyperviso | Linux Bot | Solaris BigAdmin RSS | 0 | 09-17-2008 09:10 AM |
| to stop the website hosted in apache ux server | kishan | HP-UX | 1 | 04-09-2008 09:50 AM |
| Accessing a FTP Server hosted on Linux | Breen | IP Networking | 1 | 03-16-2005 05:35 AM |
| Writing a .NET service to be Hosted in UNIX | yeslekmc | High Level Programming | 0 | 05-21-2002 07:03 PM |