DaemonForums  

Go Back   DaemonForums > Miscellaneous > Guides

Guides All Guides and HOWTO's.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 24th May 2013
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default Automatic dual xterm setup for log file monitoring

While testing a Apache webserver configuration, I became tired of setting up two xterms for monitoring both the /var/log/httpd-access and /var/log/httpd-error.log files.

The following simple script does this now for me:

Code:
#!/bin/sh

# Set up two xterms
#   1) tail -f /var/log/httpd-access.log
#   2) tail -f /var/log/http-error.log

ACCESS='ssh j65nko.org "tail -f /var/log/httpd-access.log"'
ERROR='ssh j65nko.org "tail -f /var/log/httpd-error.log"'

# geometry (See X(7)  'GEOMETRY SPECIFICATIONS')
# WidthxHeight+X_offset+Y_offset
# Width and Height either in pixels or characters
# X_offset and Y_offset in pixels

# See xterm(1) for the other options

xterm -geometry 200x30+0+0   -bg black -fg green -e "${ACCESS}" &
xterm -geometry 200x30+0+500 -bg black -fg red   -e "${ERROR}" &
Please note that according to the xterm manual page. the -e option for specifiying the command needs to be the last one.

This script has been tested and is being used in Debian as you can see in the trimmed screenshot.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump

Last edited by J65nko; 24th May 2013 at 01:02 AM.
Reply With Quote
  #2   (View Single Post)  
Old 24th May 2013
thirdm thirdm is offline
Spam Deminer
 
Join Date: May 2009
Posts: 248
Default

Cool.

Too often we forget the good old -geometry command line options and X resources. People often recommend tiling or other simple window manages to eliminate the silly repetitive fiddling with window arrangements, but geometry can eliminate this with most any wm for your common cases. I recently did something similar to get to my new preferred emacs frame layout (a fixed font taking the left 3/4 of the screen for editing and a variable pitch font taking the rest for reading documentation -- okay, technically I did this with emacs settings not X settings, but same difference). This with fluxbox, but it should translate unchanged when I finally get around to replacing fluxbox with a wm I like on this machine, like cwm or stumpwm (hmm, maybe geometry won't work with stumpwm or ratpoison).
Reply With Quote
  #3   (View Single Post)  
Old 24th May 2013
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Default

@J65nko
Have You tried multitail?
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #4   (View Single Post)  
Old 26th May 2013
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

No, I was not aware that such a tool like multitail existed. There even seems to be an OpenBSD package for it
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
automatic or timed suspend on battery asemisldkfj OpenBSD General 3 25th May 2011 11:55 PM
tmux disable automatic resize Carpetsmoker General software and network 7 25th June 2009 10:54 PM
Automatic launching of a script upon login. Help me figure this out EvilMonkeySlayer OpenBSD General 5 28th June 2008 03:27 PM
Automatic Mount for Devices/Filesystems vermaden FreeBSD General 11 12th June 2008 04:55 AM
Automatic Thread Subscription When Posting? JMJ_coder Feedback and Suggestions 6 6th May 2008 03:20 AM


All times are GMT. The time now is 08:41 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick