fr3nd.net fr3nd.net

  • rss
  • home
  • fotos
  • invaders
  • projects
  • quien soy

apache-top

Versión en castellano

Description

apache-top provides real-time display of the active processes from a remote apache server. I’ts like the top linux command.

With apache-top you can get:

  • The active apache processes with their associated PID, the status, the seconds being active, the CPU usage, the asociated VirtualHost, the accessing ip and the request (POST or GET, the file being accessed and the used protocol)
  • The server uptime and the last time it was restarted
  • The CPU usage
  • Requests by second, Kb by second and the average Kb by request
  • Number of active and inactive processes
  • A graph with the inactive and active processes and their status

Requeriments

  • python 2.4
  • Apache 2.0 webserver with mod_status and the ExtendedStatus directive activated. You will also need to be allowed to access from your ip address.

Download

  • apache-top 1.0

Examples

To see the statistics for the webserver 192.168.0.1:

apache-top -u http://192.168.0.1/server-status

If for any reason we don’t have direct access to 80 port, a tunel can be createdusing ssh:

ssh -L 8080:localhost:80 192.168.0.1

And we run this command in other terminal:

apache-top -u http://localhost:8080/server-status

Links

  • apache-top at freshmeat
  • apache-top at swik
  • Similar project with diferent approach

Screenshots

apache-top

License

apache-top uses GNU/GPL License.

Comments rss
Comments rss

20 responses

Kepi | 2/9/2006 | 10:48 pm

Thanks for this project! This is exactly what I’m looking for. apachetop is good, but it is totaly useless in case you have different access log for every virutal host.

In program help (with ?) will be great.

fr3nd | 3/9/2006 | 5:21 pm

Kepi, apache-top doesn’t use the access log to retrieve the information, so having different logs for every virtualhost doesn’t affect it

Chris Brunner | 7/9/2006 | 8:24 pm

Is there an older version that works with Apache 1?

fr3nd | 8/9/2006 | 2:03 pm

Chris: Sorry, but there is no version compatible with apache 1.

Kepi | 29/1/2007 | 1:16 am

fr3nd: (reply to 2)

Yes, I know it! I talk about apachetop (the one without – :) as you said.. simmilar project with diferent approach). I like it but it is useless for me cause it depends on access logs.

And this is why I love your’s apache-top :) It saves my live many times from time i wrote here for the first time. Thanks again.

DOCENTA | 29/11/2007 | 5:12 pm

Hello, on a cPanel server when starting it:

./apache-top.py -u http://localhost/whm-server-status

ERROR parsing the data. Please, make sure you are alowed to read the server-status page and you have ExtendedStatus flag activated

What may be the problem ?

Thanks,

fr3nd | 30/11/2007 | 2:23 pm

Docenta: Check you’re using apache 2.0 and try to access to that url using a “normal” browser to see if the server-status page works correctly.

Alvaro | 2/1/2008 | 9:00 pm

Hey, thanks for writing it! I love it!

bofh | 25/5/2008 | 11:10 pm

Hello

Ahm ill try to run it but i just recive a blank sreen. also cannot exit by q or ctrl-c must stop the przess and kill it by sigjkill

im running debian etch, python 2.4.4 and also an actual apache2

the status site is reachable by lynx on same terminal
get no error message nothing

same happens wenn i try to use a bad url

