pcp
[Top] [All Lists]

[PATCH] pmie support for stomp messages

To: Michael Newton <kimbrr@xxxxxxx>, Mark Goodwin <markgw@xxxxxxx>
Subject: [PATCH] pmie support for stomp messages
From: Nathan Scott <nscott@xxxxxxxxxx>
Date: Thu, 30 Nov 2006 12:06:56 +1100
Cc: pcp@xxxxxxxxxxx
Organization: Aconex
Reply-to: nscott@xxxxxxxxxx
Sender: pcp-bounce@xxxxxxxxxxx
Hi all,

The following patch adds pmie support for the "Streaming Text Orientated
Messaging Protocol" - see (http://stomp.codehaus.org/) - which allows us
to generate performance events from pmie, pass them to a JMS server that
talks STOMP, and then share those events with (many) interested parties.

The implementation here extends the pmie language by adding a "stomp"
action for rules (in addition to the current syslog, print, alarm, etc).
If any "stomp" actions are presented in the pmie configuration file, we
connect to the JMS server from /var/lib/pcp/config/pmie/stomp on startup
(or fail).  Truthful stomp rule evaluation results in the user-defined
message being sent to the server at that time.  There is logic also to
attempt reconnection to the JMS server should it be unavailable (this
uses an "opportunistic" approach - only when a stomp rule evaluates to
true, and at most one reconnect attempt per minute).

Here's some example rules, monitoring our production machines atm:

shell_ping_commands_bad = some_inst (
    nomatch_inst "mel-http*" (shping.status > 0)
) -> print "ERROR: %i command unsuccessful\n"
   & stomp "ERROR: Shell Ping: %i command unsuccessful\n";

http_login_success = some_inst (
    shping.status #'mel-http' #'mel-https' > 0
) -> print "ERROR: %i failed to login, instance is down\n"
   & stomp "ERROR: Shell Ping: %i failed to login, instance is down\n";

Finally, there's another piece of software to "catch" the events being
made available by the JMS server - in our case, we have a Java applet
that uses JDIC to integrate into the desktop control panel and provide
balloon popups when rules are triggered (as well as a small amount of
event history, and severity thresholds).  Thats written in Java though,
so we'll add a SourceForge PCP add-on project for that (its completely
independent, and doesn't really belong in PCP itself).

This patch adds no new dependencies on PCP/pmie though, it uses only
POSIX APIs already used by pmie and libpcp.

cheers.

-- 
Nathan

Attachment: stomp-pmie-final
Description: Text Data

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] pmie support for stomp messages, Nathan Scott <=