DaemonForums  

Go Back   DaemonForums > Miscellaneous > Guides

Guides All Guides and HOWTO's.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 24th May 2013
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,128
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
 

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 11:08 PM.


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