~ubuntu-branches/ubuntu/jaunty/landscape-client/jaunty-proposed

« back to all changes in this revision

Viewing changes to landscape/monitor/config.py

  • Committer: Bazaar Package Importer
  • Author(s): Free Ekanayaka
  • Date: 2010-06-28 18:07:18 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100628180718-m3t2ttgg8efbg19d
Tags: 1.5.2.1-0ubuntu0.9.04.0
Filter duplicate network interfaces in get_active_interfaces (LP: #597000)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from landscape.deployment import Configuration
 
2
 
 
3
 
 
4
ALL_PLUGINS = ["ActiveProcessInfo", "ComputerInfo", "HardwareInventory",
 
5
               "LoadAverage", "MemoryInfo", "MountInfo", "ProcessorInfo",
 
6
               "Temperature", "PackageMonitor", "UserMonitor",
 
7
               "RebootRequired", "AptPreferences", "NetworkActivity",
 
8
               "NetworkDevice"]
 
9
 
 
10
 
 
11
class MonitorConfiguration(Configuration):
 
12
    """Specialized configuration for the Landscape Monitor."""
 
13
 
 
14
    def make_parser(self):
 
15
        """
 
16
        Specialize L{Configuration.make_parser}, adding many
 
17
        monitor-specific options.
 
18
        """
 
19
        parser = super(MonitorConfiguration, self).make_parser()
 
20
 
 
21
        parser.add_option("--monitor-plugins", metavar="PLUGIN_LIST",
 
22
                          help="Comma-delimited list of monitor plugins to "
 
23
                               "use. ALL means use all plugins.",
 
24
                          default="ALL")
 
25
        parser.add_option("--flush-interval", default=5 * 60, type="int",
 
26
                          metavar="INTERVAL",
 
27
                          help="The number of seconds between flushes.")
 
28
        return parser
 
29
 
 
30
    @property
 
31
    def plugin_factories(self):
 
32
        if self.monitor_plugins == "ALL":
 
33
            return ALL_PLUGINS
 
34
        return [x.strip() for x in self.monitor_plugins.split(",")]