Looking at ping in perl.
http://perldoc.perl.org/Net/Ping.html
Ii do not see a way to ping with a pattern the way it is allowed under
shell with -p.
http://linux.about.com/od/commands/l/blcmdl8_ping.htm
Is there a way to use pattern without resorting to shell?
Amit Saxena wrote:
> I want a perl ping script (console based) to monitor server up/down
state.
Here's something I wrote ~2000 FWIW. It looks like I was still on
dial-up, and wanted to ping an Internet host every ~10 seconds or so to
prevent my connection from being dropped due to in
Hi Bob,
It seems there is some confusion.
I just want to monitor remote server connectivity (either through ping or
something else) but I don't want to call my programs every few intervals
etc. What I want is a daemon sort of a thing in Perl running either on the
source system (preferably)
Thanks Thomas,
I will surely look at mon to know about how to write monitoring code in
Perl.
Thanks & Regards,
Amit Saxena
On Tue, Jul 21, 2009 at 5:25 AM, Thomas Bätzler wrote:
> Amit Saxena wrote:
> > Hi Thomas,
> >
> > Thanks for the response.
> >
> > The client for which I am working will
Amit Saxena :
Hi all,
I want a perl ping script (console based) to monitor server up/down state.
I once made that a subroutine based on Net::Ping:
use Net::Ping;
sub pinghost {
my $host = shift;
my $type = shift || 'icmp';
my $port = shift || 7; # for syn pi
install this one? They have to
learn how be reasonable before you will be able to do much for them.
Ping will only tell you that the target computer is up, still connected to the
network and reachable from your workstation. It won't tell you if the
particular service[*] you want to monit
Amit Saxena wrote:
> Hi Thomas,
>
> Thanks for the response.
>
> The client for which I am working will not allow any external utility /
> modules to be installed on their development / production environments.
> Moreover they want the solution implemented using Perl only.
Actually, mon ist pure
Subject:Re: How to implement ping script to monitor server up/down state
in
perl ?
Hi Thomas,
Thanks for the response.
The client for which I am w
9 at 4:43 AM, Thomas Bätzler wrote:
> Amit Saxena asked:
> > I want a perl ping script (console based) to monitor server up/down
> > state.
>
> Why re-invent the wheel when there's already stuff like mon (
> http://mon.wiki.kernel.org/index.php/Main_Page) or
Amit Saxena asked:
> I want a perl ping script (console based) to monitor server up/down
> state.
Why re-invent the wheel when there's already stuff like mon
(http://mon.wiki.kernel.org/index.php/Main_Page) or nagios
(http://www.nagios.org/)?
HTH,
Thomas
--
To unsubscribe, e-mail
Hi all,
I want a perl ping script (console based) to monitor server up/down state.
So far I have tried two different approaches, though none of them were
successful.
*First Approach*
Call the operating system "ping" command from the Perl program and get the
server up/down state.
agement with it and, of course, perl:)
>
> -Original Message-
> From: kevin liu [mailto:lwtben...@gmail.com]
> Sent: Friday, April 10, 2009 10:13
> To: Amit Saxena
> Cc: Perl Beginners
> Subject: Re: How to login from one system (A) into remote system (B) and
> do a
[mailto:lwtben...@gmail.com]
Sent: Friday, April 10, 2009 10:13
To: Amit Saxena
Cc: Perl Beginners
Subject: Re: How to login from one system (A) into remote system (B) and
do a ping to the third system (C) with Perl and CGI !
I think this depends on what kind of OS you are using.
If you are
to login from one system (A) into remote
> system (B) and do a ping to the third system (C).
>
> As of now, I have successfully written the code in Perl CGI to Ping any
> host
> / IP using built it Perl Net::Ping module.
>
> However I am not sure how to login (preferably usi
Hello everybody,
I need to write a Perl CGI script to login from one system (A) into remote
system (B) and do a ping to the third system (C).
As of now, I have successfully written the code in Perl CGI to Ping any host
/ IP using built it Perl Net::Ping module.
However I am not sure how to
Angerstein wrote:
> Ethereal would do, too.
They've changed the name from Ethereal to Wireshark.
John
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
traffic.
Thanks,
Bastian
-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von
Tom Phoenix
Gesendet: Mittwoch, 16. Mai 2007 23:12
An: Angerstein
Cc: beginners@perl.org
Betreff: Re: Net::Ping Bug found?
On 5/16/07, Angerstein <[EMAIL PROTECTED]>
On 5/16/07, Angerstein <[EMAIL PROTECTED]> wrote:
Start iptrace with
Machine #1: Doesn't have iptrace. OpenBSD 4.0 system.
Machine #2: Doesn't have iptrace. MacOS X 10.4.9.
I hope that other testers have better results for you!
--Tom Phoenix
Stonehenge Perl Training
--
To unsubscribe, e-ma
I can hand my Routine to you people.
Use:
Start iptrace with
iptrace -i en1 -S 1500 -P ICMP /tmp/trace.bin
(when you kill iptrace use kill -15 important!!!)
Use this code
#
use Net::Ping;
my $p; # Ping Objekt
my $r = 127.0.0.1; # Give any IP address
Something like this:
ping geekcrossing.net | perl -nle 'print $1 if /time=(\d+\.\d+)/'
HTH
Goran
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On 5/16/07, Angerstein <[EMAIL PROTECTED]> wrote:
So Please:
Could somebody verify this on her/his own System?
I'm sure that many people will be glad to help you. Could you please
supply a small program that testers could run and send you the output?
Good luck with your project!
--Tom Phoeni
Hi there!
I am using Net::Ping on AIX (here 5.2) and I noticed a strange behaviour
concerning the ICMP Payload Data Field.
If I do a typical default ping with
$p = new Net::Ping('icmp', $ping_timeout);
I will get a EthernetII-IP-ICMP-Package (so far so good),
but this package does not
On 5/16/07, Srinivainputs <[EMAIL PROTECTED]> wrote:
Hi,
ping geekcrossing.net|perl -le "m/time=(\d+)/;print $1";
Can some one help me with the above command
Add an n to the perl arguments to get it loop over stdin and use
single quotes to prevent shell from trying to inter
Hi,
ping geekcrossing.net|perl -le "m/time=(\d+)/;print $1";
Can some one help me with the above command
-srini
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hi,
I wonder if anyone have a solution to the subject problem when using
Net::Ping ?
--
Best Regards,
ubergoonz
Hi,
Christopher Spears <[EMAIL PROTECTED]> wrote:
> I've decided to rework my Perl script that pings a blade and
> checks for nrnode:
>
> my @bladeNumbers = @ARGV;
>
> if (scalar @bladeNumbers == 0) {
> print "No blades entered!\n";
> exit;
> }
if( my @bladeNumbers = @ARGV ){
## cod
if (`ping $blade` =~ /$badPing/) {print "$blade:
$badPing\n";}
change to:
my @results=`ping -c1 $blade`;
print "$blade:$badPing\n" if grep /$badPing/,@results;
On Fri, 9 Sep 2005 01:41:19 -0700 (PDT), "Christopher Spears"
<[EMAIL PROTECTED]> said:
>
in scalar context when used in a condition)
> {
> print "No blades entered!\n";
> exit;
> }
> foreach $_(@bladeNumbers) {
foreach (@bladeNumbers) {
($_ is implicitly used)
>my $blade = "blade-".$_;
>print "$blade\n";
>
uot;;
my $badPing = "Destination Host Unreachable";
if (`ping $blade` =~ /$badPing/) {print "$blade:
$badPing\n";}
my $nrnode = `ssh $blade ps aux | grep nrnode`;
if ($nrnode =~ /nrnode/) {print "Found nrnode for
$blade!\n";}
}
The problem line is:
if (`ping
Hi ,
I have to verify whether the servers [windows , Linux ] which are
integrated to my Unix machine are alive or not .
I am using Net::Ping.
Problem i am facing is , i am able to verify all Unix machines
integrated .
And not the Windows & Linux machines which integrated to my UNIX
Hi ,
I have to verify whether the servers [windows , Linux ] which are
integrated to my Unix machine are alive or not .
I am using Net::Ping.
Problem i am facing is , i am able to verify all Unix machines
integrated .
And not the Windows & Linux machines which integrated to my UNIX box.
pl
> -Original Message-
> From: John W. Krahn [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 23, 2005 2:50 PM
> To: Perl Beginners
> Subject: Re: printing output of ping command -- New question
> at bottom.
>
> Tyson Sommer wrote:
> >
> > Th
> -Original Message-
> From: Chris Devers [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 23, 2005 1:18 PM
> To: Tyson Sommer
> Cc: 'Perl Beginners List'
> Subject: Re: printing output of ping command -- New question
> at bottom.
>
> On
Tyson Sommer wrote:
This might be a question for beginners-cgi, but since it was mentioned
here...
I tried to use Net::Ping in a CGI script and it said I didn't have
permissions to run ping. I can execute the section of the CGI script with
the call to Net::Ping just fine from the cmd line
ies?
Instead of
my $pinger = Net::Ping->new("icmp") || die;
Why not use
my $pinger = Net::Ping->new("icmp") || die "Can't make pinger: $!";
This might at least give you a more descriptive error message...
Also, are you having CGI::Carp us
> -Original Message-
> From: Chris Devers [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 23, 2005 10:14 AM
> To: TapasranjanMohapatra
> Cc: Perl Beginners List
> Subject: Re: printing output of ping command
>
> On Wed, 23 Feb 2005, TapasranjanMohapatr
On Wed, 23 Feb 2005, TapasranjanMohapatra wrote:
> I have a script as follows
>
> my $host = shift;
> my $count = shift;
> my $result = `ping -c $count $host`;
> if($result =~ m/$count packets transmitted, $count packets received/)
> {
> $
TapasranjanMohapatra wrote:
Hi All,
I have a script as follows
my $host = shift;
my $count = shift;
my $result = `ping -c $count $host`;
if($result =~ m/$count packets transmitted, $count packets received/)
{
$success = 1;
}
print "$res
This works:
#!/usr/bin/perl
use strict;
use diagnostics;
my $host = "www.netbsd.org";
my $count = 0;
system("ping -c 5 $host");
=
thx,
Radhika
> Hi All,
> I have a script as follows
>
> my $host = shift;
> my $cou
Hi All,
I have a script as follows
my $host = shift;
my $count = shift;
my $result = `ping -c $count $host`;
if($result =~ m/$count packets transmitted, $count packets received/)
{
$success = 1;
}
print "$result\n";
Now, when
On Thursday 09 Sep 2004 12:20 pm, Flemming Greve Skovengaard wrote:
[snip]
>
> Don't you mean 'ping -n -c 50 10.1.1.31' instead of 'ping -n 50
> 10.1.1.31'. Else read the man page for ping.
Thanks for that, missed the obvious.
--
Gary Stainburn
This
Gary Stainburn wrote:
Hi folks.
Got the simplest of small scripts that runs ping and shows the summary.
However, although the ping command works at the shell, it doesn't work
in the perl script.
any ideas?
#!/usr/bin/perl -w
while(1) {
my @lines=qx{ping -n 50 10.1.1.31};
my $time
Hi folks.
Got the simplest of small scripts that runs ping and shows the summary.
However, although the ping command works at the shell, it doesn't work
in the perl script.
any ideas?
#!/usr/bin/perl -w
while(1) {
my @lines=qx{ping -n 50 10.1.1.31};
my $times=pop @lines;
my $c
Prasanna Kothari,
Excellent, I've seen the mistake I made with my
program now thanx to yours! Cheers.
One more thing, Is there any module that allows you to
log network errors whilst the program is pinging??
Thanx
Ben
___
Do you Yahoo!?
Win 1 of 4,0
Ben Crane wrote:
> Hi all,
>
> I need to set the ping command running for a few hours
> on my machine, and record (the exact time/date) then
> the ping function fails.
>
> I have tried putting a script together but no joy.
> Does anyone have a script like this that I cou
hi,
Have a look at the module Net::Ping for more options.
here's a sample script that pings a host once and prints the result.
#!/usr/bin/perl -w
use strict;
use English;
use Net::Ping;
my $host = "";
my $p = Net::Ping->new("icmp");
my $val = $p->ping($host);
if(!(
Hi all,
I need to set the ping command running for a few hours
on my machine, and record (the exact time/date) then
the ping function fails.
I have tried putting a script together but no joy.
Does anyone have a script like this that I could
please "borrow"?? I need to run the c
mmented out.
> >
> > non-existent? since when?
> >
> > perldoc Net::Ping
> >
> >$p->bind($local_addr);
> >Sets the source address from which pings will be sent. This must
[snip]
> >ping() for that object.
>
> Y
Rob Dixon wrote:
> I am running with Net::Ping 2.02, which was the version that came with my
> Perl version 5.6.1. It doesn't appear to be dated, apart from a (c) 1996,
Curiouser and curiouser...
NAME
Net::Ping - check a remote host for reachability
$Id: Ping.pm,v 1.6 2002/
R. Joseph Newton wrote:
> "Scott R. Godin" wrote:
> >
> > Without debating the possible usefulness of it when set improperly by
> > inexperienced coders, In Net::Ping 2.28 which I have installed here, and
> > which appears to be the most recent version ava
l to the non-existent
> > > > bind() function was commented out.
> > >
> > > non-existent? since when?
> > >
> > > perldoc Net::Ping
> > >
> > >$p->bind($local_addr);
> > >Sets the source address from w
"Scott R. Godin" wrote:
> I think it probably would be better to quote the entire parameter
> > list for perl, but it did run fine once the call to the non-existent
> > bind() function was commented out.
>
> non-existent? since when?
>
> perldoc Net:
R. Joseph Newton wrote:
> "Bakken, Luke" wrote:
>
>> > $!=1;
>>
>> $! contains error text, if I remember correctly off the top of my head.
>>
>> Use $| = 1 instead for autoflush. This shouldn't cause redirect
>> problems, tho.
>>
Rob Dixon wrote:
> R. Joseph Newton wrote:
> >
> > > $p->bind("192.168.2.211"); # Specify source interface of pings [with no my or
> > > our]
>
> But it's a method call on an existing object ;-)
Oops, my bad. cited the wrong line--should h
R. Joseph Newton wrote:
>
> > $p->bind("192.168.2.211"); # Specify source interface of pings [with no my or our]
But it's a method call on an existing object ;-)
/R
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
"Bakken, Luke" wrote:
> > $!=1;
>
> $! contains error text, if I remember correctly off the top of my head.
>
> Use $| = 1 instead for autoflush. This shouldn't cause redirect
> problems, tho.
>
> > use Net::Ping;
> > @host_array = ;
> >
Ramprasad wrote:
> I cant beleive this , it seems so impossible can anyone help me
I can. You ae not using strict.
> ...
> @host_array = ; # no my
> $p = Net::Ping->new("icmp"); # no my
> $p->bind("192.168.2.211"); # Speci
;
autoflush STDOUT;
use Net::Ping;
@host_array = ;
$p = Net::Ping->new("icmp");
$p->bind("192.168.2.211"); # Specify source interface of pings
I don't know of a 'bind' method for this module. I may be new, of course.
foreach $host (@host_array) {
chomp(
dle;
autoflush STDOUT;
> use Net::Ping;
> @host_array = ;
> $p = Net::Ping->new("icmp");
> $p->bind("192.168.2.211"); # Specify source interface of pings
I don't know of a 'bind' method for this module. I may be new, of course.
> foreach $h
> $!=1;
$! contains error text, if I remember correctly off the top of my head.
Use $| = 1 instead for autoflush. This shouldn't cause redirect
problems, tho.
> use Net::Ping;
> @host_array = ;
> $p = Net::Ping->new("icmp");
> $p->bind("192.168.2.2
I have written a simple script that runs file when I run on command line
but fails when I redirect its output
I cant beleive this , it seems so impossible can anyone help me
$!=1;
use Net::Ping;
@host_array = ;
$p = Net::Ping->new("icmp");
$p->bind("192.168.2.211"); # S
Does anyone have any experience using the ping method
from Net::POP3? I've included the following code,
after running I get "Cannot get ping stats:"
#/usr/bin/perl -w
use Net::POP3;
$pop = Net::POP3->new($mail_server) or die "Can't
connect $!\n";
defined (
On Tue, 30 Jul 2002, drieux wrote:
> I was somewhat surprised that the ping("tcp") method 'failed'
> on an unvarnished linux box...
You are right, I got confused between the stream echo server and the tcp
one. The tcp echo requests do get replied to without having t
package is generated. Maybe a problem between perl, ping.pm and my OS :
AIX 4.3.3.
Thanks
> -Ursprüngliche Nachricht-
> Von: Sudarshan Raghavan [mailto:[EMAIL PROTECTED]]
> Gesendet am: Dienstag, 30. Juli 2002 22:47
> An: Perl beginners
> Betreff: Re: Problem with Net::Ping
oth these
> cases the application service if running handles the request unlike ICMP
> where the protocol provides for this facility.
[..]
good point...
cf:
http://www.wetware.com/drieux/pbl/Sys/Admin/netPing.txt
I was somewhat surprised that the ping("tcp") method 'faile
On Tuesday, July 30, 2002, at 09:18 , Jean-Luc BEAUDET wrote:
[..]
> Yu have to be aware that, generally, if yu go out the local network
> FireWall
> block ICMP packets...
>
> The ping statement is not a good evidence test...
excuse me while I giggle... a bit here.
I have n
On Tue, 30 Jul 2002, drieux wrote:
>
> On Tuesday, July 30, 2002, at 01:31 , Sudarshan Raghavan wrote:
> [..]
> > The system ping command sends ICMP echo packets and by default Net::Ping
> > sends udp packets. This will work only if the machine you are pinging
> >
On Tuesday, July 30, 2002, at 01:31 , Sudarshan Raghavan wrote:
[..]
> The system ping command sends ICMP echo packets and by default Net::Ping
> sends udp packets. This will work only if the machine you are pinging
> supports udp echo requests. For compatibility with system pin
On Tue, 30 Jul 2002, Angerstein wrote:
> Hello,
> I wrote a big skript which uses net::ping (ping.pm) (and tk).
> I noticed that the resultes of Net::Ping are not identical to the system
> commad ping.
> Much more Items are not reachable over Net::Ping then they are over the
&
Hello,
I wrote a big skript which uses net::ping (ping.pm) (and tk).
I noticed that the resultes of Net::Ping are not identical to the system
commad ping.
Much more Items are not reachable over Net::Ping then they are over the
system command.
I can´t explain why. (Even after rewriting 500 lines
Hmmm. I tried putting in the icmp instead, but because I am not root I
am unable to run it. I don't understand why I can ping it from the
command line just fine but not in this program.
Any more ideas.
[EMAIL PROTECTED] wrote:
>Try changing the line below to:
>
>$t = Net::P
Hi, Joseph && list !
On Friday 01 March 2002 02:44 pm, you wrote:
> I am appearing to have some
> troubles. It appears that it can not reach the hosts specified, but when I
> try it manually it works just fine.
# use TCP if we're not root, ICMP if we are
my $pong = Net:
Try changing the line below to:
$t = Net::Ping->new('icmp');
by default Net::Ping uses UDP packets, but not all hosts will respond to
this.
-Original Message-
From: Joseph Bajin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 27, 2002 8:43 AM
To: [EMAIL PROTE
I am appearing to have some
troubles. It appears that it can not reach the hosts specified, but when I
try it manually it works just fine. Here is what I have for my code:
#!/usr/bin/perl -w
use strict;
use Net::Ping;
Initalize Variables#
my @hosts= qw(au
I am appearing to have some
troubles. Here is what I have for my code:
#!/usr/bin/perl -w
use strict;
use Net::Ping;
Initalize Variables#
my @hosts= qw(au);
my $t;
my @lines;
my $hostname;
my %status;
#while(1){
$t = Net::Ping->new();
fore
IL PROTECTED]">news:[EMAIL PROTECTED]...
> > At 09:19 AM 2/22/02 +, Lanceo wrote:
> > >Hi,
> > >
> > >I am having difficulty getting the Net::Ping module to work properly. I
>am
> > >using ActivePerl 5.6.1.631 on a win32 platform. I can ping a s
I was referring to the other suggestions offered in this thread, but if the
servers are yours then you should be able to get around the ping problem I
was talking about.
-Original Message-
From: Lanceo [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 26, 2002 7:31 AM
To: [EMAIL
What other methods?
I am trying to see if a server is alive and reachable. Often our servers
will respond to a ping, but IIS has fallen over or there is some problem
that stops pages from being served.
So right now I have two tools to use - Ping, and fetching a page from the
server and
>
> >I am having difficulty getting the Net::Ping module to work properly. I
am
> >using ActivePerl 5.6.1.631 on a win32 platform. I can ping a server in a
> >dos prompt ok, but when I try to get the Perl Net::Ping to work it always
> >returns a failure. It seems to po
I had the same problem at first, but I've found that if you want the
Net::Ping module to work on a Win32 platform, you might have better luck
sticking to the ICMP protocol (which is what your command-line ping is
using). Something like this usually works for me:
my $p = Net::Ping->n
At 09:19 AM 2/22/02 +, Lanceo wrote:
>Hi,
>
>I am having difficulty getting the Net::Ping module to work properly. I am
>using ActivePerl 5.6.1.631 on a win32 platform. I can ping a server in a
>dos prompt ok, but when I try to get the Perl Net::Ping to work it always
>
Lanceo wrote:
> Hi,
>
> I am having difficulty getting the Net::Ping module to work properly. I am
> using ActivePerl 5.6.1.631 on a win32 platform. I can ping a server in a
> dos prompt ok, but when I try to get the Perl Net::Ping to work it always
> returns a failure.
On Fri, 2002-02-22 at 15:18, insomniak wrote:
> Hi
> If you are looking to find out is a host is alive try this bit of code.
>
> $host = www.google.com;
> $ip=join ".",unpack("C4",(gethostbyname($host))[4]);
>
> $ip will be empty if host is dead
>
> from command line
>
> perl -e "print join \"
gethostbyname(@ARGV[0]))[4]);"
www.google.com
hope this helps
Regards
Mark
- Original Message -
From: "Tanton Gibbs" <[EMAIL PROTECTED]>
To: "Lanceo" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, February 22, 2002 10:27 AM
Subject: Re:
anyone know why alarm is unimplemented in my
version? Also, what can I do to add it?
Thanks!
Tanton
- Original Message -
From: "Lanceo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 22, 2002 4:19 AM
Subject: ping
> Hi,
>
> I am having d
Hi,
I am having difficulty getting the Net::Ping module to work properly. I am
using ActivePerl 5.6.1.631 on a win32 platform. I can ping a server in a
dos prompt ok, but when I try to get the Perl Net::Ping to work it always
returns a failure. It seems to ponder over pinging the host for a
Ted Lee wrote:
>Hey guys,
>
>I've been playing with Perl, and I've built a simple ICMP Ping sweep program
>that accepts start and end IP, and pings every host in between.
>
>Question I have is, I want to reduce the time it takes to do so, I was
>considering spawn
Hey guys,
I've been playing with Perl, and I've built a simple ICMP Ping sweep program
that accepts start and end IP, and pings every host in between.
Question I have is, I want to reduce the time it takes to do so, I was
considering spawning a processes for X number of hosts to ping
n that case, I'd need to see the error message.
>However, per
>the docs, you have to be root to use ICMP. Does this then mean that when run
>as "not-root" the ICMP parameter is ignored and defaults to TCP? That might
>explain this.
I don't think so:
% perl -MNet::
defaults to TCP? That might
explain this.
-=GLA=-
-Original Message-
From: Peter Scott [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 23, 2001 1:52 AM
To: Daniel Falkenberg; [EMAIL PROTECTED]
Subject: Re: Net::Ping
At 11:28 AM 10/23/01 +0930, Daniel Falkenberg wrote:
>Firstly. I h
At 11:28 AM 10/23/01 +0930, Daniel Falkenberg wrote:
>Firstly. I have a host using a 56k modem connection. When I ping these
>servers using the ping object
>
>$p = Net::Ping->new("icmp");
>
>If the server that is being pinged doesn't respond it gen
Hi all,
I have just been playing with Net::Ping recently and have a few
questions that I need clarifing if any one has the time.
Firstly. I have a host using a 56k modem connection. When I ping these
servers using the ping object
$p = Net::Ping->new("icmp");
If the s
> Kevin der Kinderen <[EMAIL PROTECTED]> said:
> Thanks for the comments Smoot.
>
> I thought "while (<>) {...}" was the same as "foreach (<>) {...}". Is this
> because foreach provides a list context to the file being read and while
> provides scalar context? I read this in the camel book but
>
> I usually add a "-V" or --version option to the code which displays the
> current version number. Take a look at Getopt::Std or Getopt ::Long
> for option processing.
>
> > For those who might want to comment - here's the code... (be kind - I'm
> &g
ent version number. Take a look at Getopt::Std or Getopt ::Long
for option processing.
> For those who might want to comment - here's the code... (be kind - I'm
> new at this).
>
> ./live
> #!/usr/bin/perl -w
>
> use strict;
> use warnings;
>
I'd appreciate any comments on the code below. I run it like this:
./live new("icmp");
foreach (<>)
{
chomp;
if ($_ eq "") {
print STDERR "\nDone\n";
exit(0);
}
print "$_ is
Hi Jorge
You can define the host name as a string eg.
$host = "hostname";
where hostname represents the host name on your network,
and then refer to the string in the ping command:
unless ($p->ping($host))
Hope this helps
Robert Graham
> Hi I have the following code:
>
&g
- Begin Forwarded Message -
Date: Mon, 16 Jul 2001 17:48:29 +0200 (MEST)
From: Jorge Goncalvez
Subject: Re:Retrieve host
To: [EMAIL PROTECTED]
Mime-Version: 1.0
Content-MD5: wPL9znYmDeTyzQcXNKmp1Q==
Hi I have the following code:
use Net::Ping;
$p = Net::Ping
Dave Palmer <[EMAIL PROTECTED]>:
> > open PINGRESULTS, ">/tmp/pingresults.$$" or die $!;
> > open PING, "-|" or exec "/usr/sbin/ping", "-sRv", "-I", "1",
> > $pnode, 64, 5);
> > while () { print P
ess. You just need to know how to do it without opening a
> > shell. The
> > given example:
> >
> > : > system "(/usr/sbin/ping -sRv -I 1 $pnode 64
> 5)>/tmp/pingresults.$$";
> >
> > is bad bad bad because it opens a shell to run the command. (Hi
1 - 100 of 107 matches
Mail list logo