Changeset 60 for trunk/daemon/togad.py


Ignore:
Timestamp:
04/11/05 12:14:53 (18 years ago)
Author:
bastiaans
Message:

daemon/togad.py:

  • Options added for toga joblist handling server
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/togad.py

    r58 r60  
    1414import random
    1515from types import *
     16import DBClass
    1617
    1718# Specify debugging level here;
     
    2930GMETAD_CONF = '/etc/gmetad.conf'
    3031
     32# Wether or not to maintain a archive of all ganglia node data
     33# Note: This will require a significant amount of hd space
     34#       depending on your cluster size
     35#
     36ARCHIVE = 0
     37
     38# Where to grab XML data from
     39# Normally: local gmetad (port 8651)
     40#
     41ARCHIVE_SOURCE = "localhost:8651"
     42
     43# List of data_source names to archive for
     44#
     45ARCHIVE_DATASOURCES = [ "LISA Cluster" ]
     46
    3147# Where to store the archived rrd's
    3248#
    3349ARCHIVE_PATH = '/data/toga/rrds'
    3450
    35 # List of data_source names to archive for
    36 #
    37 ARCHIVE_SOURCES = [ "LISA Cluster" ]
    38 
    3951# Amount of hours to store in one single archived .rrd
    4052#
    4153ARCHIVE_HOURS_PER_RRD = 12
     54
     55# Wether or not to run a seperate Toga jobinfo server
     56#
     57TOGA_SERVER = 1
     58
     59# On what interfaces to listen
     60#
     61TOGA_SERVER_INTERFACES = [ 'eth0' ]
     62
     63# On what port to listen
     64#
     65TOGA_SERVER_PORT = 9048
     66
     67# Toga's SQL dbase name to use
     68#
     69TOGA_SERVER_SQL_DBASE = "toga"
    4270
    4371# Wether or not to run as a daemon in background
     
    5179######################
    5280
     81###
     82# You'll only want to change anything below here unless you
     83# know what you are doing (i.e. your name is Ramon Bastiaans)
     84###
     85
    5386# What XML data types not to store
    5487#
     
    6699This is TOrque-GAnglia's data Daemon
    67100"""
     101
     102#class TogaServer:
     103
     104#class TogaXMLHandler( ContentHandler ):
    68105
    69106class RRDMutator:
     
    152189                                clustername = item
    153190
    154                                 if not self.clusters.has_key( clustername ) and clustername in ARCHIVE_SOURCES:
     191                                if not self.clusters.has_key( clustername ) and clustername in ARCHIVE_DATASOURCES:
    155192
    156193                                        self.clusters[ clustername ] = RRDHandler( self.config, clustername )
     
    178215                        self.time = attrs.get( 'LOCALTIME', "" )
    179216
    180                         if not self.clusters.has_key( self.clusterName ) and self.clusterName in ARCHIVE_SOURCES:
     217                        if not self.clusters.has_key( self.clusterName ) and self.clusterName in ARCHIVE_DATASOURCES:
    181218
    182219                                self.clusters[ self.clusterName ] = RRDHandler( self.config, self.clusterName )
     
    184221                                debug_msg( 10, ' |-Cluster found: %s' %( self.clusterName ) )
    185222
    186                 elif name == 'HOST' and self.clusterName in ARCHIVE_SOURCES:     
     223                elif name == 'HOST' and self.clusterName in ARCHIVE_DATASOURCES:     
    187224
    188225                        self.hostName = attrs.get( 'NAME', "" )
     
    192229                        debug_msg( 10, ' | |-Host found: %s - ip %s reported %s' %( self.hostName, self.hostIp, self.hostReported ) )
    193230
    194                 elif name == 'METRIC' and self.clusterName in ARCHIVE_SOURCES:
     231                elif name == 'METRIC' and self.clusterName in ARCHIVE_DATASOURCES:
    195232
    196233                        type = attrs.get( 'TYPE', "" )
     
    295332                self.config = GangliaConfigParser( GMETAD_CONF )
    296333
    297                 self.myXMLGatherer = GangliaXMLGatherer( 'localhost', 8651 )
     334                self.myXMLGatherer = GangliaXMLGatherer( ARCHIVE_SOURCE.split( ':' )[0], ARCHIVE_SOURCE.split( ':' )[1] )
    298335                self.myParser = make_parser()   
    299336                self.myHandler = GangliaXMLHandler( self.config )
     
    859896        "Program startup"
    860897
    861         myProcessor = GangliaXMLProcessor()
    862 
    863         if DAEMONIZE:
    864                 myProcessor.daemon()
    865         else:
    866                 myProcessor.run()
     898        if TOGA_SERVER:
     899       
     900                myServer = TogaServer()
     901
     902                if DAEMONIZE:
     903                        myServer.daemon()
     904                else:
     905                        myServer.run()
     906
     907        if ARCHIVE:
     908
     909                myProcessor = GangliaXMLProcessor()
     910
     911                if DAEMONIZE:
     912                        myProcessor.daemon()
     913                else:
     914                        myProcessor.run()
    867915
    868916def check_dir( directory ):
Note: See TracChangeset for help on using the changeset viewer.