diff options
| author | Philip Knirsch <pknirsch@hamburg.stuttgart.redhat.com> | 2009-02-26 18:38:39 +0100 |
|---|---|---|
| committer | Philip Knirsch <pknirsch@hamburg.stuttgart.redhat.com> | 2009-02-26 18:38:39 +0100 |
| commit | 82e5d550f1f1da442f4844986477c4a7c0bafa55 (patch) | |
| tree | e8b211752ab80601fc6748015d08369a526362d2 /monitorplugins/net.py | |
| parent | 6b79fa915df800feeadbeab68e6a36a1a958bc2e (diff) | |
| download | tuned-0.1.2.tar.gz tuned-0.1.2.tar.xz tuned-0.1.2.zip | |
- Added config file option to enable/disable pluginsv0.1.2
- Switched from ConfigParser to RawConfigParser
- Renamed doc/README.txt to doc/DESIGN.txt
- Added tuned.conf man page
- Updated tuned man page
- Updated package descriptions (#487312)
- Added documentation for utils scripts (#487312)
Diffstat (limited to 'monitorplugins/net.py')
| -rw-r--r-- | monitorplugins/net.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/monitorplugins/net.py b/monitorplugins/net.py index bf806f7..6051b5c 100644 --- a/monitorplugins/net.py +++ b/monitorplugins/net.py @@ -21,6 +21,7 @@ import os class NetMonitor: def __init__(self): self.devices = {} + self.enabled = True devs = open("/proc/net/dev").readlines() for l in devs: l = l.replace(":", " ") @@ -64,6 +65,8 @@ class NetMonitor: def init(self, config): self.config = config + if self.config.has_option("NetMonitor", "enabled"): + self.enabled = (self.config.get("NetMonitor", "enabled") == "True") interval = self.config.getint("main", "interval") # Assume 1gbit interfaces for now. FIXME: Need clean way to figure out max interface speed for d in self.devices.keys(): @@ -73,6 +76,8 @@ class NetMonitor: pass def getLoad(self): + if not self.enabled: + return self.__update__() ret = {} ret["NET"] = {} |
