- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Speeding up result of ping test... Already use the...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2006 03:41 AM
01-25-2006 03:41 AM
I have a script that pings a series of hosts to verify that they are operational. I cut the number of ping attempts to three and the script sleeps a couple of seconds between the pings. Any ideas to speed up the script?
jack...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2006 03:48 AM
01-25-2006 03:48 AM
Re: Speeding up result of ping test... Already use the -n option
Remove the sleep :-))
'ping' is going to operate about as fast as the network echo will traffic. Without seeing your script it's difficult to suggest optimizations.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2006 03:53 AM
01-25-2006 03:53 AM
Re: Speeding up result of ping test... Already use the -n option
for z in $HOSTLIST
do
ping $z -n 3
sleep 2
done
I had the sleep in there to have a short delay. Had a feeling if ping ran right after the previous attempt, it might be to soon.
jack...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2006 04:00 AM
01-25-2006 04:00 AM
Re: Speeding up result of ping test... Already use the -n option
A senseless, repetious use of 'ping' might degrade a network, but for your purposes, drop the 'sleep()' and let your script work through the list. The use of 3-pings per device is quite conservative, but quite sufficient, in my opinion.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2006 04:01 AM
01-25-2006 04:01 AM
Re: Speeding up result of ping test... Already use the -n option
The ping command sends ICMP Echo Request(ECHO_REQUEST) packets to the host once per second. I think you can't speed them more.
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2006 04:04 AM
01-25-2006 04:04 AM
Re: Speeding up result of ping test... Already use the -n option
We use the folowing perl script to page our servers. If one is down I get a page. It also keeps a log.
#!/usr/bin/perl
if ($ARGV[0] eq "")
{
die "Usage: pingcheck
}
$BINDIR = "/bin";
$FILE = $ARGV[0];
$WORKDIR = "/usr/local/etc";
$LOGDIR = "/var/log";
$LOGFILE = "ping.log";
open (SERVERS,"$WORKDIR/$FILE") || die "Cannot open $WORKDIR/$FILE: $!\n";
while (
{
chomp;
$result = `$BINDIR/ping -c 5 $_`;
if ($result =~ "100% packet loss")
{
system("$BINDIR/echo \"Cannot ping $_\" `date` | $BINDIR/mail -s \"Cannot ping $_\" techpgr\@ourdomain.com");
system("$BINDIR/echo \"CANNOT ping $_\" `date` >> $LOGDIR/$LOGFILE");
# system("$BINDIR/echo \"CANNOT ping $_\" `date`");
}
else
{
system("$BINDIR/echo \"ping ok $_\" `date` >> $LOGDIR/$LOGFILE");
# system("$BINDIR/echo \"ping ok $_\" `date`");
}
}
close SERVERS;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2006 04:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2006 05:39 AM
01-25-2006 05:39 AM
Re: Speeding up result of ping test... Already use the -n option
Dropping the sleep and setting -n value to 2.
Thanks all....
Always learn things from these forums... :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2006 12:42 PM
01-25-2006 12:42 PM