Hmmm - very nice code and perl usage at all BIG ++

... but to get the same result you don't have to run such 'combinations'... maybe i should not write this as this is Perlmonks but using Perl should make our life easier... and sometimes not-using Perl does the same :-/

Fast and tested solution... register yourself with dyndns or no-ip system or anything like this (it's free)... and set your DNS properly:
hostname.my.domain. IN CNAME dynamic.update.domain. hostname.my.domain. IN MX 1 hostname.my.domain.
then point the MX to the same host (as shown above)... all of the systems provide free tools for updating it's entries... and to do it Perl-ish way, use Net::DNS::DynDNS :-)

The task now is to get the information about IP change no later than a few seconds after it has changed... without constantly querying the router or blindly updating the dns database without checking if it was necesery. Eventually your host will be inaccessible for some time (but anyway much shorter than waiting for the ISP staff to change the DNS entries and reload configuration).

I hope i won't get downvoted (too much) for describing non-Perl solution, hehe...

Greetz, Tom.

In reply to Re: Nagios plugin to detect changed IP address of WRT54G router. - TIMTOWTDI by tmiklas
in thread Nagios plugin to detect changed IP address of WRT54G router. by blue_cowdawg

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.