Sponsored Content
Top Forums Shell Programming and Scripting Perl Ping Determine Success or Fail Post 37554 by gdboling on Friday 20th of June 2003 05:45:24 PM
Old 06-20-2003
Perl Ping Determine Success or Fail

I know how to ping in Perl. That is easy. What I am wondering is if there is a way for Perl to determine whether the ping was successful or not. Or do I need to save the results out and parse the results seperately looking for the #of tries and successful revieves.

Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

PERL: ping and e-mail

I need a script to open a text file with ip's in it, ping them, split the results into the ip and time from the results and e-mail them ? here what i've done. its porbly wrong and not workin.its for win nt4 use Net::SMTP; # get list of ip's to ping open (PINGFILE, "< c:\\Documents and... (20 Replies)
Discussion started by: perleo
20 Replies

2. Shell Programming and Scripting

determine file type with perl

Hello i will like to know please how can i determine file type inside perl script not using the unix "file" program Thanks allot (1 Reply)
Discussion started by: umen
1 Replies

3. Shell Programming and Scripting

How to determine if a script (perl) was called from a CRON job or commandline

Hi, Is there a way to determine if a Script is called from a CRON job or from a commandline Gerry. (2 Replies)
Discussion started by: jerryMcguire
2 Replies

4. Shell Programming and Scripting

Determine string in Perl.

Hi, I have a little Perl question. I need to determine the last word in the following string: h t t p://abc.def.com/hijklm The output should be the string hijklm. h t t p is of course http. The string between the slashes always differs. The string after the last slash always differs.... (4 Replies)
Discussion started by: ejdv
4 Replies

5. Shell Programming and Scripting

[Perl] Determine directory name

Hi there, I wonder if it is possible the determine a name of a directory which is different on various hosts. Let me try to explain. I have the directory /tmp/dir1/dir2/canchangedir. This directory name is different on various hosts. I need to use the directory name, independent from the... (2 Replies)
Discussion started by: ejdv
2 Replies

6. Shell Programming and Scripting

production issue - shell sqlplus processing sometime success sometime fail

Hi Expert, Below is a real production environment issue: we are using shell script to FTP to a remote server and fetch around 150 files every day, for each file we need to keep a entry inside ORACLE DB table, before insert into table, each file has a associated logid, which need to be... (2 Replies)
Discussion started by: summer_cherry
2 Replies

7. Programming

Perl Ping Loop

Hi All i have an issue with ping, we are using dhcp and so if the machine has been offline and i ping it, i get " ping: unknown host <hostname> is there a way i can stick a loop somewhere so it would keep trying when it got the unknown host error and then when the machine came back online... (2 Replies)
Discussion started by: ab52
2 Replies

8. Shell Programming and Scripting

Ping and Perl

Hi There i have little situation that i could us some help with. We have a dhcp server, but the problem is if that a machine has been offline for a while it loose it's lease and so if you ping it you get unknown host if there a way using perl that it will continue to try and ping it, even tho... (1 Reply)
Discussion started by: ab52
1 Replies

9. Programming

Perl : Inline program to determine file size

Hi, I have 5 files as below $ ll sam* -rw-rw-rw- 1 sam ugroup 0 Mar 21 06:06 sam3 -rw-rw-rw- 1 sam ugroup 0 Apr 3 22:41 sam2 -rw-rw-rw- 1 sam ugroup 17335 Apr 10 06:07 sam1 -rw-rw-rw- 1 sam ugroup 5 Apr 10 07:53 sam5 -rw-rw-rw- 1 sam ugroup 661 Apr 10 08:16 sam4 I want to list out... (4 Replies)
Discussion started by: sam05121988
4 Replies

10. Shell Programming and Scripting

sed commands success / fail from commandline vs ksh script

solaris 5.10 Generic_138888-03 sun4v sparc SUNW,Sun-Fire-T200 I need a sed command that tests true when presented with lines that contain either forward and backslash. input file: c:/myFile.txt c:\yourFile.txt It doesn't appear that sed (in my environment anyway) supports... (4 Replies)
Discussion started by: msutfin
4 Replies
sonar(6x)							XScreenSaver manual							 sonar(6x)

NAME
sonar - display a sonar scope SYNOPSIS
sonar [-ping hosts-or-subnets] [-ping-timeout int] [-delay usecs] [-speed ratio] [-sweep-size ratio] [-font-size points] [-team-a-name string] [-team-b-name string] [-team-a-count int] [-team-b-count int] [-no-dns] [-no-times] [-no-wobble] [-debug] [-fps] DESCRIPTION
This draws a sonar screen that pings (get it?) the hosts on your local network, and plots their distance (response time) from you. The three rings represent ping times of approximately 2.5, 70 and 2,000 milliseconds respectively. Alternately, it can run a simulation that doesn't involve hosts. OPTIONS
sonar understands the following options: -ping hosts-or-subnets The list of things to ping, separated by commas or spaces. Elements of this list may be: simulation Run in simulation mode instead of pinging real hosts. hostname Ping the given host. A.B.C.D Ping the given IP address. subnet Ping the local class C subnet (the nearest 255 addresses). subnet/NN Ping a different-sized local subnet: e.g., subnet/28 would ping a 4-bit subnet (the nearest 15 addresses). A.B.C.D/NN Ping an arbitrary other subnet. The IP address specifies the base address, and the part after the slash is how wide the subnet is. Typical values are /24 (for 255 addresses) and /28 (for 15 addresses). filename Ping the hosts listed in the given file. This file can be in the format used by /etc/hosts, or it can be any file that has host names as the first or second element on each line. If you use ssh, try this: sonar -ping $HOME/.ssh/known_hosts -ping-timeout int The amount of time in milliseconds the program will wait for an answer to a ping. -delay int Delay between frames, in microseconds. Default 20000. -speed ratio Less than 1 for slower, greater than 1 for faster. Default 1. -sweep-size ratio How big the glowing sweep area should be. Default 0.3. -font-size points How large the text should be. Default 10 points. -no-wobble Keep the display stationary instead of very slowly wobbling back and forth. -no-dns Do not attempt to resolve IP addresses to hostnames. -no-times Do not display ping times beneath the host names. -team-a-name string In simulation mode, the name of team A. -team-b-name string In simulation mode, the name of team B. -team-a-count int In simulation mode, the number of bogies on team A. -team-b-count int In simulation mode, the number of bogies on team B. -fps Display the current frame rate, polygon count, and CPU load. NOTES
On most Unix systems, this program must be installed as setuid root in order to ping hosts. This is because root privileges are needed to create an ICMP RAW socket. Privileges are disavowed shortly after startup (just after connecting to the X server) so this is believed to be safe: chown root:root sonar chmod u+s sonar It is not necessary to make it setuid on MacOS systems, because on MacOS, unprivileged programs can ping by using ICMP DGRAM sockets instead of ICMP RAW. In ping-mode, the display is a logarithmic scale, calibrated so that the three rings represent ping times of approximately 2.5, 70 and 2,000 milliseconds respectively. This means that if any the hosts you are pinging take longer than 2 seconds to respond, they won't show up; and if you are pinging several hosts with very fast response times, they will all appear close to the center of the screen (making their names hard to read.) SEE ALSO
X(1), xscreensaver(1), ping(8) COPYRIGHT
Copyright (C) 2000-2008 by Jamie Zawinski <jwz@jwz.org> Copyright (C) 1998 by Stephen Martin. <smartin@canada.com> Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in sup- porting documentation. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. AUTHORS
Stephen Martin <smartin@canada.com>, 3-nov-1998. Subnet support, etc. added by Jamie Zawinski, 17-Jul-2000. Rewritten using OpenGL instead of X11 by Jamie Zawinski, 12-Aug-2008. X Version 11 5.15 (28-Sep-2011) sonar(6x)
All times are GMT -4. The time now is 05:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy