Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Reaped: Testing the network connection

by NodeReaper (Curate)
on Jan 28, 2001 at 15:43 UTC ( [id://54843]=perlquestion: print w/replies, xml ) Need Help??

NodeReaper has asked for the wisdom of the Perl Monks concerning the following question:

This node was taken out by the NodeReaper on May 26, 2021 at 21:47 UTC

You may view the original node and the consideration vote tally.

Replies are listed 'Best First'.
Re: Testing the network connection
by Gloom (Monk) on Jan 28, 2001 at 16:07 UTC
    I think the results of your script can be more interesting if you use icmp instead of http. An http request may take different interval on the same site ( forking/pre-forking ... overloaded database ).
    What do think about it ?


    More Details:

    Why have you chosen http to test connectivity ?
    Icmp was made for that !!
    the results of a ping or a traceroute may be more sharp and regular.
    There's some perl module to handle it. Like this one.
    I think you should also use direct ip adresse to avoid strange results due to a slow dns server.

    That's all monks :)

      Would you elaborate a bit more on this please ?
      OK, thanks Gloom.

      But isn't the method I'm using more related to bandwidth than ICMP ?? (trying to understand here)

        Grrrr.... This is the bad node that I wanted nuked........ Oh well......
Re: Testing the network connection
by mkmcconn (Chaplain) on Jan 28, 2001 at 22:40 UTC

    Sorry: my comments here should have gone under Reaped: Testing the network connection, as this thread may be deleted. I was slow in parsing turnstep's instructions.

    Your program has been critiqued regarding the virtues of ICMP over HTTP as the protocol for testing connectivity. As correct as that point is, I think folks should keep in mind that your program provides a naive benchmark that answers a non-technical complaint thatyou got from your boss. He wanted to know "What's wrong with our stupid ISP? Yahoo! is slow as molasses today."

    Together with traceroute|tracert your program provides triangulation for answering your boss's question, and lays it out in a compelling snapshot. I would bet that if you combine the output of traceroute into your program, you will have answered your boss's content and performance question more to his satisfaction than if you had only tested connectivity. Put a button on his "Active Desktop" and he'll push it several times each day, I would guess.

    For my criticisms, mostly opinions, consider:

    1.   CGI does write all of the tags that you put into your script. I think you should use it fully - so that all improvements to CGI will be automatically written into your program.
    2.   You've made a good choice dividing the program into two, in my opinion. But, the advantages of doing so are lost when you hard-code the data. Separate out the data into an initialization file, or collect it from a form. (Update to clarify: at very least, pass the array  @sites rather than cut and paste it.)
    3.   in my opinion it's better to write your  open || die statement as
      open INFILE,"$datafile" or die "Cannot open $datafile :$!";
      The perlops  || and  or are identical in their short-circuit behavior, but the latter has the advantage of being more legible and having a much lower precedence (notice that it can even be used without parentheses preceding). In my opinion it's better suited to the open() test. I think it belongs in our perl vocabulary, for these reasons.

    Thanks for posting your program, cajun.
    mkmcconn

      Thanks much mkmcconn, Gloom, and a Your comments are very much appreciated.

      Yes, [no such node, ID 2347], you are correct in that it is a naive benchmark that should at least pacify my boss when he complains. (At least now I have SOMETHING to show him).

      I'd like your thoughts on the layout of the data when I incorporate traceroute figures into the presentation. I've been thinking about this, but haven't yet come up with how to incorporate that data into the table. Suggestions are welcome.

      Yes, I've got a LOT to learn about perl yet. It's been interesting thus far, I imagine it will become even more interesting as my learning increases.

      I thought of the @sites problem when I was coding it. I didn't like the same data being in two places then, but I didn't take the time to code in reading the data from a config file.

      I'll certainly take all of these comments and try to apply them to the current script. When I'm done, I'll post the results again.

      a, yes, I need to start 'use strict'.

      Aside from your smoother code rewrites, I particularily like your idea of multiple debug levels. (Why didn't I think of that ?) Cool, I like it !!

      I'll be looking at both of these nodes for sometime to come to glean all of the pointers that were left for me.

      Sorry for the duplicate posting. Actually this is the wrong node, the links at the bottom are hosed. The correct node is Reaped: Testing the network connection. Those links work.

      Thanks again ! mkmcconn, Gloom, and a

Re: Testing the network connection
by turnstep (Parson) on Jan 28, 2001 at 18:00 UTC

    Duplicate Post

    Please do not post anything further here, as this thread has been requested to be deleted by the author. Please post to this thread instead.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://54843]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 10:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found