Hello,

I have a few little perl programs which watch system logfiles (eg. /var/log/maillog) and log certain things into a database. However, these little programs have been known to just suddenly die in the past.

My company is becoming more reliant on these programs (they were initially simple testing tools) and want to monitor them so that they can be restarted if they die. However, they wish to control this from their 'network monitor' machine.

The 'network monitor' sits on a machine and watches various services running on various servers using TCP, UDP or ICMP tests. I have been given the challenge to get my programs to work with this setup.

My current suggestion is to fork/thread/whatever a little TCP or UDP client from my programs which would then respond to the monitoring machine's requests. In people's opinions, how good is this solution?

I suppose my other approach would be to ignore that the 'network monitor' exists and run my own monitoring script which would restart the programs should they die. One way to do this would be to simply watch the output of 'ps', but I'm after a more Perl-based solution. Comments?

fx


In reply to External monitoring of a Perl program by fx

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.