hi, how to write a scripts which launches 10 pings to different destinations at execution of single shell scripts please help me any ideas regards, Gopinath
Gopinath Achari wrote:> hi, > > how to write a scripts which launches 10 pings to different > destinations at execution of single shell scripts > > please help me any ideas > > regards, > GopinathDo you mean something like: ping -c10 host1 ping -c10 host2 .... which will ping host1 10 times, then host2 10 times etc. (see `man ping` for details of the options). If you have a list of hosts in a file, you could do: for host in `cat [filename]` do ping -c10 $host done or: while read host do ping -c10 $host done << [filename] If you only want to ping each host once, you can substitute '-c10' with '-c1' (again, see the man page). Hope this helps Laurence
On Mon, Jul 28, 2008, Gopinath Achari wrote:>hi, > > how to write a scripts which launches 10 pings to different >destinations at execution of single shell scripts > >please help me any ideasIf your goal is to test connectivity, you might look at the perl Net::Ping module. ``perldoc Net::Ping'' has several examples of checking one or more systems to see if they are alive. BTW: Anybody know of a python equivalent to this? Bill -- INTERNET: bill at celestial.com Bill Campbell; Celestial Software LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way Voice: (206) 236-1676 Mercer Island, WA 98040-0820 Fax: (206) 232-9186 A tax-supported, compulsory educational system is the complete model of the totalitarian state. -- Isabel Paterson, God of the Machine
I really like 'fping' for use in shell scripts. See: http://www.fping.com/ and http://fping.sourceforge.net/man/ It can be 'yum installed' from the CentOS RPMforge repo. So in your script you can just do fping -c 10 <dest1> <dest2> ... <destN> I don't understand exactly what 'scripts which launches 10 pings' and 'execution of single shell scripts' means. So don't think I can help with the scripting part... On Mon, 28 Jul 2008, Gopinath Achari wrote:> hi, > > how to write a scripts which launches 10 pings to different > destinations at execution of single shell scripts > > please help me any ideas > > regards, > Gopinath >