Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

A really sharp architect named Jeremy Bumpus once showed me that it was straightforward to write a script that could speak with a Big Brother server, and thus do tests independent of the BB client. The advantage, of course, is that you don't have to jump through hoops to get the bb user to run tests that only a privileged user should. The code uses IO::Socket, which has been a part of every Perl I've tested, even stripped down system Perls.

A bit of test code (half pseudocode) might look something like this:
my $bbhost = $ENV{BBHOST}; my $machine = `hostname`; chomp($machine); if ( -f $bbhost/etc/bbaliasname ) { # fetch aliasname and assign it to machine. } # $test would be the name of the test as BB displays it. my $test = "app"; # green, yellow and red are alert levels. my $color = 'green'; # # run test here, reset color if necessary # my $conn = new IO::Socket::INET ( PeerAddr => '', PeerPort => '1984', Proto => 'tcp', ) || warn("Cannot create socket to port 1984 on localhost\n"); my $date = `date`; print $conn "status $machine.$test $color $date "; print $conn "test blah blah blah.\n"; print $conn "moretestinfo"; close($conn);

The cool thing about this test is that it can be run on servers that don't have a compiler (the ordinary BB client install requires cc and make), leading to the notion that the whole bb-local client piece could be replaced with a pure Perl solution on servers for which, for business reasons, you can't install a compiler and for which you have no dev or QA systems to compile from.

And since I've written some tests of this kind for Big Brother, it's making me wonder how much of this technology is transferrable to Nagios. Yes, things aren't entirely thought out or thought through, and I'm fishing for ideas here, particularly from the Perl enabled folks who might understand Nagios client to server protocols.

All I'm trying to do is push some useful tests across a broad heterogenous enterprise, where the monitoring solution in place can go from Big Brother to Big Sister to free Nagios to commercial Nagios to Icinga to Zenoss. Some Perl tools for Joe Admin would be appreciated.



In reply to Pure Perl Big Brother and Nagios clients: ideas? code bits? by dwm042

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (8)
    As of 2017-01-22 22:27 GMT
    Find Nodes?
      Voting Booth?
      Do you watch meteor showers?

      Results (190 votes). Check out past polls.