ok when i try it with debug form python (python -d apache-top…. ill recive an error wehn i run it on a bad url but still nothing when the url is corrent

anyone an idea?

bofh | 25/5/2008 | 11:25 pm

now ife tryit with verbose and debug

below thats what i recieve

# /usr/lib/python2.4/httplib.pyc matches /usr/lib/python2.4/httplib.py
import httplib # precompiled from /usr/lib/python2.4/httplib.pyc
# /usr/lib/python2.4/mimetools.pyc matches /usr/lib/python2.4/mimetools.py
import mimetools # precompiled from /usr/lib/python2.4/mimetools.pyc
# /usr/lib/python2.4/rfc822.pyc matches /usr/lib/python2.4/rfc822.py
import rfc822 # precompiled from /usr/lib/python2.4/rfc822.pyc
# /usr/lib/python2.4/tempfile.pyc matches /usr/lib/python2.4/tempfile.py
import tempfile # precompiled from /usr/lib/python2.4/tempfile.pyc
# /usr/lib/python2.4/random.pyc matches /usr/lib/python2.4/random.py
import random # precompiled from /usr/lib/python2.4/random.pyc
dlopen(“/usr/lib/python2.4/lib-dynload/math.so”, 2);
import math # dynamically loaded from /usr/lib/python2.4/lib-dynload/math.so
dlopen(“/usr/lib/python2.4/lib-dynload/binascii.so”, 2);
import binascii # dynamically loaded from /usr/lib/python2.4/lib-dynload/binascii.so
dlopen(“/usr/lib/python2.4/lib-dynload/_random.so”, 2);
import _random # dynamically loaded from /usr/lib/python2.4/lib-dynload/_random.so
dlopen(“/usr/lib/python2.4/lib-dynload/fcntl.so”, 2);
import fcntl # dynamically loaded from /usr/lib/python2.4/lib-dynload/fcntl.so
import thread # builtin
dlopen(“/usr/lib/python2.4/lib-dynload/cStringIO.so”, 2);
import cStringIO # dynamically loaded from /usr/lib/python2.4/lib-dynload/cStringIO.so

bofh | 25/5/2008 | 11:26 pm

vpn:/bin/wartung# python -d -v apache-top -u http://localhost/server-status
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/lib/python2.4/site.pyc matches /usr/lib/python2.4/site.py
import site # precompiled from /usr/lib/python2.4/site.pyc
# /usr/lib/python2.4/os.pyc matches /usr/lib/python2.4/os.py
import os # precompiled from /usr/lib/python2.4/os.pyc
import posix # builtin
# /usr/lib/python2.4/posixpath.pyc matches /usr/lib/python2.4/posixpath.py
import posixpath # precompiled from /usr/lib/python2.4/posixpath.pyc
# /usr/lib/python2.4/stat.pyc matches /usr/lib/python2.4/stat.py
import stat # precompiled from /usr/lib/python2.4/stat.pyc
# /usr/lib/python2.4/UserDict.pyc matches /usr/lib/python2.4/UserDict.py
import UserDict # precompiled from /usr/lib/python2.4/UserDict.pyc
# /usr/lib/python2.4/copy_reg.pyc matches /usr/lib/python2.4/copy_reg.py
import copy_reg # precompiled from /usr/lib/python2.4/copy_reg.pyc
# /usr/lib/python2.4/types.pyc matches /usr/lib/python2.4/types.py
import types # precompiled from /usr/lib/python2.4/types.pyc
# /usr/lib/python2.4/warnings.pyc matches /usr/lib/python2.4/warnings.py
import warnings # precompiled from /usr/lib/python2.4/warnings.pyc
# /usr/lib/python2.4/linecache.pyc matches /usr/lib/python2.4/linecache.py
import linecache # precompiled from /usr/lib/python2.4/linecache.pyc
import encodings # directory /usr/lib/python2.4/encodings
# /usr/lib/python2.4/encodings/__init__.pyc matches /usr/lib/python2.4/encodings/__init__.py
import encodings # precompiled from /usr/lib/python2.4/encodings/__init__.pyc
# /usr/lib/python2.4/codecs.pyc matches /usr/lib/python2.4/codecs.py
import codecs # precompiled from /usr/lib/python2.4/codecs.pyc
import _codecs # builtin
# /usr/lib/python2.4/encodings/aliases.pyc matches /usr/lib/python2.4/encodings/aliases.py
import encodings.aliases # precompiled from /usr/lib/python2.4/encodings/aliases.pyc
# /usr/lib/python2.4/encodings/iso8859_15.pyc matches /usr/lib/python2.4/encodings/iso8859_15.py
import encodings.iso8859_15 # precompiled from /usr/lib/python2.4/encodings/iso8859_15.pyc
Python 2.4.4 (#2, Apr 16 2008, 17:58:59)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
apache-top: inconsistent use of tabs and spaces in indentation
# /usr/lib/python2.4/HTMLParser.pyc matches /usr/lib/python2.4/HTMLParser.py
import HTMLParser # precompiled from /usr/lib/python2.4/HTMLParser.pyc
# /usr/lib/python2.4/markupbase.pyc matches /usr/lib/python2.4/markupbase.py
import markupbase # precompiled from /usr/lib/python2.4/markupbase.pyc
# /usr/lib/python2.4/re.pyc matches /usr/lib/python2.4/re.py
import re # precompiled from /usr/lib/python2.4/re.pyc
# /usr/lib/python2.4/sre.pyc matches /usr/lib/python2.4/sre.py
import sre # precompiled from /usr/lib/python2.4/sre.pyc
# /usr/lib/python2.4/sre_compile.pyc matches /usr/lib/python2.4/sre_compile.py
import sre_compile # precompiled from /usr/lib/python2.4/sre_compile.pyc
import _sre # builtin
# /usr/lib/python2.4/sre_constants.pyc matches /usr/lib/python2.4/sre_constants.py
import sre_constants # precompiled from /usr/lib/python2.4/sre_constants.pyc
# /usr/lib/python2.4/sre_parse.pyc matches /usr/lib/python2.4/sre_parse.py
import sre_parse # precompiled from /usr/lib/python2.4/sre_parse.pyc
dlopen(“/usr/lib/python2.4/lib-dynload/operator.so”, 2);
import operator # dynamically loaded from /usr/lib/python2.4/lib-dynload/operator.so
# /usr/lib/python2.4/urllib.pyc matches /usr/lib/python2.4/urllib.py
import urllib # precompiled from /usr/lib/python2.4/urllib.pyc
# /usr/lib/python2.4/string.pyc matches /usr/lib/python2.4/string.py
import string # precompiled from /usr/lib/python2.4/string.pyc
dlopen(“/usr/lib/python2.4/lib-dynload/strop.so”, 2);
import strop # dynamically loaded from /usr/lib/python2.4/lib-dynload/strop.so
# /usr/lib/python2.4/socket.pyc matches /usr/lib/python2.4/socket.py
import socket # precompiled from /usr/lib/python2.4/socket.pyc
dlopen(“/usr/lib/python2.4/lib-dynload/_socket.so”, 2);
import _socket # dynamically loaded from /usr/lib/python2.4/lib-dynload/_socket.so
dlopen(“/usr/lib/python2.4/lib-dynload/_ssl.so”, 2);
import _ssl # dynamically loaded from /usr/lib/python2.4/lib-dynload/_ssl.so
import errno # builtin
dlopen(“/usr/lib/python2.4/lib-dynload/time.so”, 2);
import time # dynamically loaded from /usr/lib/python2.4/lib-dynload/time.so
# /usr/lib/python2.4/urlparse.pyc matches /usr/lib/python2.4/urlparse.py
import urlparse # precompiled from /usr/lib/python2.4/urlparse.pyc
import curses # directory /usr/lib/python2.4/curses
# /usr/lib/python2.4/curses/__init__.pyc matches /usr/lib/python2.4/curses/__init__.py
import curses # precompiled from /usr/lib/python2.4/curses/__init__.pyc
dlopen(“/usr/lib/python2.4/lib-dynload/_curses.so”, 2);
import _curses # dynamically loaded from /usr/lib/python2.4/lib-dynload/_curses.so
# /usr/lib/python2.4/curses/wrapper.pyc matches /usr/lib/python2.4/curses/wrapper.py
import curses.wrapper # precompiled from /usr/lib/python2.4/curses/wrapper.pyc
# /usr/lib/python2.4/traceback.pyc matches /usr/lib/python2.4/traceback.py
import traceback # precompiled from /usr/lib/python2.4/traceback.pyc
# /usr/lib/python2.4/getopt.pyc matches /usr/lib/python2.4/getopt.py
import getopt # precompiled from /usr/lib/python2.4/getopt.pyc

500 | 29/7/2008 | 10:10 pm

http://www.fr3nd.net/stuff/projects/apache-top/apache-top.py

Link gives an Internal Server Error

fr3nd | 30/7/2008 | 8:30 am

The internal Server Error has been fixed. Sorry for the inconvenience! :)

Héctor | 12/9/2008 | 8:04 pm

Maybe this is a dumb question, but is it “/server-status” dir suppose to exist? Does apache creates it when ExtendedStatus is On? Or what this folder should contain or what does apache-top is looking for in here?

Thank you,

Stephen | 24/10/2008 | 6:05 am

Support for apache 2.2 would be nice :)

