CassBeth SAT

Network Management Tool

Table Of Contents

Control Panel
DOS Ping Perl Ping
Perl Ping Module
More help . use this to save off webpages that help you to manage and use NMT Nothing Works HELP Installation and License

Note: Not all screen shots in this manual match the current NMT version. They are for demonstration and training purposes.


Control Panel

Use the control panel to make your settings and start NMT.

  1. Press the submit button to capture the settings.
  2. Once settings are reasonable begin a small ping session.
  3. When the settings are mature increase the session count to run overnight.
  4. Review the screen and logs the next morning.
  5. Uncheck the ping run options and press the submit button.
  6. Save this off as a new template in the NMT template folder.

There are 2 ways to ping using NMT. The first and preferred method is to use the Perl ping. This uses a Perl library with various options to ping the remote destination. In this case the TCP option is the most reasonable. It also takes the longest time because the remote uses its echo port to respond. The second approach is to use the DOS ping.

You may be wondering why use NMT if you can just ping from a DOS window. This tool provides structure, offers reasonable options, and saves off the results automatically in common areas. It also uses colors to help visualize the results. It may not seem like much until you need to run this 24/7 to make sure your links are not winking out for a few seconds.

The biggest difference between the Perl TCP and DOS ICMP ping is the time. That time difference might actually be the reason your real time system is having problems but everyone else is claiming the network is fine, after all the ICMP ping shows no evidence of a problem. With the new insights from NMT there may be other evidence that suggest a network problem.


DOS Ping

C:\Users\me>ping

Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
            [-r count] [-s count] [[-j host-list] | [-k host-list]]
            [-w timeout] [-R] [-S srcaddr] [-c compartment] [-p]
            [-4] [-6] target_name

Options:
    -t             Ping the specified host until stopped.
                   To see statistics and continue - type Control-Break;
                   To stop - type Control-C.
    -a             Resolve addresses to hostnames.
    -n count       Number of echo requests to send.
    -l size        Send buffer size.
    -f             Set Don't Fragment flag in packet (IPv4-only).
    -i TTL         Time To Live.
    -v TOS         Type Of Service (IPv4-only. This setting has been deprecated
                   and has no effect on the type of service field in the IP
                   Header).
    -r count       Record route for count hops (IPv4-only).
    -s count       Timestamp for count hops (IPv4-only).
    -j host-list   Loose source route along host-list (IPv4-only).
    -k host-list   Strict source route along host-list (IPv4-only).
    -w timeout     Timeout in milliseconds to wait for each reply.
    -R             Use routing header to test reverse route also (IPv6-only).
                   Per RFC 5095 the use of this routing header has been
                   deprecated. Some systems may drop echo requests if
                   this header is used.
    -S srcaddr     Source address to use.
    -c compartment Routing compartment identifier.
    -p             Ping a Hyper-V Network Virtualization provider address.
    -4             Force using IPv4.
    -6             Force using IPv6.



Perl Ping

NAME Net::Ping - check a remote host for reachability SYNOPSIS

        use Net::Ping;
        $p = Net::Ping->new();
        print "$host is alive.\n" if $p->ping($host);
        $p->close();
        $p = Net::Ping->new("icmp");
        $p->bind($my_addr); # Specify source interface of pings
        foreach $host (@host_array)
        {
            print "$host is ";
            print "NOT " unless $p->ping($host, 2);
            print "reachable.\n";
            sleep(1);
        }
        $p->close();
        $p = Net::Ping->new("tcp", 2);
        # Try connecting to the www port instead of the echo port
        $p->port_number(scalar(getservbyname("http", "tcp")));
        while ($stop_time > time())
        {
            print "$host not reachable ", scalar(localtime()), "\n"
                unless $p->ping($host);
            sleep(300);
        }
        undef($p);
        # Like tcp protocol, but with many hosts
        $p = Net::Ping->new("syn");
        $p->port_number(getservbyname("http", "tcp"));
        foreach $host (@host_array) {
          $p->ping($host);
        }
        while (($host,$rtt,$ip) = $p->ack) {
          print "HOST: $host [$ip] ACKed in $rtt seconds.\n";
        }
        # High precision syntax (requires Time::HiRes)
        $p = Net::Ping->new();
        $p->hires();
        ($ret, $duration, $ip) = $p->ping($host, 5.5);
        printf("$host [ip: $ip] is alive (packet return time: %.2f ms)\n",
                1000 * $duration)
          if $ret;
        $p->close();
        # For backward compatibility
        print "$host is alive.\n" if pingecho($host);

DESCRIPTION

This module contains methods to test the reachability of remote hosts on a network. A ping object is first created with optional parameters, a variable number of hosts may be pinged multiple times and then the connection is closed.

You may choose one of six different protocols to use for the ping. The "tcp" protocol is the default. Note that a live remote host may still fail to be pingable by one or more of these protocols. For example, www.microsoft.com is generally alive but not "icmp" pingable.

With the "tcp" protocol the ping() method attempts to establish a connection to the remote host's echo port. If the connection is successfully established, the remote host is considered reachable. No data is actually echoed. This protocol does not require any special privileges but has higher overhead than the "udp" and "icmp" protocols.

Specifying the "udp" protocol causes the ping() method to send a udp packet to the remote host's echo port. If the echoed packet is received from the remote host and the received packet contains the same data as the packet that was sent, the remote host is considered reachable. This protocol does not require any special privileges. It should be borne in mind that, for a udp ping, a host will be reported as unreachable if it is not running the appropriate echo service. For Unix-like systems see inetd(8) for more information.

If the "icmp" protocol is specified, the ping() method sends an icmp echo message to the remote host, which is what the UNIX ping program does. If the echoed message is received from the remote host and the echoed information is correct, the remote host is considered reachable. Specifying the "icmp" protocol requires that the program be run as root or that the program be setuid to root.

If the "external" protocol is specified, the ping() method attempts to use the Net::Ping::External module to ping the remote host. Net::Ping::External interfaces with your system's default ping utility to perform the ping, and generally produces relatively accurate results. If Net::Ping::External if not installed on your system, specifying the "external" protocol will result in an error.

If the "syn" protocol is specified, the ping method will only send a TCP SYN packet to the remote host then immediately return. If the syn packet was sent successfully, it will return a true value, otherwise it will return false. NOTE: Unlike the other protocols, the return value does NOT determine if the remote host is alive or not since the full TCP three-way handshake may not have completed yet. The remote host is only considered reachable if it receives a TCP ACK within the timeout specified. To begin waiting for the ACK packets, use the ack method as explained below. Use the "syn" protocol instead the "tcp" protocol to determine reachability of multiple destinations simultaneously by sending parallel TCP SYN packets. It will not block while testing each remote host. This protocol does not require any special privileges.
Functions

Net::Ping->new([proto, timeout, bytes, device, tos, ttl, family, host, port, bind, gateway, retrans, pingstring, source_verify econnrefused dontfrag IPV6_USE_MIN_MTU IPV6_RECVPATHMTU])

Create a new ping object. All of the parameters are optional and can be passed as hash ref. All options besides the first 7 must be passed as hash ref.

proto specifies the protocol to use when doing a ping. The current choices are "tcp", "udp", "icmp", "icmpv6", "stream", "syn", or "external". The default is "tcp".

If a timeout in seconds is provided, it is used when a timeout is not given to the ping() method (below). The timeout must be greater than 0 and the default, if not specified, is 5 seconds.

If the number of data bytes (bytes ) is given, that many data bytes are included in the ping packet sent to the remote host. The number of data bytes is ignored if the protocol is "tcp". The minimum (and default) number of data bytes is 1 if the protocol is "udp" and 0 otherwise. The maximum number of data bytes that can be specified is 65535, but staying below the MTU (1472 bytes for ICMP) is recommended. Many small devices cannot deal with fragmented ICMP packets.

If device is given, this device is used to bind the source endpoint before sending the ping packet. I believe this only works with superuser privileges and with udp and icmp protocols at this time.

If <tos> is given, this ToS is configured into the socket.

For icmp, ttl can be specified to set the TTL of the outgoing packet.

Valid family values for IPv4:

4, v4, ip4, ipv4, AF_INET (constant)

Valid family values for IPv6:

6, v6, ip6, ipv6, AF_INET6 (constant)

The host argument implicitly specifies the family if the family argument is not given.

The port argument is only valid for a udp, tcp or stream ping, and will not do what you think it does. ping returns true when we get a "Connection refused"! The default is the echo port.

The bind argument specifies the local_addr to bind to. By specifying a bind argument you don't need the bind method.

The gateway argument is only valid for IPv6, and requires a IPv6 address.

The retrans argument the exponential backoff rate, default 1.2. It matches the $def_factor global.

The dontfrag argument sets the IP_DONTFRAG bit, but note that IP_DONTFRAG is not yet defined by Socket, and not available on many systems. Then it is ignored. On linux it also sets IP_MTU_DISCOVER to IP_PMTUDISC_DO but need we don't chunk oversized packets. You need to set $data_size manually.
$p->ping($host [, $timeout [, $family]]);

Ping the remote host and wait for a response. $host can be either the hostname or the IP number of the remote host. The optional timeout must be greater than 0 seconds and defaults to whatever was specified when the ping object was created. Returns a success flag. If the hostname cannot be found or there is a problem with the IP number, the success flag returned will be undef. Otherwise, the success flag will be 1 if the host is reachable and 0 if it is not. For most practical purposes, undef and 0 and can be treated as the same case. In array context, the elapsed time as well as the string form of the ip the host resolved to are also returned. The elapsed time value will be a float, as returned by the Time::HiRes::time() function, if hires() has been previously called, otherwise it is returned as an integer.
$p->source_verify( { 0 | 1 } );

Allows source endpoint verification to be enabled or disabled. This is useful for those remote destinations with multiples interfaces where the response may not originate from the same endpoint that the original destination endpoint was sent to. This only affects udp and icmp protocol pings.

This is enabled by default.
$p->service_check( { 0 | 1 } );

Set whether or not the connect behavior should enforce remote service availability as well as reachability. Normally, if the remote server reported ECONNREFUSED, it must have been reachable because of the status packet that it reported. With this option enabled, the full three-way tcp handshake must have been established successfully before it will claim it is reachable. NOTE: It still does nothing more than connect and disconnect. It does not speak any protocol (i.e., HTTP or FTP) to ensure the remote server is sane in any way. The remote server CPU could be grinding to a halt and unresponsive to any clients connecting, but if the kernel throws the ACK packet, it is considered alive anyway. To really determine if the server is responding well would be application specific and is beyond the scope of Net::Ping. For udp protocol, enabling this option demands that the remote server replies with the same udp data that it was sent as defined by the udp echo service.

This affects the "udp", "tcp", and "syn" protocols.

This is disabled by default.
$p->tcp_service_check( { 0 | 1 } );

Deprecated method, but does the same as service_check() method.
$p->hires( { 0 | 1 } );

With 1 causes this module to use Time::HiRes module, allowing milliseconds to be returned by subsequent calls to ping().
$p->time

The current time, hires or not.
$p->socket_blocking_mode( $fh, $mode );

Sets or clears the O_NONBLOCK flag on a file handle.
$p->IPV6_USE_MIN_MTU

With argument sets the option. Without returns the option value.
$p->IPV6_RECVPATHMTU

Notify an according IPv6 MTU.

With argument sets the option. Without returns the option value.
$p->IPV6_HOPLIMIT

With argument sets the option. Without returns the option value.
$p->IPV6_REACHCONF NYI

Sets ipv6 reachability IPV6_REACHCONF was removed in RFC3542. ping6 -R supports it. IPV6_REACHCONF requires root/admin permissions.

With argument sets the option. Without returns the option value.

Not yet implemented.
$p->bind($local_addr);

Sets the source address from which pings will be sent. This must be the address of one of the interfaces on the local host. $local_addr may be specified as a hostname or as a text IP address such as "192.168.1.1".

