The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 01-26-2008
za_7565 za_7565 is offline
Registered User
  
 

Join Date: Nov 2007
Location: ON, Canada
Posts: 16
ping hosts from config file

Hello,

I have config files for my storage where file systems are exported to lots of hosts as root.

I need to write a script in ksh to somehow filter these hosts from the file and ping those and if pingable than do nothing but if not pingable than send an alert to a log file which says:

host xyz not pingable:

file looks like as follows:

/vol/vol1/apps_data01 -sec=sys,rw,root=unixsrv1:unixsrv2:unixsrv3:mercury:mercury01:sunprd01:sunprd02
/vol/vol1/apps_data02 -sec=sys,rw,root=unixsrv1:unixsrv2:unixsrv3:mercury:mercury01:sunprd01:sunprd02
/vol/vol1/apps_data03 -sec=sys,rw,root=unixsrv1:unixsrv2:unixsrv3:mercury:mercury01:sunprd01:sunprd02
/vol/vol1/apps_data04 -sec=sys,rw,root=unixsrv1:unixsrv2:unixsrv3:mercury:mercury01:sunprd01:sunprd02
.
.
/vol/vol1/apps_data45 -sec=sys,rw,root=unixsrv1:unixsrv2:unixsrv3:mercury:mercury01:sunprd01:sunprd02:hpprod07:ibmprod43


I have about 26 of these files on each storage host where hosts names are same and different:

I do not how to capture host names from the file and complete this logic.

Appreciate your help on this.