Bostjan Skufca | 4/4/2009 | 5:47 am

I am getting this error – does anybody know why?

# ./apache-top.py -u http://localhost/server-status
File “./apache-top.py”, line 141
print main.__doc__
^
SyntaxError: invalid syntax

cantare | 4/6/2009 | 11:14 pm

Is there any chance of support for Apache 2.2? All I get is “ERROR parsing the data.”

Kepi | 5/6/2009 | 8:16 am

It works with apache 2.2 with no problem, just be sure to turn on extended status and use good url. Try it i.e. with links

Papak | 16/6/2009 | 10:43 am

We have the same problem as DOCENTA. Yes we using Apache 2 and yes URL in browser is working fine.

dragon | 2/9/2009 | 1:28 pm

What means .0867% CPU load?

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Randompic

Gatobus
05-02-2010 a las 11:08

Ver todos

Songs

February 2010

  • Alice In Videoland - Cut The Crap

January 2010

  • Bedouin Soundclash - 12:59 Lullaby
  • Late Of The Pier - Focker
  • Vampire Weekend - A-Punk

All Songs

Proyectos

  • Learn Japanese
  • DS Go 2
  • Clearlooks-NeXT
  • apache-top
  • Third Age
  • ssshell
  • mysqlpdump
  • pyproctools
  • splitdump
  • Don Simon
  • Nis Gaim Theme
  • Gaim Popupwin

