本文整理汇总了Python中Products.ZenUtils.ZCmdBase.ZCmdBase.buildOptions方法的典型用法代码示例。如果您正苦于以下问题:Python ZCmdBase.buildOptions方法的具体用法?Python ZCmdBase.buildOptions怎么用?Python ZCmdBase.buildOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products.ZenUtils.ZCmdBase.ZCmdBase
的用法示例。
在下文中一共展示了ZCmdBase.buildOptions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: buildOptions
# 需要导入模块: from Products.ZenUtils.ZCmdBase import ZCmdBase [as 别名]
# 或者: from Products.ZenUtils.ZCmdBase.ZCmdBase import buildOptions [as 别名]
def buildOptions(self):
"""Add optparse options to the options parser."""
ZCmdBase.buildOptions(self)
self.parser.add_option(
'--hubhost', dest='hubhost', default='localhost',
help="Host to use for connecting to ZenHub",
)
self.parser.add_option(
'--hubport', dest='hubport', type='int', default=PB_PORT,
help="Port to use for connecting to ZenHub",
)
self.parser.add_option(
'--hubusername', dest='hubusername', default='admin',
help="Login name to use when connecting to ZenHub",
)
self.parser.add_option(
'--hubpassword', dest='hubpassword', default='zenoss',
help="password to use when connecting to ZenHub",
)
self.parser.add_option(
'--call-limit', dest='call_limit', type='int', default=200,
help="Maximum number of remote calls before restarting worker",
)
self.parser.add_option(
'--profiling', dest='profiling',
action='store_true', default=False, help="Run with profiling on",
)
self.parser.add_option(
'--monitor', dest='monitor', default='localhost',
help='Name of the performance monitor this hub runs on',
)
self.parser.add_option(
'--workerid', dest='workerid', type='int', default=0,
help=SUPPRESS_HELP,
)
示例2: buildOptions
# 需要导入模块: from Products.ZenUtils.ZCmdBase import ZCmdBase [as 别名]
# 或者: from Products.ZenUtils.ZCmdBase.ZCmdBase import buildOptions [as 别名]
def buildOptions(self):
"""
Command-line options specific to this command
"""
ZCmdBase.buildOptions(self)
self.parser.add_option('-i', '--infile', dest='infile',
help='Input file for import. Default is stdin'
)
self.parser.add_option('--noindex', dest='noindex',
action='store_true', default=False,
help='Do not try to index the freshly loaded objects.'
)
self.parser.add_option('--chunksize', dest='chunk_size',
help='Number of objects to commit at a time.',
type='int',
default=100
)
self.parser.add_option(
'-n',
'--noCommit',
dest='noCommit',
action='store_true',
default=0,
help='Do not store changes to the DMD (ie for debugging purposes)',
)
示例3: buildOptions
# 需要导入模块: from Products.ZenUtils.ZCmdBase import ZCmdBase [as 别名]
# 或者: from Products.ZenUtils.ZCmdBase.ZCmdBase import buildOptions [as 别名]
def buildOptions(self):
ZCmdBase.buildOptions(self)
self.parser.add_option('--commit',
dest="commit",
action='store_true',
default=False,
help="Commit changes to the database")
self.parser.add_option('--name',
dest="name",
default='Test',
help="Root name for test devices, etc.")
self.parser.add_option('--repeat',
dest="repeat",
type="int",
default=1,
help="Number of devices to create")
self.parser.add_option('--everywhere',
dest="everywhere",
default=False,
action='store_true',
help="Create device(s) for every existing"
" event class")
self.parser.add_option('--onlyleafclasses',
dest="onlyleafclasses",
default=False,
action='store_true',
help="If --everywhere then only create devices"
" on leaf nodes of the device class tree.")
示例4: buildOptions
# 需要导入模块: from Products.ZenUtils.ZCmdBase import ZCmdBase [as 别名]
# 或者: from Products.ZenUtils.ZCmdBase.ZCmdBase import buildOptions [as 别名]
def buildOptions(self):
"""
Add our command-line options to the basics
"""
ZCmdBase.buildOptions(self)
self.parser.add_option('--show_options',
dest="show_options", default=False,
action="store_true",
help="Show the various options understood by the loader")
self.parser.add_option('--sample_configs',
dest="sample_configs", default=False,
action="store_true",
help="Show an example configuration file.")
self.parser.add_option('--showModelOutput',
dest="showModelOutput", default=True,
action="store_false",
help="Show modelling activity")
self.parser.add_option('--nocommit',
dest="nocommit", default=False,
action="store_true",
help="Don't commit changes to the ZODB. Use for verifying config file.")
self.parser.add_option('--nomodel',
dest="nomodel", default=False,
action="store_true",
help="Don't model the remote devices. Must be able to commit changes.")
示例5: buildOptions
# 需要导入模块: from Products.ZenUtils.ZCmdBase import ZCmdBase [as 别名]
# 或者: from Products.ZenUtils.ZCmdBase.ZCmdBase import buildOptions [as 别名]
def buildOptions(self):
"""
Add our command-line options to the basics
"""
ZCmdBase.buildOptions(self)
self.parser.add_option('--root',
dest = "root", default = "",
help = "Set the root Device Path to dump (eg: /Devices/Servers "
"or /Devices/Network/Cisco/Nexus; default: /Devices)")
self.parser.add_option('-o', '--outFile',
dest = 'outFile', default = sys.__stdout__,
help = "Specify file to which zenbatchdump will write output")
self.parser.add_option('--regex',
dest = 'regex', default = '.*',
help = "Specify include filter for device objects")
self.parser.add_option('--prune',
dest = 'prune', default = False,
action = 'store_true',
help = "Should DeviceClasses only be dumped if part of root path")
self.parser.add_option('--allzprops',
dest = 'allzprops', default = False,
action = 'store_true',
help = "Should z properties (including acquired values) be dumped?")
self.parser.add_option('--noorganizers',
dest = 'noorganizers', default = False,
action = 'store_true',
help = "Should organizers (device classes, groups, etc) be dumped?")
示例6: buildOptions
# 需要导入模块: from Products.ZenUtils.ZCmdBase import ZCmdBase [as 别名]
# 或者: from Products.ZenUtils.ZCmdBase.ZCmdBase import buildOptions [as 别名]
def buildOptions(self):
"""Options, mostly to find where zenhub lives
These options should be passed (by file) from zenhub.
"""
ZCmdBase.buildOptions(self)
self.parser.add_option('--hubhost',
dest='hubhost',
default='localhost',
help="Host to use for connecting to ZenHub")
self.parser.add_option('--hubport',
dest='hubport',
type='int',
help="Port to use for connecting to ZenHub",
default=PB_PORT)
self.parser.add_option('--username',
dest='username',
help="Login name to use when connecting to ZenHub",
default='zenoss')
self.parser.add_option('--password',
dest='password',
help="password to use when connecting to ZenHub",
default='zenoss')
self.parser.add_option('--calllimit',
dest='calllimit',
type='int',
help="Maximum number of remote calls before restarting worker",
default=200)
示例7: buildOptions
# 需要导入模块: from Products.ZenUtils.ZCmdBase import ZCmdBase [as 别名]
# 或者: from Products.ZenUtils.ZCmdBase.ZCmdBase import buildOptions [as 别名]
def buildOptions(self):
"""basic options setup sub classes can add more options here"""
ZCmdBase.buildOptions(self)
self.parser.add_option("-i", "--infile", dest="infile", help="Input file for import. The default is stdin")
print "Build option infile"
self.parser.add_option(
"-x",
"--commitCount",
dest="commitCount",
default=20,
type="int",
help="How many lines should be loaded before a database commit",
)
self.parser.add_option(
"--noindex",
dest="noindex",
action="store_true",
default=False,
help="Do not try to index data that was just loaded",
)
self.parser.add_option(
"-n",
"--noCommit",
dest="noCommit",
action="store_true",
default=0,
help="Do not store changes to the Dmd (for debugging)",
)
示例8: buildOptions
# 需要导入模块: from Products.ZenUtils.ZCmdBase import ZCmdBase [as 别名]
# 或者: from Products.ZenUtils.ZCmdBase.ZCmdBase import buildOptions [as 别名]
def buildOptions(self):
ZCmdBase.buildOptions(self)
self.parser.add_option('-f', '--force', dest='force',
action='store_true', default=0,
help="Load all reports, overwriting any existing reports.")
self.parser.add_option('-d', '--dir', dest='dir',
default="reports",
help="Directory from which to load reports: default '%default'")
self.parser.add_option('-p', '--zenpack', dest='zenpack',
default='',
help="ZenPack from which to load reports")
示例9: buildOptions
# 需要导入模块: from Products.ZenUtils.ZCmdBase import ZCmdBase [as 别名]
# 或者: from Products.ZenUtils.ZCmdBase.ZCmdBase import buildOptions [as 别名]
def buildOptions(self):
ZCmdBase.buildOptions(self)
self.parser.add_option('-x', '--commitCount',
dest='commitCount',
default=20,
type="int",
help='how many lines should be loaded before commit')
self.parser.add_option('-n', '--noCommit',
dest='noCommit',
action="store_true",
default=0,
help='Do not store changes to the Dmd (for debugging)')
示例10: buildOptions
# 需要导入模块: from Products.ZenUtils.ZCmdBase import ZCmdBase [as 别名]
# 或者: from Products.ZenUtils.ZCmdBase.ZCmdBase import buildOptions [as 别名]
def buildOptions(self):
ZCmdBase.buildOptions(self)
self.parser.add_option( '--jabber_pass', dest='jabber_pass', help='Password used to connect to the XMPP server')
self.parser.add_option( '--jabber_user', dest='jabber_user', help='Username used to connect to the XMPP server')
self.parser.add_option( '--jabber_host', dest='jabber_host', default='localhost', help='XMPP server to connect')
self.parser.add_option( '--jabber_port', dest='jabber_port', default='5222', help='Port used to connect to the XMPP server')
self.parser.add_option( '--first_user', dest='first_user', help='User mapping to bootstrap the bot with at least on authorized user. Example specification myzenossname,[email protected]')
self.parser.add_option( '--im_host', dest='im_host', help='Optional option for addressing IM users when the server is not known. If this is ommitted, jabber_host will be used.')
self.parser.add_option( '--ssl', dest='ssl', action='store_true', help='Use ssl.')
self.parser.add_option( '--group_server', dest='group_server', help='Conference/groupchat server. If the name has no dots, it will use group_server.jabber_host')
self.parser.add_option( '--chatroom', dest='chatroom', help='First chatroom joined to when connecting')
self.parser.add_option('--cycletime', dest='cycletime', default=60, type='int', help='check events every cycletime seconds')
self.parser.add_option( '--zopeurl', dest='zopeurl', default='http://%s:%d' % (socket.getfqdn(), 8080), help='http path to the root of the zope server')
self.parser.add_option('--monitor', dest='monitor', default=DEFAULT_MONITOR, help='Name of monitor instance to use for heartbeat events. Default is %s.' % DEFAULT_MONITOR)
示例11: buildOptions
# 需要导入模块: from Products.ZenUtils.ZCmdBase import ZCmdBase [as 别名]
# 或者: from Products.ZenUtils.ZCmdBase.ZCmdBase import buildOptions [as 别名]
def buildOptions(self):
"""
Command-line options setup
"""
ZCmdBase.buildOptions(self)
self.parser.add_option('-o', '--outfile',
dest="outfile",
help="Output file for exporting XML objects. Default is stdout")
self.parser.add_option('--ignore', action="append",
dest="ignorerels", default=[],
help="Relations that should be ignored. Every relation to" + \
" ignore must be specified with a separate --ignorerels option." )
示例12: buildOptions
# 需要导入模块: from Products.ZenUtils.ZCmdBase import ZCmdBase [as 别名]
# 或者: from Products.ZenUtils.ZCmdBase.ZCmdBase import buildOptions [as 别名]
def buildOptions(self):
ZCmdBase.buildOptions(self)
self.parser.add_option('-s', '--step', dest='step', type='int',
default=300, help='Default step size in seconds')
self.parser.add_option('-r', '--root', dest='root',
default=performancePath(''),
help='Root tree to convert')
self.parser.add_option('-f', '--file', dest='filename',
help='Root tree to convert')
self.parser.add_option('--commit', dest='commit', action='store_true',
default=False,
help='Really put the converted files in place.')
self.parser.add_option('--monitor', dest='monitor',
default='localhost',
help='Name of this collection host.')
示例13: buildOptions
# 需要导入模块: from Products.ZenUtils.ZCmdBase import ZCmdBase [as 别名]
# 或者: from Products.ZenUtils.ZCmdBase.ZCmdBase import buildOptions [as 别名]
def buildOptions(self):
"""
Add our command-line options to the basics
"""
ZCmdBase.buildOptions(self)
self.parser.add_option('--show_options',
dest="show_options", default=False,
action="store_true",
help="Show the various options understood by "
"the loader")
self.parser.add_option('--sample_configs',
dest="sample_configs", default=False,
action="store_true",
help="Show an example configuration file.")
self.parser.add_option('--showModelOutput',
dest="showModelOutput", default=True,
action="store_false",
help="Show modelling activity")
self.parser.add_option('--nocommit',
dest="nocommit", default=False,
action="store_true",
help="Don't commit changes to the ZODB. "
"Use for verifying config file.")
self.parser.add_option('--nomodel',
dest="nomodel", default=False,
action="store_true",
help="Don't model the remote devices. "
"Must be able to commit changes.")
self.parser.add_option('--reject_file', dest="reject_file",
help="If specified, use as the name of a file "
"to store unparseable lines")
self.parser.add_option('--must_be_resolvable',
dest="must_be_resolvable", default=False,
action="store_true",
help="Do device entries require an IP address "
"or be DNS resolvable?")
示例14: buildOptions
# 需要导入模块: from Products.ZenUtils.ZCmdBase import ZCmdBase [as 别名]
# 或者: from Products.ZenUtils.ZCmdBase.ZCmdBase import buildOptions [as 别名]
def buildOptions(self):
ZCmdBase.buildOptions(self)
self.parser.usage = "%prog [options] report_plugin [report_paramater=value]*"
self.parser.remove_option('--daemon')
self.parser.remove_option('--cycle')
self.parser.remove_option('--watchdog')
self.parser.remove_option('--watchdogPath')
self.parser.remove_option('--socketOption')
self.parser.add_option("--list",
action="store_true",
default=False,
help="Show full names of all plugins to run. If the plugin" \
" name is unique, just the name may be used." )
self.parser.add_option("--export",
default='python',
help="Export the values as 'python' (default) or 'csv'")
self.parser.add_option("--export_file",
default='',
help="Optional filename to store the output")
示例15: buildOptions
# 需要导入模块: from Products.ZenUtils.ZCmdBase import ZCmdBase [as 别名]
# 或者: from Products.ZenUtils.ZCmdBase.ZCmdBase import buildOptions [as 别名]
def buildOptions(self):
"""basic options setup sub classes can add more options here"""
ZCmdBase.buildOptions(self)
self.parser.add_option("--createcatalog",
action="store_true",
default=False,
help="Create global catalog and populate it")
self.parser.add_option("--forceindex",
action="store_true",
default=False,
help="works with --createcatalog to re-create index, if catalog exists it will be "\
"dropped first")
self.parser.add_option("--reindex",
action="store_true",
default=False,
help="reindex existing catalog")
self.parser.add_option("--permissionsOnly",
action="store_true",
default=False,
help="Only works with --reindex, only update the permissions catalog")