If the protocol is set to "tcp", this method may be called any number of times, and each call to the ping() method (below) will use the most recent $local_addr. If the protocol is "icmp" or "udp", then bind() must be called at most once per object, and (if it is called at all) must be called before the first call to ping() for that object.

The bind() call can be omitted when specifying the bind option to new().
$p->message_type([$ping_type]);

When you are using the "icmp" protocol, this call permit to change the message type to 'echo' or 'timestamp' (only for IPv4, see RFC 792).

Without argument, it returns the currently used icmp protocol message type. By default, it returns 'echo'.
$p->open($host);

When you are using the "stream" protocol, this call pre-opens the tcp socket. It's only necessary to do this if you want to provide a different timeout when creating the connection, or remove the overhead of establishing the connection from the first ping. If you don't call open(), the connection is automatically opened the first time ping() is called. This call simply does nothing if you are using any protocol other than stream.

The $host argument can be omitted when specifying the host option to new().
$p->ack( [ $host ] );

When using the "syn" protocol, use this method to determine the reachability of the remote host. This method is meant to be called up to as many times as ping() was called. Each call returns the host (as passed to ping()) that came back with the TCP ACK. The order in which the hosts are returned may not necessarily be the same order in which they were SYN queued using the ping() method. If the timeout is reached before the TCP ACK is received, or if the remote host is not listening on the port attempted, then the TCP connection will not be established and ack() will return undef. In list context, the host, the ack time, the dotted ip string, and the port number will be returned instead of just the host. If the optional $host argument is specified, the return value will be pertaining to that host only. This call simply does nothing if you are using any protocol other than "syn".

When new had a host option, this host will be used. Without $host argument, all hosts are scanned.
$p->nack( $failed_ack_host );

The reason that host $failed_ack_host did not receive a valid ACK. Useful to find out why when ack($fail_ack_host) returns a false value.
$p->ack_unfork($host)

The variant called by ack with the "syn" protocol and $syn_forking enabled.
$p->ping_icmp([$host, $timeout, $family])

The ping method used with the icmp protocol.
$p->ping_icmpv6([$host, $timeout, $family]) NYI

The ping method used with the icmpv6 protocol.
$p->ping_stream([$host, $timeout, $family])

The ping method used with the stream protocol.

Perform a stream ping. If the tcp connection isn't already open, it opens it. It then sends some data and waits for a reply. It leaves the stream open on exit.
$p->ping_syn([$host, $ip, $start_time, $stop_time])

The ping method used with the syn protocol. Sends a TCP SYN packet to host specified.
$p->ping_syn_fork([$host, $timeout, $family])

The ping method used with the forking syn protocol.
$p->ping_tcp([$host, $timeout, $family])

The ping method used with the tcp protocol.
$p->ping_udp([$host, $timeout, $family])

The ping method used with the udp protocol.

Perform a udp echo ping. Construct a message of at least the one-byte sequence number and any additional data bytes. Send the message out and wait for a message to come back. If we get a message, make sure all of its parts match. If they do, we are done. Otherwise go back and wait for the message until we run out of time. Return the result of our efforts.
$p->ping_external([$host, $timeout, $family])

The ping method used with the external protocol. Uses Net::Ping::External to do an external ping.
$p->tcp_connect([$ip, $timeout])

Initiates a TCP connection, for a tcp ping.
$p->tcp_echo([$ip, $timeout, $pingstring])

Performs a TCP echo. It writes the given string to the socket and then reads it back. It returns 1 on success, 0 on failure.
$p->close();

Close the network connection for this ping object. The network connection is also closed by "undef $p". The network connection is automatically closed if the ping object goes out of scope (e.g. $p is local to a subroutine and you leave the subroutine).
$p->port_number([$port_number])

When called with a port number, the port number used to ping is set to $port_number rather than using the echo port. It also has the effect of calling $p->service_check(1) causing a ping to return a successful response only if that specific port is accessible. This function returns the value of the port that ping will connect to.
$p->mselect

