Permalink
Browse files

Change how we disable collectors. We want to be able to override coll…

…ectors a little easier then the only can disable, can not re-enable disabled = method
  • Loading branch information...
kormoc committed Jan 3, 2012
1 parent c99979f commit d71dfba203cc00544894922ee9857c530ebb026c
@@ -1,4 +1,7 @@
### Options for the CPUCollector
+# Enabled by default
+enabled = True
+
# Path for cpu metrics
path = cpu
@@ -1,4 +1,7 @@
## Options for the Disk Space Collector
+# Enabled by default
+enabled = True
+
path = diskspace
# filesystems to examine
filesystems = ext2, ext3, ext4, xfs, glusterfs, nfs
@@ -1,2 +1,6 @@
## Options for the IO Stats collector
+
+# Enabled by default
+enabled = True
+
path = iostat
@@ -1,4 +1,7 @@
### Options for the LoadAverageCollector
+# Enabled by default
+enabled = True
+
path = loadavg
# We don't use any derivative data to calculate this value
@@ -1,4 +1,7 @@
### Options for the MemoryCollector
+# Enabled by default
+enabled = True
+
path = memory
# We don't use any derivative data to calculate this value
@@ -1,5 +1,8 @@
### Options for the NetworkCollector
+# Enabled by default
+enabled = True
+
# Path for network metrics
path = network
@@ -1,3 +1,6 @@
+# Enabled by default
+enabled = True
+
path = sockets
# We don't use any derivative data to calculate this value
@@ -1,4 +1,7 @@
## Options for the TCP Stats Collector
+# Enabled by default
+enabled = True
+
path = tcp
allowed_names = ListenOverflows, ListenDrops, TCPLoss, TCPTimeouts
@@ -1,2 +1,5 @@
## Options for the VMStat collector
+# Enabled by default
+enabled = True
+
path = vmstat
View
@@ -146,10 +146,6 @@ def load_collectors(self, path, filter=None):
modname = f[:-3]
- # If the master config has this module disabled, don't load at all
- if self.config['collectors'].has_key(modname) and self.config['collectors'][modname].has_key('disabled'):
- self.log.debug("Module %s is disabled." % (modname))
- continue
# Stat module file to get mtime
st = os.stat(os.path.join(path, f))
mtime = st.st_mtime
@@ -222,7 +218,7 @@ def schedule_collector(self, c, interval_task=True):
return
# Disabled?
- if c.config.has_key('disabled'):
+ if c.config['enabled'] != "True":
self.log.warn("Skipped loading disabled Collector: %s" % (c.__class__.__name__))
return

0 comments on commit d71dfba

Please sign in to comment.