Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://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 => 'my_bb_server.domain.biz', 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.

Thanks!

David


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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-16 19:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found