That's good to know. I never really went back to optimize the code, I was happy enough that I could run it on my NT machine at work. We had a server that kept crashing at different times, usually when nobody was looking :-) I threw this together to ping it every 5 minutes and it sort grew into a tool that did a few different checks. I put all the code into functions that handle creating the objects, connecting, checking the results, cleaning up and then returning a pass or fail. Each connection type has it's own special quirks hidden behind the function, so I can just as easily drop in a test_ping($hostname) as I could test_http($hostname)

For a script that sits idle and wakes up every 5 minutes it's an acceptable slowdown ;-)

Oh, and it ended up being a bad ups on the server...


In reply to RE: RE: 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.