fr3nd.net fr3nd.net

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

apache-top

English version here

Descripción

apache-top muestra en tiempo real los procesos activos de un servidor apache remoto. Es similar al comando top de linux.

Con él se pueden ver:

  • Los procesos activos de apache, con su PID, el estado, los segundos que lleva activo, el uso de CPU, el virtualhost asociado, la ip desde la que se está accediendo, y la petición (POST o GET, el fichero que se está sirviendo y el protocolo utilizado).
  • El tiempo que lleva arrancado el servidor web y la hora en que se reinició por última vez
  • El consumo de cpu
  • El número de peticiones por segundo, el número de Kb por segundo y la media de Kb por petición
  • El número de procesos activos y inactivos
  • Un gráfico donde se pueden ver los procesos inactivos, los activos y el estado en que están.

Requerimientos

  • python 2.4
  • Servidor web apache 2.0 con mod_status activado y la directiva ExtendedStatus activada con permiso para acceder desde la ip desde la que se lanza el programa

Descarga

  • apache-top 1.0

Ejemplos

Para ver las estadísticas del servidor 192.168.0.1, ejecutariamos este comando:

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

Si por alguna razon no tenemos acceso directo al puerto 80, podemos utilizar ssh para crear un tunel. En una consola ejecutamos:

ssh -L 8080:localhost:80 192.168.0.1

y en otra:

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

Enlaces

  • apache-top en freshmeat
  • apache-top en swik
  • Proyecto similar pero con un enfoque distinto

Screenshots

apache-top

Licencia

apache-top utiliza la licencia GNU/GPL

Comments rss
Comments rss

23 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?

magu | 11/2/2010 | 4:01 am

Same issue as DOCENTA and Papak: http://localhost/server-status works fine in Lynx, but not in apache-top.py.

Apache 2.2, ExtendedStatus set to On and working, Python 2.5.2.

Any ideas?

Marco | 11/3/2010 | 1:49 am

“ERROR parsing the data. Please, make sure you are alowed to read the server-status page and you have ExtendedStatus flag activated”
same here with apache 2.2.
any solution?

shawn | 2/6/2010 | 2:01 am

Thanks for this project its great..

What we need for update is -

spacebar refresh

Also, is their a active thread or mailing list for people working on this project?

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

Black_smoke
06-05-2010 a las 00:00

Ver todos

Songs

July 2010

  • Devo - Fresh

June 2010

  • The Drums - Let's Go Surfing
  • Empire of the Sun - We Are the People

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:
  • shawn: Thanks for this project its great.. What we need for update is - spacebar refresh Also, is their a active...

  • Max Hodges: Would like to contact you. Could you email me? I couldn’t find your mail address on the site....

  • Judy: I have a picture in my living room that my husbands GrandMother made many years ago. She embroidered a picture...

  • ^ShErE^: Hola!! Soy ^ShErE^ del zanatorio, navegando, he dado por casualidad con tu pagina, me ha hecho gracia saber...

  • RkRRa: Pues aqui tienes un Space Invader mas que encontre el viernes pasado por barcelona!!...

Categorias

  • abc música! (11)
  • 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 (19)
  • Libros (4)
  • Linux (9)
  • Música (15)
  • Personal (40)
  • pixel (15)
  • Projects (6)
  • 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
    • JapanDict Japanese dictionary
    • last.fm
    • Learn Japanese (Twitter)
    • LinkedIn
    • twitter
    • Visited Countries
    • YouTube
  • Archivos

    • July 2010 (1)
    • June 2010 (1)
    • February 2010 (2)
    • 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)

    Ver todos los archivos

    Search


    Creative Commons License

    :wq