Changeset 14 for trunk/daemon
- Timestamp:
- 03/22/05 16:52:04 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/togad.py
r13 r14 67 67 debug_msg( 10, ' |-Cluster found: %s' %( self.clusterName ) ) 68 68 69 elif name == 'HOST' :69 elif name == 'HOST' and self.clusterName in ARCHIVE_SOURCES: 70 70 self.hostName = attrs.get('NAME',"") 71 71 self.hostIp = attrs.get('IP',"") … … 75 75 debug_msg( 10, ' | |-Host found: %s - ip %s reported %s' %( self.hostName, self.hostIp, self.hostReported ) ) 76 76 77 elif name == 'METRIC' :77 elif name == 'METRIC' and self.clusterName in ARCHIVE_SOURCES: 78 78 myMetric = { } 79 79 myMetric['name'] = attrs.get('NAME',"") … … 93 93 #if name == 'CLUSTER': 94 94 95 if name == 'HOST' :95 if name == 'HOST' and self.clusterName in ARCHIVE_SOURCES: 96 96 self.storeMetrics( self.hostName ) 97 97 … … 264 264 rrd_parameters = [ ] 265 265 rrd_dir = '%s/%s/%s' %( check_dir(ARCHIVE_PATH), self.cluster, host ) 266 rrd_file = '%s/%s.rrd' %( rrd_dir, metric['name'] ) 266 267 267 268 if not os.path.exists( rrd_dir ): 268 269 os.makedirs( rrd_dir ) 269 270 rrd_file = '%s/%s.rrd' %( rrd_dir, metric['name'] ) 271 272 interval = self.gmetad_conf.getInterval( self.cluster ) 273 heartbeat = 8 * int(interval) 274 275 param_step1 = '--step' 276 param_step2 = str( interval ) 277 278 param_start1 = '--start' 279 param_start2 = str( int( metric['time'] ) - 1 ) 280 281 param_ds = 'DS:sum:GAUGE:%d:U:U' %heartbeat 282 param_rra = 'RRA:AVERAGE:0.5:1:%s' %(ARCHIVE_HOURS_PER_RRD * 240) 283 284 rrdtool.create( str(rrd_file), param_step1, param_step2, param_start1, param_start2, param_ds, param_rra ) 270 debug_msg( 9, 'created dir %s' %( str(rrd_dir) ) ) 271 272 if not os.path.exists( rrd_file ): 273 274 interval = self.gmetad_conf.getInterval( self.cluster ) 275 heartbeat = 8 * int(interval) 276 277 param_step1 = '--step' 278 param_step2 = str( interval ) 279 280 param_start1 = '--start' 281 param_start2 = str( int( metric['time'] ) - 1 ) 282 283 param_ds = 'DS:sum:GAUGE:%d:U:U' %heartbeat 284 param_rra = 'RRA:AVERAGE:0.5:1:%s' %(ARCHIVE_HOURS_PER_RRD * 240) 285 286 rrdtool.create( str(rrd_file), param_step1, param_step2, param_start1, param_start2, param_ds, param_rra ) 287 288 debug_msg( 9, 'created rrd %s' %( str(rrd_file) ) ) 285 289 286 290 def update( self, metric, timestamp, val ):
Note: See TracChangeset
for help on using the changeset viewer.