Support Forums

Welcome to Support Forums Sign in | Join | Help
in
Home Forums

Ping Discovery

Last post 09-08-2006, 5:03 PM by Chris. 0 replies.
Sort Posts: Previous
  • Ping Discovery

     09-08-2006, 5:03 PM

    Attachment: PingDiscovery.zip

    Hi All,

    As a followup to my IRAC Scripts post, some people might want a way to automate the creation of the IRACHosts.log file of IP Addresses. Here's some quick code to do just that.

    ---------Start Script-----------

    # ======================================================================

    #

    # NAME: PingDiscovery.pl

    #

    # AUTHOR: Original code posted by Steve Kemp on Debian Administration

    # Web Site

    # DATE : 8/14/2006

    #

    # PURPOSE: Discover "live" systems via ping within a given range.

    #

    # ======================================================================

    #!/usr/bin/perl -w

    use Net::Ping;

    # ============ Change output file for hosts here ==================

    $outfile = 'c:\ProDiscover\ProScript\Output\IRACHosts.log';

    open(OUT,">$outfile") || PSDiplayText("Could not open $outfile: $!");

    my $LAN = "192.168.75.";

    foreach my $octet (1 .. 255)

    {

    my $pinger = Net::Ping->new();

    if ( $pinger->ping( $LAN . $octet ) )

    {

    print $LAN . $octet . "\n";

    print OUT $LAN . $octet . "\n";

    }

    $pinger->close();

    }

    close(OUT);

    ---------End Script ------------

    To Do: It would be great of someone could update this to use NMAP's fingerprinting to collect only Windows hosts.

View as RSS news feed in XML