activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geurt Schimmel <GSchim...@schubergphilis.com>
Subject RE: Remote Shell via AMQ possible ?
Date Fri, 09 Nov 2012 10:04:33 GMT
Format of my message:
nagios update test.rrd -t Duration N:714 

 <route>
      <description>RRD processing</description>
      <from uri="activemq:queue:LOCAL.RRD.hosta"/>
      <recipientList>
        <simple>exec:///opt/tools/sysadmin/bin/rrdtool_wrapper.sh?args=${body}</simple>
      </recipientList>
    </route>

rrdtool_wrapper.sh:

>cat rrdtool_wrapper.sh
#!/bin/sh
args=$*
set $args
user=$1
shift
/bin/su - $user -c "/usr/bin/rrdtool.bin $*"

As a result, the Exec-component will eventually execute
/bin/su - nagios -c "/usr/bin/rrdtool.bin update test.rrd -t Duration N:714"

But as Raoul stated - be careful, as it's very easy to piggy-back commands. A shell-script
is in fact not a good idea at all, but it gives you an idea.

Have fun,
Geurt

-----Original Message-----
From: c031917 [mailto:peter.marx@knorr-bremse.com] 
Sent: Friday, November 09, 2012 9:25 AM
To: users@activemq.apache.org
Subject: Re: Remote Shell via AMQ possible ?

Hi,

yes, we use Camel / AMQ and honestly I missed the existence of the camel-exec component.

Still impressive to find out the capabilities of Camel !

Security won't be an issue hopefully, as the two brokers talk only via two-way certificate
ssl link.

Reading the doc it looks like only predefined commands can be executed. 

That will help a little, but may be too inflexible. 

I'm behind a full duplex terminal session, running over messages, similar to the Jabber example

in the AMQ book.

Or could I connect to something like:  
http://code.google.com/p/xmpp-ssh/downloads/list
<http://code.google.com/p/xmpp-ssh/downloads/list>   ?

Preferred client would be stuff like PuTTY. On the other side I don't have a clue what's necessary,
but probably you don't get away with what's available on a standard Linux (debian in our case).

Any ideas ?



--
View this message in context: http://activemq.2283324.n4.nabble.com/Remote-Shell-via-AMQ-possible-tp4659008p4659096.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message