Forum Moderators: phranque

Message Too Old, No Replies

Realtime Apache Console monitor

         

reovest

4:05 pm on Apr 11, 2003 (gmt 0)

10+ Year Member



Not 100% sure if this is the appropriate place to stick this message or even if the forums here address this type of topic, but it seems like there are quite a few people here who might be able to help, so here goes.

I'm looking for a console based (text - not X) realtime apache monitor that can watch the log or the actual processes and display the IP address (resolved would be nice) on the screen and the current page they're looking at. Similar to `top`.

Right now I just `tail -f` the log and grep filter the stuff I don't want to see ie., :
tail -f access_log ¦ grep -v some.ip.address.here ¦ grep -v some/specific/directory/here

When the activity level is high things move so quickly I can't monitor very easily.

If anyone knows of something like this, I'd really like to hear about it (links to it would be great!).

Thanks in advance,
Al Bunch

<snip>

[edited by: trillianjedi at 8:23 pm (utc) on Dec. 6, 2006]
[edit reason] No sigs please as per TOS [/edit]

jpjones

4:36 pm on Apr 11, 2003 (gmt 0)

10+ Year Member



I don't know of a program which does that, but you could tailor the grep to catch just web pages rather than graphics & other junk as well (maybe with a ¦ more tagged on the end to pause the screen).

The other alternative would be to write your own. :)

carfac

5:42 am on Apr 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you find or write one, skicky me- I would love to test drive something like that for a while!

dave

reovest

6:54 pm on Apr 14, 2003 (gmt 0)

10+ Year Member



Thanks - I've been out searching since I posted the first message on this topic.

Still no luck and it doesn't seem like anyone here knows of anything either - at least they haven't mentioned it to me.

sugarkane

10:19 am on Apr 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's not a full solution but it remove some of the clutter:

tail -f access.log? awk {'print $1 " " $7'}
(replace? with the pipe character)

Added: I tried adding a final grep command to remove everything but html files - this worked with an ordinary 'tail' but not 'tail -f'. I'm not sure why?

reovest

7:49 pm on Apr 15, 2003 (gmt 0)

10+ Year Member



That's similar to what I had tried before:

tail -f access_log ¦ cut -d' ' -f1,7 ¦ grep -v .jpg ¦ grep -v .php ¦ grep -v .css ¦ grep -v .gif

Of course you could substitute anything in the grep -v commands that you wanted to filter out, or you could just look for the lines you want to see.

It works, for now, but I'm still out there searching.

Would like to see a console based monitor screen - similar to this?

+--------------------------------------------------------+
¦Web server: reovest.com Monitoring 3 active users ¦
+--------------------------------------------------------+
¦httpd1: 123.122.27.122 /index.html ¦
¦httpd2: [idle] ¦
¦httpd3: 64.12.25.222 /cgi-bin/post.cgi?name=a¦
¦httpd4: 202.6.77.118 /property/links.html ¦
¦httpd5: [idle] ¦
¦httpd6: [idle] ¦
¦httpd7: [idle] ¦
+--------------------------------------------------------+

You get the idea...something that stays on the screen would be nice rather than watching it roll off.

Thanks for the input with the tail -f and the awk commands...I'm not too familiar with awk so I did it with cut.

I do have something that will scrub your apache log file and resolveip all the ip addresses it finds (sorted and uniq'd of course) if you're interested, I'll sticky you a copy or just post it here.

-Al

sugarkane

8:15 pm on Apr 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> like this

That would indeed be nice.

<idle pondering>
You can configure Apache to log the pid of the child server that processes each request along with all the usual info that's logged. Now if that was combined with a ps command and all tied together with Perl... hmm...
</idle pondering>

Anyway, just for reference here's my tidied up, working tail and awk combination.

tail -f access.log ¦ awk {'if ($7 ~ /html¦php¦cgi/) print $1 " " $7'}