I use the Net::Ping in NT everyday. I wrote a small system monitoring package that checks hosts via ping, telnet, http, and dbi. The script just runs a loop and checks different hosts with different methods, logs any failures, and pages me if it's down more than once.

Here is the relevant ping code. This works on NT with the activestate perl and the Net::Ping package installed with the ppm tool. I had no problems with alarm. The only problem I've had with Net::Ping is that it requires root when running in unix...

#!/usr/bin/perl @pinglist=("www.yahoo.com", "www.thisisntreal.com", "wlindsey.bbcg.com +"); use Net::Ping; sub test_ping; foreach $h (@pinglist) { if (test_ping($h)) { print "[p (ok) $h]"; } else { print "[p <NO> +$h]"; } print "\n"; } sub test_ping { # test_ping($hostname) my $hostname=shift; my $p=Net::Ping->new(icmp,5); return $p->ping($h,5); $p->close; } # end test_ping

In reply to Re: Alarm Implemented in Win32? by elwarren
in thread Alarm Implemented in Win32? by buzzcutbuddha

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.