01-26-2008
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.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi!
Im trying to use host.allow & host.deny to resrtic access to my sun machine, but it doesnt seem to work... I want to allow full access from certain IPīs (ssh,http,ftp,etc...) but deny all kind of conections from outsideworld, the way that im doing that is:
hosts.allow
ALL:127.0.0.1... (2 Replies)
Discussion started by: Sorrento
2 Replies
2. UNIX for Dummies Questions & Answers
Hi All,
I am to the UNIX world and want to know if I can specify a range of IP addresses instead of having to include one by one on the HOSTS file.
Can I just say
127.20.1.1 to 127.20.1.156 ?
Or the only way is to put one by one along with the machine name next to the IP ?
THANKS (4 Replies)
Discussion started by: cymerman
4 Replies
3. Shell Programming and Scripting
Hi,
I want to use a config file as the base file and parse over the values of country and city parameters in the config file and generate separate config files as explained below.
I will be using the config file as mentioned below:
(config.txt)
country:a,b
city:1,2
type:b1... (1 Reply)
Discussion started by: clazzic
1 Replies
4. Shell Programming and Scripting
Hi I am new to shell scripting. There is a requirement to write a shell script to meet follwing needs.Prompt reply shall be highly appreciated.
script that will compare two config files and produce 2 outputs - actual config file and a report indicating changes made.
OS :Susi linux ver 10.3.
... (4 Replies)
Discussion started by: muraliinfy04
4 Replies
5. Red Hat
Currently,i use Fedora 10 and get a follow trouble :
My network:
route(10.11.10.2/24)----eth0----(10.11.10.105/24)Fedora10(172.16.239.1/24)----vmnet0----(172.16.239.2/24)Virtual Machine XP2.
I used : Vmware 6.5.1,Virtual Machine : Window XP SP2.
, iptable 1.4.1.1
I set up static ip... (2 Replies)
Discussion started by: kideltn
2 Replies
6. Solaris
i am using solaris 10 and i am able to ping all the hosts but i am not able to traceroute any of them. how to fix this? (9 Replies)
Discussion started by: chidori
9 Replies
7. Linux
Hello All,
We have added a windows host and its config files to Nagios master server and wanted to do a ping check alone at the moment however, the nagios master server identifies the host in its GUI and immediately disappears can anyone let me know the right approach to this one, We want to... (2 Replies)
Discussion started by: lovesaikrishna
2 Replies
8. UNIX for Dummies Questions & Answers
What are the xid and cid numbers in a host file used for on solaris? If possible can I get a detailed link on the configuration of hosts file explaining xid and cid. :o (1 Reply)
Discussion started by: usm4n
1 Replies
9. AIX
hi all
just installed the netsec.options.tcpwrapper from expansion pack, which used to be a rpm, for my aix 6.1 test box.
it is so unpredictable. i set up the hosts.deny as suggested for all and allow the sshd for specific ip addresses/hostnames.
the tcpdchk says the hosts allowed and... (0 Replies)
Discussion started by: wf201626
0 Replies
10. Solaris
Am trying to copy a tar file onto a series of remote hosts and untar it at the destination. Need to do this without having to do multiple ssh.
Actions to perform within a single ssh session via shell script
- copy a file
- untar at destination (remote host)
OS : Linux RHEL6 (3 Replies)
Discussion started by: sankasu
3 Replies
LEARN ABOUT OPENSOLARIS
avahi.hosts
avahi.hosts(5) File Formats Manual avahi.hosts(5)
NAME
avahi.hosts - avahi-daemon static host name file
SYNOPSIS
/etc/avahi/hosts
DESCRIPTION
/etc/avahi/hosts is a file which may be used to define static host name to IP address mappings for multicast DNS. This is especially useful
when publishing DNS-SD services on behalf of other hosts. See avahi.service(5) for more information.
The file format is similar to the one of /etc/hosts: on each line an IP address and the corresponding host name. The host names should be
in FQDN form, i.e. with appended .local suffix.
AUTHORS
The Avahi Developers <avahi (at) lists (dot) freedesktop (dot) org>; Avahi is available from http://avahi.org/
SEE ALSO
avahi-daemon(8), avahi.service(5)
COMMENTS
This man page was written using xml2man(1) by Oliver Kurth.
Manuals User avahi.hosts(5)