A select() wrapper that compensates for platform peculiarities.
$p->ntop

Platform abstraction over inet_ntop()
$p->checksum($msg)

Do a checksum on the message. Basically sum all of the short words and fold the high order bits into the low order bits.
$p->icmp_result

Returns a list of addr, type, subcode.
pingecho($host [, $timeout]);

To provide backward compatibility with the previous version of Net::Ping, a pingecho() subroutine is available with the same functionality as before. pingecho() uses the tcp protocol. The return values and parameters are the same as described for the ping method. This subroutine is obsolete and may be removed in a future version of Net::Ping.
wakeonlan($mac, [$host, [$port]])

Emit the popular wake-on-lan magic udp packet to wake up a local device. See also Net::Wake, but this has the mac address as 1st arg. $host should be the local gateway. Without it will broadcast.

Default host: '255.255.255.255' Default port: 9

perl -MNet::Ping=wakeonlan -e'wakeonlan "e0:69:95:35:68:d2"'

NOTES

There will be less network overhead (and some efficiency in your program) if you specify either the udp or the icmp protocol. The tcp protocol will generate 2.5 times or more traffic for each ping than either udp or icmp. If many hosts are pinged frequently, you may wish to implement a small wait (e.g. 25ms or more) between each ping to avoid flooding your network with packets.

The icmp and icmpv6 protocols requires that the program be run as root or that it be setuid to root. The other protocols do not require special privileges, but not all network devices implement tcp or udp echo.

Local hosts should normally respond to pings within milliseconds. However, on a very congested network it may take up to 3 seconds or longer to receive an echo packet from the remote host. If the timeout is set too low under these conditions, it will appear that the remote host is not reachable (which is almost the truth).

Reachability doesn't necessarily mean that the remote host is actually functioning beyond its ability to echo packets. tcp is slightly better at indicating the health of a system than icmp because it uses more of the networking stack to respond.

Because of a lack of anything better, this module uses its own routines to pack and unpack ICMP packets. It would be better for a separate module to be written which understands all of the different kinds of ICMP packets.



Ping is a unix command (though also available on MS Windows) that helps determine the connectivity between two machines. It sends a small packet of data to a remote host which is expected to return it. Then the ping program can report how long did it take for the data to arrive back (the round-trip time) if it arrived at all. In order to determine if a packet has been lost or it is just taking a looong time to come back, the utility employs a timeout mechanism. If a packet does not return within the given timeout period, it is considered as lost. In the simplest example to check if a server is alive, we are only interested if the ping call returns true or false.
    #!/usr/bin/perl
    use strict;
    use warnings;
    use 5.010;
     
    use Net::Ping;
    my $p = Net::Ping->new();
    if ($p->ping('perlmaven.com')) {
       say 'alive';
    }

