Skip to content

Commit

Permalink
Change how we disable collectors. We want to be able to override coll…
Browse files Browse the repository at this point in the history
…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 d71dfba
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/collectors/CPUCollector/CPUCollector.conf
@@ -1,4 +1,7 @@
### Options for the CPUCollector ### Options for the CPUCollector


# Enabled by default
enabled = True

# Path for cpu metrics # Path for cpu metrics
path = cpu path = cpu
@@ -1,4 +1,7 @@
## Options for the Disk Space Collector ## Options for the Disk Space Collector
# Enabled by default
enabled = True

path = diskspace path = diskspace
# filesystems to examine # filesystems to examine
filesystems = ext2, ext3, ext4, xfs, glusterfs, nfs filesystems = ext2, ext3, ext4, xfs, glusterfs, nfs
Expand Down
@@ -1,2 +1,6 @@
## Options for the IO Stats collector ## Options for the IO Stats collector

# Enabled by default
enabled = True

path = iostat path = iostat
3 changes: 3 additions & 0 deletions src/collectors/LoadAverageCollector/LoadAverageCollector.conf
@@ -1,4 +1,7 @@
### Options for the LoadAverageCollector ### Options for the LoadAverageCollector
# Enabled by default
enabled = True

path = loadavg path = loadavg


# We don't use any derivative data to calculate this value # We don't use any derivative data to calculate this value
Expand Down
3 changes: 3 additions & 0 deletions src/collectors/MemoryCollector/MemoryCollector.conf
@@ -1,4 +1,7 @@
### Options for the MemoryCollector ### Options for the MemoryCollector
# Enabled by default
enabled = True

path = memory path = memory


# We don't use any derivative data to calculate this value # We don't use any derivative data to calculate this value
Expand Down
3 changes: 3 additions & 0 deletions src/collectors/NetworkCollector/NetworkCollector.conf
@@ -1,5 +1,8 @@
### Options for the NetworkCollector ### Options for the NetworkCollector


# Enabled by default
enabled = True

# Path for network metrics # Path for network metrics
path = network path = network


Expand Down
3 changes: 3 additions & 0 deletions src/collectors/SockstatCollector/SockstatCollector.conf
@@ -1,3 +1,6 @@
# Enabled by default
enabled = True

path = sockets path = sockets


# We don't use any derivative data to calculate this value # We don't use any derivative data to calculate this value
Expand Down
3 changes: 3 additions & 0 deletions src/collectors/TCPCollector/TCPCollector.conf
@@ -1,4 +1,7 @@
## Options for the TCP Stats Collector ## Options for the TCP Stats Collector
# Enabled by default
enabled = True

path = tcp path = tcp
allowed_names = ListenOverflows, ListenDrops, TCPLoss, TCPTimeouts allowed_names = ListenOverflows, ListenDrops, TCPLoss, TCPTimeouts


Expand Down
3 changes: 3 additions & 0 deletions src/collectors/VMStatCollector/VMStatCollector.conf
@@ -1,2 +1,5 @@
## Options for the VMStat collector ## Options for the VMStat collector
# Enabled by default
enabled = True

path = vmstat path = vmstat
6 changes: 1 addition & 5 deletions src/diamond/server.py
Expand Up @@ -146,10 +146,6 @@ def load_collectors(self, path, filter=None):


modname = f[:-3] 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 # Stat module file to get mtime
st = os.stat(os.path.join(path, f)) st = os.stat(os.path.join(path, f))
mtime = st.st_mtime mtime = st.st_mtime
Expand Down Expand Up @@ -222,7 +218,7 @@ def schedule_collector(self, c, interval_task=True):
return return


# Disabled? # Disabled?
if c.config.has_key('disabled'): if c.config['enabled'] != "True":
self.log.warn("Skipped loading disabled Collector: %s" % (c.__class__.__name__)) self.log.warn("Skipped loading disabled Collector: %s" % (c.__class__.__name__))
return return


Expand Down

0 comments on commit d71dfba

Please sign in to comment.