After looking through the code, and then astutely reading the README, I saw the following:

If you are installing the server, you need to put in in inetd. A +line like this one should cut the mustard: nrpep stream tcp nowait nobody /usr/sbin/tcpd /usr/sbin/nrpe +p -c /usr/local/nagios/etc/nrpep.cfg (All one line) The "nrpep" part is an entry in /etc/services for the port that nr +pep needs to run on. The "default" is 8086. I pulled it out of my a +ss. If it conflicts with anything, let me know. Otherwise, that's t +he default. An example: nrpep 8086/tcp


So, although I haven't done any socket programming using inetd, I'm going to make a big assumption that inetd is in fact handling the listening server socket and passing the info to what appears to be <STDIN> and <STDOUT> for the nrprep server.

In looking at the check_nrprep code, it does a use Socket; right near the start. The client opens a socket connection and goes out to the server that is already listening via inetd.

Hope that explains it (also hope I was right!)

In reply to Re: nrpep: client-server program by hubb0r
in thread nrpep: client-server program by rhymejerky

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.