ping accepts the name of a host, or an IP address. In order to check what happens when the other machine does not answer try to supply an IP address that is not in use. For example I used the local IP '192.168.1.24'. if ($p->ping('192.168.1.24')) { You will notice that it takes quite some time for this to stop trying. In fact the default timeout of the ping method is 5 seconds. If you feel it is too much (or too little), you can also provide your own timeout by providing another number after the address. This is the length of the timeout in seconds. if ($p->ping('192.168.1.25', 1)) { Response time or round-trip time If we call the ping method LIST context, it will return 3 values: The return code (that was returned in SCALAR context as well), the elapsed time in seconds and the IP address of the host we provided.

    #!/usr/bin/perl
    use strict;
    use warnings;
    use 5.010;
     
    use Net::Ping;
    my $p = Net::Ping->new();
    my ($ret, $duration, $ip) = $p->ping('perlmaven.com');
    say $ret;
    say $duration;
    say $ip;

This is the result: $ perl ping.pl 1 0.19641900062561 173.255.196.65 In case the ping fails, the $ret will be 0, the $duration will show the elapsed time which is going to be quite close, but not exactly the timeout. The resolved IP address will be also returned: and the $ perl ping.pl 0 5.00060319900513 192.168.1.25 If there is some other problem, for example that the hostname cannot be resolved to an IP address, all 3 will be undef so before printing them we should probably check if they are defined. Pinging several times and calculating average The regular ping utilities usually either ping 3 times and calculate an average, or ping without any limit till the user presses Ctrl-c. The following example pings the $hostname $n times and then prints the average elapsed time. If some of the pings have not returned, it will also print the "packet loss ratio": The number of packets that have not received a reply divided by the number of packets sent.

    #!/usr/bin/perl
    use strict;
    use warnings;
    use 5.010;
     
    use Net::Ping;
    my $p = Net::Ping->new();
     
    my $hostname = 'perlmaven.com';
    my $n = 5;
     
    my $time = 0;
    my $success = 0;
    say "Pinging $hostname $n times";
    foreach my $c (1 .. $n) {
        my ($ret, $duration, $ip) = $p->ping($hostname);
        if ($ret) {
            $success++;
            $time += $duration;
        }
    }
    if (not $success) {
        say "All $n pings failed";
    } else {
        if ($success < $n) {
            say( ($n - $success), " lost packets. Packet loss ratio: ", int ( 100 * ($n - $success) / $n ));
        }
        say "Average round trip: ", ($time / $success);
    }

Script output. $ perl files/ping.pl Pinging perlmaven.com 5 times Average round trip: 0.277459192276001 Pinging multiple servers Checking if one server is alive is good, but I currently have 5 servers and it would be nice to ping all 5 of them to see if they are alive. Not a big issue. We just wrap most of the above code in a subroutine, appropriately named ping and then call that subroutine for each hostname.

    #!/usr/bin/perl
    use strict;
    use warnings;
    use 5.010;
     
    use Net::Ping;
    my $p = Net::Ping->new();
     
     
    my @hosts = map { "s$_.hostlocal.com" } (7, 8, 9, 11, 12);
    my $n = 5;
     
    foreach my $h (@hosts) {
        ping($h);
    }
     
    sub ping {
        my ($hostname) = @_;
        my $time = 0;
        my $success = 0;
        say "Pinging $hostname $n times";
        foreach my $c (1 .. $n) {
            my ($ret, $duration, $ip) = $p->ping($hostname);
            if ($ret) {
                $success++;
                $time += $duration;
            }
        }
        if (not $success) {
            say "All $n pings failed";
        } else {
            if ($success < $n) {
                say( ($n - $success), " lost packets. Packet loss ratio: ", int ( 100 * ($n - $success) / $n ));
            }
            say "Average round trip: ", ($time / $success);
        }
    }

The result looks like this $ time perl files/ping.pl Pinging s7.hostlocal.com 5 times Average round trip: 0.332317781448364 Pinging s8.hostlocal.com 5 times Average round trip: 0.231751680374146 Pinging s9.hostlocal.com 5 times Average round trip: 0.175983619689941 Pinging s11.hostlocal.com 5 times Average round trip: 0.190032911300659 Pinging s12.hostlocal.com 5 times Average round trip: 0.0929935455322266 real 0m5.181s user 0m0.053s sys 0m0.017s With 5 hosts it might not be bad, but there is one main issue that impacts us as the number of hosts grow. We check the hosts sequentially. One after the other. The total elapsed time is the sum of the time spent with each host. (At first when I saw the above results I was a bit surprised, but then I remembered the numbers printed there are averages of 5 pings so the total time is 5 times longer for each host meaning 0.5-1.5 second per host.


Pinging a Machine

You want to test whether a machine is alive. Network and system monitoring software often use the ping program as an indication of availability.

Use the standard Net::Ping module:

    use Net::Ping;

    $p = Net::Ping->new( )
        or die "Can't create new ping object: $!\n";
    print "$host is alive" if $p->ping($host);
    $p->close;

Testing whether a machine is up isn't as easy as it sounds. It's not only possible but also unpleasantly common for machines to respond to the ping command when they have no working services. It's better to think of ping as testing whether a machine is reachable, rather than whether the machine is doing its job. To check the latter, you must try its services (Telnet, FTP, web, NFS, etc.).

In the form shown in the Solution, Net::Ping attempts to connect to the TCP echo port (port number 7) on the remote machine. The ping method returns true if the connection could be made, false otherwise.

You can also ping using other protocols by passing the protocol name to new. Valid protocols are tcp, udp, syn, and icmp (all lowercase). A UDP ping attempts to connect to the echo port (port 7) on the remote machine, sends a datagram, and attempts to read the response. The machine is considered unreachable if it can't connect, if the reply datagram isn't received, or if the reply differs from the original datagram. An ICMP ping uses the ICMP protocol, just like the ping(8) command. On Unix machines, you must be the superuser to use the ICMP protocol:

    # use TCP if we're not root, ICMP if we are
    $pong = Net::Ping->new( $> ? "tcp" : "icmp" );

    (defined $pong)
        or die "Couldn't create Net::Ping object: $!\n";

    if ($pong->ping("kingkong.com")) {
        print "The giant ape lives!\n";
    } else {
        print "All hail mighty Gamera, friend of children!\n";
    }

A SYN ping is asynchronous: you first send out many ping s and then receive responses by repeatedly invoking the ack method. This method returns a list containing the hostname, round-trip time, and the IP address that responded:

    $net = Net::Ping->new('syn');
    foreach $host (@hosts) {
      $net->ping($host);
    }
    while (($host, $rtt, $ip) = $net->ack( )) {
      printf "Response from %s (%s) in %d\n", $host, $ip, $rtt;
    }

Most machines don't take a second or more to set up a TCP connection. If they did, you'd find web browsing painfully slow! To get anything but 0 second round-trip times back from this test, you need more granularity in your time measurements. The hires method uses Time::HiRes (see Recipe 3.9) to measure ACK times. The following code snippet enables high-resolution timers (changed code appears in bold):

    $net = Net::Ping->new('syn');
    $net->hires( );              # enable high-resolution timers
    foreach $host (@hosts) {
      $net->ping($host);
    }
    while (($host, $rtt, $ip) = $net->ack( )) {
      printf "Response from %s (%s) in %.2f\n", $host, $ip, $rtt;
    }

The value in $rtt is still in seconds, but it might have a decimal portion. The value is accurate to milliseconds.

If using TCP to ping, set the port that Net::Ping uses. This might mean a service is present although any industrial-grade monitoring system will also test whether the service responds to requests:

    $test = Net::Ping->new('tcp');
    $test->{port_num} = getservbyname("ftp", "tcp");
    if (! $test->ping($host)) {
      warn "$host isn't serving FTP!\n";
    }

All these ping methods are prone to failure. Some sites filter the ICMP protocol at their router, so Net::Ping would say such machines are down even though you could connect using other protocols. Similarly, many machines disable the TCP and UDP echo services, causing TCP and UDP pings to fail. There is no way to know whether the ping failed because the service is disabled or filtered, or because the machine is actually down.


 Nothing works / My Apache server will not start? If Apache does not start, you may running a web server, your Firewall may be blocking access, the Port (4444) may be in use, or your Shortcuts may not be working properly. You can start Apache in a DOS window so that some status is provided.

If you are running a web server it must be stopped or configured to access the SAT web portal using the URL address of z-cassbeth/sat/index.html. We STRONGLY suggest you find the running web server and stop it, unless YOU actually started it in the first place.

You can download and use wed servers from www.apache.org or www.indigostar.com or use your Microsoft Web Server. It sounds like you may be using your Microsoft Web server or some downloaded artifact. If you wish to go down this path then, install / configure your web server and verify that the web server works by accessing the default page. After you install and configure your web server you will need to add the "local web address" for SAT on your computer. For IndigoStar go to the <conf> directory open the <PerlConsole.conf> file, search for "aliases", you will come across a pattern as follows, assuming you installed it in an <IndigoPerl> directory:

  Alias /icons/ "C:/IndigoPerl/icons/"
  #ISEXT
  Alias /html "C:/IndigoPerl/perl/html"
  Alias /~sat "C:/z-cassbeth/sat" 

add the last line: Alias /~sat "C:/z-cassbeth/sat" and save the file. Restart the web server and it will load the modified file. Access SAT using your new URL: http://localhost:4444/~sat. For Apache go to the <conf> directory open the <httpd.conf> file and follow the same general steps as for IndigoPerl.

 I want to start Apache in a DOS window and get some status on why it does not work?

Go to z-cassbeth/ . . . /Apache/bin and open a DOS window. Type <apache> and look at the response. If there is no response then Apache should be started and running. You can verify if its running by pressing Cntrl ALT DEL at the same time and examine your running processes in the process tab. If Apache is running, all is good.

While you are here type apache -h. This will list all the Apache commands. CAUTION do not start Apache as a service unless you are prepared to learn how to Stop Apache Service.

 My Firewall may be blocking Access?

Start Apache in a DOS window. If you get a message back, Apache did not start. If the message says something like "unable to open sockets" then your firewall is blocking access. Even though this Apache instance is running on your local machine and the httpd.conf file has no directives to allow others to access your computer, it uses Internet technologies and your fire wall assumes it is accessing the Internet. You will need to access your firewall controls and get to the list where you see the names of applications that are permitted to access the Internet and those that are BLOCKED. If you see Apache, remove the block.

 My Port is in use?

Start Apache in a DOS window. If you get a message back, Apache did not start. If the message says something like "4444 port in use" then either you already started the Apache server for SAT or there is another application using port 4444. Unfortunately port 4444 is hardcoded in our application so you will need to change the port number of the other application or stop it while you use this Apache server instance.

 Apache works in DOS but not from my Shortcuts?

Start Apache in a DOS window. Next try to use your shortcuts to start SAT. If you get error messages in the DOS window created to start Apache but not when you started it manually in DOS then your shortcuts are bad. Just recreate the shortcuts and place them in the start menu. Make sure you delete the bad shortcuts. The Icon images are located in z-cassbeth/ico.

 Why do I have a DOS Window - Stop Apache Service?

The Apache DOS window started with SAT is used to execute your Apache server. Minimize it if it disturbs you... We wanted a very simple mechanism to guarantee that Apache would stop when you wanted it stopped. The philosophy behind web servers are that they should always run because other computers on the network may need their services. So if you start Apache as a service, you will have difficulty stopping Apache. In fact to stop Apache, or any other server, you may need to rename the httpd.conf file. After you rename httpd.conf, go through the official Apache uninstall and stop command sequences, and reboot. After this sequence Apache should not restart behind the scenes.


Installation and License

Copyright (c) 2005 Cassbeth Inc - All Rights Reserved
http://www.cassbeth.com

CONTENTS

I. SAT INSTALL
II. OPERATING WITH YOUR WEB SERVER
III. SAT UNINSTALL
IV. LICENSE AGREEMENT

I. SAT INSTALL

Your SAT is compiled to execute on a PC. It uses a web server and browser to support its operations.

1. To install SAT, run installsat.exe or unzip the file.

2. Do NOT rename the z-cassbeth directory.

3. NMT has internal hyper links to NMT directories.

4. Do NOT rename any other lower level NMT directories.

5. Feel free to create directories within NMT.

6. Complete the install by starting NMT.

7. You will enter your product key and accept the license.

II. OPERATING WITH YOUR WEB SERVER

1. NMT is bundled with the Apache web server.

2. The bundled software license agreements can be found in their respective directories.

3. It will start automatically and open the main NMT web page.

4. If Apache does not start, you are currently running a web server and it must be stopped or configured to access the NMT web portal at z-cassbeth/sat/index.html. See Nothing Works HELP

III. SAT UNINSTALL

1. Move your personal NMT generated data to an area outside of z-cassbeth.

2. Run the uninstall, and z-cassbeth with all its contents will be removed.

IV. LICENSE AGREEMENT

License

It is simple. This is a free tool except for companies that are for profit.


Cassbeth Inc. Copyright © 1997 - 2020 All Rights Reserved.