本文整理汇总了Python中Products.ZenUtils.ZenScriptBase.ZenScriptBase.buildOptions方法的典型用法代码示例。如果您正苦于以下问题:Python ZenScriptBase.buildOptions方法的具体用法?Python ZenScriptBase.buildOptions怎么用?Python ZenScriptBase.buildOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products.ZenUtils.ZenScriptBase.ZenScriptBase
的用法示例。
在下文中一共展示了ZenScriptBase.buildOptions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: buildOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import buildOptions [as 别名]
def buildOptions(self):
self.parser.add_option('--step',
action='append',
dest="steps",
help="Run the specified step. This option "
'can be specified multiple times to run '
'more than one step.')
# NB: The flag for this setting indicates a false value for the setting.
self.parser.add_option('--dont-commit',
dest="commit",
action='store_false',
default=True,
help="Don't commit changes to the database")
self.parser.add_option('--list',
action='store_true',
default=False,
dest="list",
help="List all the steps")
self.parser.add_option('--level',
dest="level",
type='string',
default=None,
help="Run the steps for the specified level "
' and above.')
self.parser.add_option('--newer',
dest='newer',
action='store_true',
default=False,
help='Only run steps with versions higher '
'than the current database version.'
'Usually if there are no newer '
'migrate steps the current steps '
'are rerun.')
ZenScriptBase.buildOptions(self)
示例2: buildOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import buildOptions [as 别名]
def buildOptions(self):
ZenScriptBase.buildOptions(self)
self.parser.add_option('--collector', dest='collectorId', default='localhost', metavar='COLLECTOR_ID',
help="Name of specific collector on which to run the command")
self.parser.add_option('--timeout', dest='timeout',
default=60, type="int",
help="Kill the process after this many seconds.")
示例3: buildOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import buildOptions [as 别名]
def buildOptions(self):
ZenScriptBase.buildOptions(self)
self.parser.add_option(
"--age", dest="age", type="int", default=1, help="Number of days old to consider fresh (default=1)"
)
self.parser.add_option(
"--all",
dest="all",
action="store_true",
default=False,
help="Check all data points. Not just ones used in graphs",
)
self.parser.add_option(
"--pathcache",
dest="pathcache",
action="store_true",
default=False,
help="Cache the full list of RRD file paths in the model",
)
self.parser.add_option(
"--devicesonly",
dest="devicesonly",
action="store_true",
default=False,
help="Only check for device files. Not components",
)
self.parser.add_option("--collector", dest="collector", help="Name of specific collector to check (optional)")
self.parser.add_option("-o", "--file", dest="file", help="Output filename")
self.parser.add_option(
"--sendevent",
dest="sendevent",
action="store_true",
default=False,
help="Send an event with statistics per collector",
)
示例4: buildOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import buildOptions [as 别名]
def buildOptions(self):
ZenScriptBase.buildOptions(self)
self.parser.add_option('--url', '-u',
dest='url',
default=None,
help='URL of report to send')
self.parser.add_option('--reportFileType', '-r',
dest='reportFileType',
default='PDF',
help='report file type (%s)' % "|".join(gValidReportFileTypes))
self.parser.add_option('--user', '-U',
dest='user',
default='admin',
help="User to log into Zenoss")
self.parser.add_option('--passwd', '-p',
dest='passwd',
help="Password to log into Zenoss")
self.parser.add_option('--address', '-a',
dest='addresses',
default=[],
action='append',
help='Email address destination '
'(may be given more than once). Default value'
"comes from the user's profile.")
self.parser.add_option('--subject', '-s',
dest='subject',
default='',
help='Subject line for email message.'
'Default value is the title of the html page.')
self.parser.add_option('--from', '-f',
dest='fromAddress',
default='[email protected]',
help='Origination address')
示例5: buildOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import buildOptions [as 别名]
def buildOptions(self):
"""
add some additional options
"""
ZenScriptBase.buildOptions(self)
self.parser.add_option('--mode',
dest="mode", default=None,
help="Specify operating mode:\neval = evaluate an existing "\
"threshold against a specific device\ntest = create a " \
"test threshold and evaluate it against a device")
self.parser.add_option('--device', "-d",
dest="device", type="str", default=None,
help="Specfiy a device for threshold evaluation (eval & test mode)")
self.parser.add_option('--template_path', '-p', type="str",
dest="tpath", default=None,
help="Specify the path to a template path i.e. /zport/dmd/Devices/rrdTemplates/Device (eval mode)")
self.parser.add_option('--min', '-i', type="str",
dest="min", default=None,
help="Specify a minimum value to be used for the threshold (eval mode)")
self.parser.add_option('--max', '-a', type="str",
dest="max", default=None,
help="Specify a maximum value to be used for the threshold (eval mode)")
self.parser.add_option('--value', type="str",
dest="value", default=None,
help="Specify an artificial value to use for threshold evaluation (eval mode)")
示例6: buildOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import buildOptions [as 别名]
def buildOptions(self):
ZenScriptBase.buildOptions(self)
self.parser.add_option("-f", "--file", dest="filename",
help="write json to FILE", metavar="FILE")
self.parser.add_option("-z", "--zenpack", dest="zenpack",
help="ZenPack to Dump Templates From",
metavar="ZenPack")
示例7: buildOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import buildOptions [as 别名]
def buildOptions(self):
self.parser.add_option('--list',
dest='list',
default=False,
action='store_true',
help='List the names of ZenPack-supplied daemons'
)
ZenScriptBase.buildOptions(self)
示例8: buildOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import buildOptions [as 别名]
def buildOptions(self):
self.parser.add_option('--newid',
dest='newid',
default=None,
help='Specify a new name for this ZenPack. '
'It must contain at least three package names '
'separated by periods, the first one being '
'"ZenPacks"')
ZenScriptBase.buildOptions(self)
示例9: buildOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import buildOptions [as 别名]
def buildOptions(self):
"""
"""
ZenScriptBase.buildOptions(self)
self.parser.add_option('--name', dest='name',
help='Friendly name for test')
self.parser.add_option('--url', dest='url',
help='URL for Twill script')
self.parser.add_option('--script', dest='script',
help='script contents')
示例10: buildOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import buildOptions [as 别名]
def buildOptions(self):
ZenScriptBase.buildOptions(self)
self.parser.add_option('--collector', dest='collector',
help="Name of specific collector on which to run the command")
self.parser.add_option('--timeout', dest='timeout',
default=60, type="int",
help="Kill the process after this many seconds.")
self.parser.add_option('-n', '--useprefix', action='store_false',
dest='useprefix', default=True,
help="Prefix the collector name for remote servers")
示例11: buildOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import buildOptions [as 别名]
def buildOptions(self):
self.parser.add_option('--install',
dest='installPackName',
default=None,
help="Path to the ZenPack to install.")
self.parser.add_option('--fetch',
dest='fetch',
default=None,
help='Name of ZenPack to retrieve from '
'Zenoss and install.')
self.parser.add_option('--remove', '--delete', '--uninstall', '--erase',
dest='removePackName',
default=None,
help="Name of the ZenPack to remove.")
self.parser.add_option('--list',
dest='list',
action="store_true",
default=False,
help='List installed ZenPacks')
self.parser.add_option('--link',
dest='link',
action="store_true",
default=False,
help="Install the ZenPack in place, without "
"copying into $ZENHOME/ZenPacks.")
self.parser.add_option('--files-only',
dest='filesOnly',
action="store_true",
default=False,
help='Install the ZenPack files onto the '
'filesystem, but do not install the '
'ZenPack into Zenoss.')
self.parser.add_option('--fromui',
dest='fromui',
action="store_true",
default=False,
help=optparse.SUPPRESS_HELP)
self.parser.add_option('--previousversion',
dest='previousVersion',
default=None,
help="Previous version of the zenpack;"
' used during upgrades')
self.parser.add_option('--if-installed',
action="store_true",
dest='ifinstalled',
default=False,
help="Delete ZenPack only if installed")
self.parser.add_option('--skip-same-version',
action="store_true",
dest='skipSameVersion',
default=False,
help="Do not install the zenpack if the version is unchanged")
self.parser.prog = "zenpack"
ZenScriptBase.buildOptions(self)
示例12: buildOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import buildOptions [as 别名]
def buildOptions(self):
ZenScriptBase.buildOptions(self)
self.parser.add_option('-d', '--device',
dest="device",
help="Device on which to test command")
self.parser.add_option('--datasource',
dest="dsName",
help="COMMAND datasource to test")
self.parser.add_option('-t', '--timeout',
dest="timeout", default=1, type="int",
help="Command timeout")
示例13: buildOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import buildOptions [as 别名]
def buildOptions(self):
''''''
ZenScriptBase.buildOptions(self)
# remove unneeded
self.parser.remove_option('-C')
self.parser.remove_option('--genconf')
self.parser.remove_option('--genxmltable')
self.parser.remove_option('--genxmlconfigs')
self.parser.remove_option('--maxlogsize')
self.parser.remove_option('--maxbackuplogs')
self.parser.remove_option('--logpath')
self.parser.usage = "%prog [options] [FILENAME|ZENPACK|DEVICE]"
self.parser.version = self.version
group = OptionGroup(self.parser, "ZenPack Conversion")
group.add_option("-t", "--dump-templates",
dest="dump",
action="store_true",
help="export existing monitoring templates to YAML")
group.add_option("-e", "--dump-event-classes",
dest="dump_event_classes",
action="store_true",
help="export existing event classes to YAML")
group.add_option("-r", "--dump-process-classes",
dest="dump_process_classes",
action="store_true",
help="export existing process classes to YAML")
self.parser.add_option_group(group)
group = OptionGroup(self.parser, "ZenPack Development")
group.add_option("-c", "--create",
dest="create",
action="store_true",
help="Create a new ZenPack source directory")
group.add_option("-l", "--lint",
dest="lint",
action="store_true",
help="check zenpack.yaml syntax for errors")
group.add_option("-o", "--optimize",
dest="optimize",
action="store_true",
help="optimize zenpack.yaml format and DEFAULTS")
group.add_option("-d", "--diagram",
dest="diagram",
action="store_true",
help="print YUML (http://yuml.me/) class diagram source based on zenpack.yaml")
group.add_option("-p", "--paths",
dest="paths",
action="store_true",
help="print possible facet paths for a given device and whether currently filtered.")
self.parser.add_option_group(group)
示例14: buildOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import buildOptions [as 别名]
def buildOptions(self):
"""basic options setup sub classes can add more options here"""
ZenScriptBase.buildOptions(self)
self.parser.add_option('--userid',
dest="userid",default="",
help="name of user who is acking the event")
self.parser.add_option('--evid',
dest="evids", action="append",
help="event id that is acked")
self.parser.add_option('--state', type='int',
dest="state", default=1,
help="event id that is acked [default: ack]")
示例15: buildOptions
# 需要导入模块: from Products.ZenUtils.ZenScriptBase import ZenScriptBase [as 别名]
# 或者: from Products.ZenUtils.ZenScriptBase.ZenScriptBase import buildOptions [as 别名]
def buildOptions(self):
ZenScriptBase.buildOptions(self)
self.parser.add_option('--export', dest='export',
action='store_true', default=False,
help='Perform an XML export of an object')
self.parser.add_option('--object', dest='object',
help='Full path to the object being exported ' +
'(e.g. /zport/dmd/Devices/rrdTemplates/Oracle Tablespaces)')
self.parser.add_option('--import', dest='imprt',
action='store_true', default=False,
help='Perform an import of an object from XML')
self.parser.add_option('--file', dest='file',
help='Filename to of XML to import')