[SATLUG] Multitail via SSH

c P sargonemail at gmail.com
Wed Dec 1 17:46:17 CST 2010

>> I don't want it tailed out to a TTY, I want it "protected" in some way.
>> Do you think there is a way to redirect the output of multitail to a place that could
>> only be accessible via a SSH login, perhaps by tying the multitail
>> output somehow to a command that runs as the shell when the user logs in?
>> David
Keep in mind all multitail does is process, then displays the file(s)
per "sed like" rules;
while allowing the results of different rules to be displayed in same
or different screen
window areas.  I suggested exporting the "files" via ssh to a single
box, means that
you'll be running one instance of multitail, w/o needing to log into
multiple accounts/boxes (and consequently set up multiple multitail
rules on each box)

Following the original outline, the following variables are defined as:

>Ok, Dave,
>Looking at this from a scripted one-liner, what you want can be done
>(assuming ssh is setup correctly) as a command line:
>See prior postings for question to ask to fill in the variables (or
>check out the url/man pages!)
>It's protected, multitail output is redirect to the box you started
>ssh on, you login using ssh which runs multitail.  It's quicker to
>setup than the other posted stuff, once questions are asked. :)
>Yes, there are specific options to get this to work/work correctly on
>the command line.
>------------------------- cut -------------------------------------------
>echo -n "Enter the machine name to view logs on. "
>read HOST ; echo "Starting multitail of ${HOST}."
>#multitail config file of ${HOST} is used!
>#Use the following in .screenrc to startup a "host per tty"
># with screen (removing the xterm stuff of course).
>#  OR
>#Host per xterm!
## One possible setup, assuming you're running this under xwindows &&
#  have ssh credentials setup on the ${HOST}
# STR="Multitail of machine ${HOST}"
# ASK0 : the options that you wish to pass to multitail (assuming you
don't have a local definition file for multitail)
#          the eval command will need to be used with 'multitail
${ASK0}' to get the shell to interpret ${ASK0} correctly
# ASK1 : any other miscellaneous ssh options

## Under the screen program remove xterm -title "${STR} and assign a
screen per command
## instance needed!
ssh -t -F ${HOST} xterm -title "${STR} -e 'multitail ${ASK0}' ${ASK1} &

More information about the SATLUG mailing list