Comentarios

Comentarios recientes:
  • Konnichiwhat: Please also check out @JLPTLevel1and2 for higher level Kanji practice! Thank you!

  • Konnichiwhat: I really enjoy your twitter page. Great for beginners! I have started a new site dedicated to those...

  • bob: use kodansha’s kanji dictionary.

  • Andre: Hi I have a question about two kanjis. ha a few years I found that draft containing the two kanji, but until...

  • Admiral Spunky: This game looks like exactly what I’m looking for; thanks, fr3nd! But I have yet to be able to...

Categorias

  • abc música! (10)
  • Art (8)
  • Dublin (7)
  • fr3nd.net (8)
  • friki (13)
  • gadgets (8)
  • General (63)
  • Informática (13)
  • Informática Retro (5)
  • Internet (17)
  • Irlanda (2)
  • Japan (17)
  • Libros (4)
  • Linux (9)
  • Música (15)
  • Personal (39)
  • pixel (15)
  • Projects (5)
  • space-invaders (25)
  • thoughts (7)
  • travel (6)
  • Viaje a Japón (10)
  • work (3)
  • ZonaDance (3)

Links

  • friends

    • Adria Garcia
    • ag0ny
    • eunice popcorn
    • fr3nd’s home
    • if i shrink will I shrink?
    • Mundodisea
    • Ojete Cable
    • Sushi’s web
    • t4bLeT
    • tetrins.com
    • uRi
    • [aMc]
  • Web presence

    • delicious
    • Facebook
    • flickr
    • last.fm
    • Learn Japanese
    • Learn Japanese (Twitter)
    • LinkedIn
    • twitter
    • Visited Countries
    • YouTube
  • Archivos

    • February 2010 (1)
    • December 2009 (1)
    • October 2009 (2)
    • July 2009 (1)
    • June 2009 (1)
    • May 2009 (1)
    • March 2009 (1)
    • January 2009 (3)
    • December 2008 (4)
    • November 2008 (3)
    • October 2008 (4)
    • September 2008 (2)

    Ver todos los archivos

    Search


    Creative Commons License

    :wq