Growl reporting live apache logs over ssh

The Growl forums have moved to Google Groups, this forum is read only.
Locked
strom
Harmless
Posts: 1
Joined: Fri Nov 04, 2005 5:37 pm

Growl reporting live apache logs over ssh

Post by strom »

I wanted to get a growl bezel notification each time a user surfs into my web site. So, two shell scripts, one calling the other:

> cat live_logs.sh

#!/bin/sh
SERVER="my.server.com"
LOGFILE="/var/logs/httpd/access.log"
ssh $SERVER tail -fn1 $LOGFILE| . call_growl.sh


> cat call_growl.sh
#/bin/sh
IMAGE="path_to_fancy_image.gif"
while read visitor
do
growlnotify --image $IMAGE -m `echo $visitor|awk '$7!~/gif|jpg|js|css/ {print $1,$7}'`
done

This actually works (provided has access to server & read-rights to log file in default log format), apart from the script window outputting the growlnotify help text for each hit:

Usage: growlnotify [-hsvwc] [-i ext] [-I filepath] [--image filepath]
.
.
.


I'm no script guru, and I'm sure one of you could find an easier way of accomplishing this, perhaps in a single script. My main concern is that annoying help message. Suggestions?
Mukke
Harmless
Posts: 3
Joined: Mon Mar 27, 2006 1:12 pm

Post by Mukke »

i wanted to do something similar for any log
actually my ssh access log and my osxvnc log to see when some1 connects
nw i just have 2 terminals open and tail them ,
i'm not much of an scripting expert so do i just tail them and send them to the grwol notificator ?
Locked