|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | 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 | Display Modes |
|
#1
|
|||
|
|||
|
i need a script that will go out onto the network and ping all 14 windows computers and report back.and do this every day at 12pm. The servers ip is 192.168.101 and works up to 192.168.125 to the machines
anyone please help. |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Just set up a script to ping each box by name. Possibly in a for loop. put your hosts in a file one per line with full DNS name or IP address.
for name in `cat hosts.file` do ping "some command here" >> file.report done 2> error.log done This may be crude, but it should work. Set it up in cron to run everyday at 12. Try searching this forum for PING or something similar to your topic. ![]() |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
#!/bin/ksh
let x=101 while [[ $x != 126 ]] do ping -c 1 192.168.101.$x || echo 192.168.101.$x >>/var/outputfilename let "x = x + 1" done Run this in cron every day at 12 |
|
#4
|
|||
|
|||
|
thanks
thanks. i made the list of ips and saved it as iping
should the script look like this?? for name in `iping.pl` do ping "some command here" >> file.report done 2> error.log done or what should i save the list as? |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
i keep gettin a error
it says: Missing $ on loop variable at script line one whats wrong >? |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
for name in `cat iping.pl`
do ping $name >> file.report done 2> error.log For speed in completing the loop you may want to use the -c switch (linux) and limit the number of ICMP packets sent to each machine to 1. |
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
still getting that error on line 1
how do i make this for loop ? anyone got like a template i can edit for it? |
| Sponsored Links | ||
|
![]() |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using ping in script | mikez104 | Shell Programming and Scripting | 10 | 03-27-2012 07:22 PM |
| Animation Ping on Solaris Like Cisco Ping | gokcell | Shell Programming and Scripting | 1 | 12-04-2011 04:12 AM |
| Help With Ping Script | spmitchell | Shell Programming and Scripting | 1 | 12-05-2010 02:57 AM |
| Ping script | sriram003 | Shell Programming and Scripting | 2 | 05-26-2008 11:47 PM |
| Ping Script | mcrosby | Shell Programming and Scripting | 3 | 06-02-2006 11:11 AM |
|
|