<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3268" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=169070317-11042008><FONT face=Arial
color=#0000ff size=2>My local computer is Windows XP, using Putty to ssh into my
Linux box (which runs Hobbit). VI on Linux, highlight, then cut-n-paste
into an Outlook 2003 reply to the Hobbit mailing list. I have only noticed
this formatting problem when posting code to this Hobbit list. It's
probably some text-only email line-wrap formatting option I have set in
Outlook. It's not an issue in HTML email (which I hate, but when in Rome,
do as the Romans do, and HTML email is what most everybody in my company
uses). I had to grudging give up on Thunderbird and move to Outlook so I
could easily deal with all the other Windows-loving coworkers and their Outlook
calendar meeting invites.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=169070317-11042008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=169070317-11042008><FONT face=Arial
color=#0000ff size=2>I'll check my Outlook text settings again. There's
probably something in there that I missed.</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Josh Luthman
[mailto:josh@imaginenetworksllc.com] <BR><B>Sent:</B> Friday, April 11, 2008
10:56 AM<BR><B>To:</B> hobbit@hswn.dk<BR><B>Subject:</B> Re: [hobbit] Hobbit
client executing a script to be proactive if a problem
occurs?<BR></FONT><BR></DIV>
<DIV></DIV>Assuming you're using SSH - what SSH client are you pasting
from? The formating would be put in the buffer from the client, not VI at
all.<BR><BR>I use puTTY and the formatting works perfectly for me.<BR><BR>
<DIV class=gmail_quote>On Fri, Apr 11, 2008 at 12:51 PM, Haertig, David F (Dave)
<<A href="mailto:haertig@avaya.com">haertig@avaya.com</A>> wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Sorry
about the formating of the code I sent. I don't know why I
can't<BR>successfully cut-n-paste from vi on Linux into Outlook on Windows
and<BR>not get screwed up format-wise. I guess if you know Hobbit alert
syntax<BR>and PERL, they you can figure it out easy enough.<BR>
<DIV class=Ih2E3d><BR>-----Original Message-----<BR>From: Haertig, David F
(Dave) [mailto:<A
href="mailto:haertig@avaya.com">haertig@avaya.com</A>]<BR>Sent: Friday, April
11, 2008 10:30 AM<BR>To: <A
href="mailto:hobbit@hswn.dk">hobbit@hswn.dk</A><BR></DIV>
<DIV>
<DIV></DIV>
<DIV class=Wj3C7c>Subject: RE: [hobbit] Hobbit client executing a script to be
proactive<BR>if a problem occurs?<BR><BR>Here is how I execute a remote
"pkill" on a client. Replace<BR>"client_server" with your client
hostname, and replace "client_userid"<BR>with the userid (on the client) that
you want to run the script (pkill)<BR>under. Also, set up ssh pubkey
authentication between the Hobbit server<BR>and client so that ssh does not
prompt you for a
password.<BR><BR><BR>hobbit_alerts.cfg:<BR><BR>##############################<BR>$KILL_SCRIPT=/hobbit/server/ext/kill_script<BR>HOST=client_server
SERVICE=procs COLOR=red<BR> SCRIPT $KILL_SCRIPT
client_server,client_userid,grep_pattern<BR>##############################<BR><BR><BR><BR>/hobbit/server/ext/kill_script:<BR><BR>##############################<BR>#!/bin/perl<BR>#$debug++;
# Comment-out this line for normal operation<BR>($host,
$userid, $pattern) = split(/,/, $ENV{RCPT}, 3); exit unless<BR>((defined
$host) && (defined $userid) && (defined $pattern)); $command
=<BR>qq!ssh $userid\@$host "pkill -f '$pattern'"!; if ($debug) {<BR>
$command =~ s/pkill/pgrep -l/;<BR>
print `$command`;<BR>}<BR>else {<BR>
`$command`;<BR>}<BR>##############################<BR><BR><BR><BR>And
here is how I execute an arbitrary script on the client (in this<BR>example,
"weblogics_kill_script"). It is a minor modification of
the<BR>above:<BR><BR><BR>hobbit_alerts.cfg:<BR><BR>##############################<BR>$REMOTE_SCRIPT=/hobbit/server/ext/remote_script<BR>HOST=ssdpws001
SERVICE=weblogics COLOR=red<BR> SCRIPT
$REMOTE_SCRIPT<BR>client_server,client_userid,/export/home/hobbit/scripts/weblogics_kill_s<BR>cript<BR>##############################<BR><BR><BR>Note:
weblogics_kill_script exists on the client - I use it to force a<BR>few thread
dumps, archive logfiles, and then kill/restart
weblogics<BR><BR>/hobbit/server/ext/remote_script:<BR><BR>##############################<BR>#!/bin/perl<BR>#$debug++;
# Comment-out this line for normal operation<BR>($host,
$userid, $script) = split(/,/, $ENV{RCPT}, 3); exit unless<BR>((defined $host)
&& (defined $userid) && (defined $script)); $command
=<BR>qq!ssh $userid\@$host "$script"!; if ($debug) {<BR>
print `$command`;<BR>}<BR>else {<BR>
`$command`;<BR>}<BR>##############################<BR><BR><BR>-----Original
Message-----<BR>From: Chris Wopat [mailto:<A
href="mailto:chrisw@supranet.net">chrisw@supranet.net</A>]<BR>Sent: Friday,
April 11, 2008 7:56 AM<BR>To: <A
href="mailto:hobbit@hswn.dk">hobbit@hswn.dk</A><BR>Subject: [hobbit] Hobbit
client executing a script to be proactive if a<BR>problem
occurs?<BR><BR>Hello,<BR><BR>I've been running hobbit for a few years, after
converting from Big<BR>Brother. I actively use it to monitor hundreds of
hosts, send alerts,<BR>etc. However, one thing I have yet to do is use any
custom scripts for<BR>anything. Looking at docs, I see two ways that scripts
are called:<BR><BR>1) an alert can call a script instead of email directly.
This script is<BR>passed variables, and just about anything can be done *on
the hobbit<BR>server* from here.<BR><BR>2) A script can be launched on the
client, from ext/, when the hobbit<BR>clien starts. This script is generally
used to add another column to<BR>hobbit.<BR><BR>What I'd like to do is execute
a script *on the client* when an alert<BR>has happened. Say, if CPU goes red
on something, I'd like a script to<BR>run on the cilent. I could force the
issue with #1 above, but this seems<BR>like it would invovle the server having
the script, likely having SSH<BR>keys setup to get into the client, then run
the script.<BR><BR>Is there a cleaner way built in that will just say "if
service FOO is<BR>red then on client run script
ext/BAR.sh"?<BR><BR>Thanks<BR>--Chris<BR><BR>To unsubscribe from the hobbit
list, send an e-mail to<BR><A
href="mailto:hobbit-unsubscribe@hswn.dk">hobbit-unsubscribe@hswn.dk</A><BR><BR><BR><BR>To
unsubscribe from the hobbit list, send an e-mail to<BR><A
href="mailto:hobbit-unsubscribe@hswn.dk">hobbit-unsubscribe@hswn.dk</A><BR><BR><BR><BR>To
unsubscribe from the hobbit list, send an e-mail to<BR><A
href="mailto:hobbit-unsubscribe@hswn.dk">hobbit-unsubscribe@hswn.dk</A><BR><BR><BR></DIV></DIV></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR>Josh Luthman<BR>Office: 937-552-2340<BR>Direct:
937-552-2343<BR>1100 Wayne St<BR>Suite 1337<BR>Troy, OH 45373<BR><BR>Those who
don't understand UNIX are condemned to reinvent it, poorly.<BR>--- Henry Spencer
</BODY></HTML>