2008/6/11 Bernard Li <[EMAIL PROTECTED]>:
> Hi Brad:
>
> On Fri, May 16, 2008 at 11:01 AM, Brad Nicholes <[EMAIL PROTECTED]> wrote:
>
>> The rewrite of the gmetad is functionally complete and is currently
>> sitting in the SVN repository of the Ganglia project
>> (http://ganglia.svn.sourceforge.net/viewvc/ganglia/trunk/monitor-core/gmetad-python/)
>> . It currently replicates the functionality of the original gmetad with
>> the exception of the pluggable interface which is functionality that the
>> original gmetad did not have. The RRD files, both the metric RRDs and
>> summary RRDs are being written by RRD plugins rather than directly coming
>> from gmetad itself. There isn't any documentation on how to write a gmetad
>> plugin yet, but the existing RRD plugins should give you a good idea of how
>> it is done.
>>
>> There is still a lot of stabilization work to be done as well as
>> packaging. One thing that still needs to be worked out is how to package
>> and install the python version of gmetad along with the modules. For now,
>> it should probably be packaged separately from the rest of Ganglia and
>> installed using standard python practices.
>>
>> With this new rewrite in python, we now have the ability to plug in new
>> metric storage modules to support other type of storage mechanisms other
>> than RRD and also the ability to plug in any type of analysis functionality
>> that would make sense at the gmetad level. Try it out, fix a bug or two and
>> try writing a module. If you have any idea on how best to package and
>> install the python version of gmetad, please comment or better yet, just do
>> it.
>
> I can't get gmetad-python to work with Python 2.3.4:
>
> # ./gmetad.py -d10
> Traceback (most recent call last):
> File "./gmetad.py", line 159, in ?
> format='%(levelname)-8s %(message)s')
> TypeError: basicConfig() takes no arguments (2 given)
>
> The code in question is:
>
>
> logging.basicConfig(level=getLoggingLevel(gmetadConfig[GmetadConfig.DEBUG_LEVEL]),
> format='%(levelname)-8s %(message)s')
>
> Looks like there are some API changes between 2.3 and 2.4.
Yes it is, but API was changed in 2.4:
http://docs.python.org/lib/module-logging.html
Attached patch to fix that.
>
> Cheers,
>
> Bernard
>
>
>
--
Kuba
Index: gmetad.py
===================================================================
--- gmetad.py (revision 1402)
+++ gmetad.py (working copy)
@@ -155,8 +155,11 @@
# Initialize the application
ignore_fds = [] # Remembers log file descriptors we create, so they aren't closed when we daemonize.
- logging.basicConfig(level=getLoggingLevel(gmetadConfig[GmetadConfig.DEBUG_LEVEL]),
- format='%(levelname)-8s %(message)s')
+ if sys.version_info[:2] >= (2, 4):
+ logging.basicConfig(level=getLoggingLevel(gmetadConfig[GmetadConfig.DEBUG_LEVEL]),
+ format='%(levelname)-8s %(message)s')
+ else:
+ logging.basicConfig()
syslogHandler = logging.handlers.SysLogHandler('/dev/log')
syslogHandler.setLevel(getLoggingLevel(gmetadConfig[GmetadConfig.DEBUG_LEVEL]))
syslogHandler.setFormatter(logging.Formatter(fmt='%(asctime)s %(levelname)-8s - GMETAD - %(message)s',
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers