[hobbit] hobbitfetch replacement with ssh

Haertig, David F (Dave) haertig at avaya.com
Sat Jun 23 04:37:55 CEST 2007


Yes, this wasn't terribly hard at all, now was it?  I feel dumb.
 
Server script (still need to beef it up with error checking):
 
export SOCKS5_USER=xxx
export SOCKS5_PASSWD=xxx
export DMZ_MACH=my.machine.dmz
export TMPFILE=something_or_other
runsocks scp ${DMZ_MACH}:tmp/msg.${DMZ_MACH}.txt ${TMPFILE}
${BB} $(BBDISP} "`cat ${TMPFILE}`"
rm -f ${TMPFILE}
 
The one thing I appears to be missing doing things like this is that
"[Client data available]" link on the generated webpages.  I don't know
why that's missing yet.
 
And I also need to investigate the possible problems of having the
client script and the server script run asynchronously.  It may be
possible to upload the same msg.XXX.txt file twice in a row if
timings/delays fall just right.  I need to see how that would affect the
RRD/graphing part of Hobbit.  It might confuse the heck out of it.
 
I'm getting there in my quest for an ssh replacement for hobbitfetch.
But comments and suggestions still greatly appreciated!
 
Thanks

________________________________

From: Haertig, David F (Dave) [mailto:haertig at avaya.com] 
Sent: Friday, June 22, 2007 8:11 PM
To: hobbit at hswn.dk
Subject: RE: [hobbit] hobbitfetch replacement with ssh


Oops.  Looks like I missed the obvious (again!).
 
bb accepts a message of type "client".  What do you bet I've answered my
own question here? (again!)  I think I'll try a "client" message, and I
bet I'll be pleasantly surprized.
 
And if anyone wants to know the answer to the question running around in
your minds ... YES, it does hurt to be this stupid!  Ouch!  ;-)
 
Thanks

________________________________

From: Haertig, David F (Dave) [mailto:haertig at avaya.com] 
Sent: Friday, June 22, 2007 7:27 PM
To: hobbit at hswn.dk
Subject: [hobbit] hobbitfetch replacement with ssh


I'm still thinking about my hobbitfetch/msgcache replacement I asked
about a few weeks ago.  Using only ssh from the Hobbit server.  Client
machine is out in DMZ, thus unable to talk to Hobbit server.  I cannot
run a listener (msgcache) on the client (policy reasons, not technical
ones).
 
Here are my thoughts.  Maybe someone can expand on them or suggest a
different approach.
 
(1) Run normal Hobbit client on DMZ machine.
(1a) Client appears to collect data just fine into
~hobbit/tmp/msg.XXX.txt
(1b) Client would try to connect to Hobbit server to transmit this file,
and fail.  Fine.  Let it fail.  It appears to do so gracefully.
Question: Any simple way to make it stop trying to connect and still
behave gracefully?  chmod 000 ~hobbit/bin/bb?  Change BBDISP="" in
~hobbit/etc/hobbitclient.cfg?
 
(2) Create a Hobbit server script to use socks/ssh to retrieve that
~hobbit/tmp/msg.XXX.txt file from the client machine (it's trivial to
write such a thing)
 
(3) Have this server script feed the raw data retrieved in step (2) into
the Hobbit listener (which would be localhost:1984), such that it
appears to the Hobbit listener the data came in from the client computer
in the normal manner.
 
Step (3) is what I don't quite know how to implement yet.  I'm familiar
with using the bb command to send messages, but those are formatted
messages, not raw data as would be present in the retrieved msg.XXX.tmp
file.  I want to assure that the guts of the Hobbit server processes
this proxied client raw data just as if the client had sent it instead
of my custom server script.
 
Is there some trivial way to accomplish (3) that I'm just missing
searching through the man pages?  I could have my custom server script
parse the raw data itself and then create individual Hobbit messages (to
send via the bb command), but that sounds like I'd be reinventing the
wheel.  Hobbit server processes already know how to parse this data ...
if I could just tap into that part of it.
 
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20070622/9a35f84c/attachment.html>


More information about the Xymon mailing list