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?")
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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.')
Exemplo n.º 4
0
 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,
     )
Exemplo n.º 5
0
 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.")
Exemplo n.º 6
0
 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)',
         )
Exemplo n.º 7
0
 def buildOptions(self):
     ZCmdBase.buildOptions(self)
     self.parser.add_option('--name',
                            dest='name',
                            default=getfqdn(),
                            help=("host that roots the ping dependency "
                                  "tree: typically the collecting hosts' "
                                  "name; defaults to our fully qualified "
                                  "domain name (%s)" % getfqdn()))
     self.parser.add_option('--test',
                            dest='test',
                            default=False,
                            action="store_true",
                            help="Run in test mode: doesn't really ping,"
                            " but reads the list of IP Addresses that "
                            " are up from /tmp/testping")
     self.parser.add_option(
         '--useFileDescriptor',
         dest='useFileDescriptor',
         default=None,
         help="use the given (privileged) file descriptor")
     self.parser.add_option('--minConfigWait',
                            dest='minconfigwait',
                            default=300,
                            type='int',
                            help="the minimal time, in seconds, "
                            "between refreshes of the config")
Exemplo n.º 8
0
    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)",
        )
    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.")
Exemplo n.º 10
0
 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)',
     )
Exemplo n.º 11
0
 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)
 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.")
Exemplo n.º 13
0
 def buildOptions(self):
     ZCmdBase.buildOptions(self)
     self.parser.add_option('-i',
                            '-f',
                            '--file',
                            dest='eventFile',
                            help='Name of the file to replay')
     self.parser.set_defaults(logseverity=logging.DEBUG)
 def buildOptions(self):
     ZCmdBase.buildOptions(self)
     self.parser.add_option('-f',
                            '--force',
                            dest='force',
                            action='store_true',
                            default=0,
                            help="Force load all the reports")
    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?"
        )
Exemplo n.º 16
0
 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,
     )
Exemplo n.º 17
0
 def buildOptions(self):
     ZCmdBase.buildOptions(self)
     self.parser.add_option(
         '--monitor',
         dest='monitor',
         default='localhost',
         help="Specify the collector to collect against.")
     self.parser.add_option('-d',
                            '--device',
                            dest='device',
                            help="Show the configs for a single device")
Exemplo n.º 18
0
 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")
Exemplo n.º 19
0
 def buildOptions(self):
     """
     Command-line options
     """
     ZCmdBase.buildOptions(self)
     self.parser.add_option(
         '--mibsdir',
         dest='mibsdir',
         default=zenPath('share/mibs/site'),
         help="Directory of input MIB files [ default: %default ]")
     self.parser.add_option(
         '--mibdepsdir',
         dest='mibdepsdir',
         default=zenPath('share/mibs'),
         help="Directory of input MIB files [ default: %default ]")
     self.parser.add_option('--path',
                            dest='path',
                            default="/",
                            help="Path to load MIB into the DMD")
     self.parser.add_option(
         '--nocommit',
         action='store_true',
         dest='nocommit',
         default=False,
         help="Don't commit the MIB to the DMD after loading")
     self.parser.add_option(
         '--keeppythoncode',
         action='store_true',
         dest='keeppythoncode',
         default=False,
         help="Don't commit the MIB to the DMD after loading")
     self.parser.add_option('--pythoncodedir', dest='pythoncodedir',
         default=tempfile.gettempdir() + "/mib_pythoncode/",
         help="This is the directory where the converted MIB will be output. " \
             "[ default: %default ]")
     self.parser.add_option('--downloaddir', dest='downloaddir',
         default=tempfile.gettempdir() + "/mib_downloads/",
         help="This is the directory where the MIB will be downloaded. " \
             "[ default: %default ]")
     self.parser.add_option('--extractdir', dest='extractdir',
         default=tempfile.gettempdir() + "/mib_extract/",
         help="This is the directory where unzipped MIB files will be stored. " \
             "[ default: %default ]")
     self.parser.add_option('--evalSavedPython', dest='evalSavedPython',
                        default=[], action='append',
                        help="Execute the Python code previously generated" \
                             " and saved.")
     self.parser.add_option(
         '--keepMiddleZeros',
         dest='keep_middle_zeros',
         default=False,
         action='store_true',
         help="Does not remove zeros found in the middle of the oid.")
    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?")

        self.parser.add_option(
            '--collectors_only',
            dest='collectors_only',
            default=False,
            action='store_true',
            help="Dump only the distributed hub/collector information?")
Exemplo n.º 21
0
 def buildOptions(self):
     ZCmdBase.buildOptions(self)
     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=getDefaultZopeUrl(),
         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)
Exemplo n.º 22
0
    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)')
Exemplo n.º 23
0
 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)
Exemplo n.º 24
0
    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." )
Exemplo n.º 25
0
 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)
Exemplo n.º 26
0
    def buildOptions(self):
        """Add ZenHub command-line options."""
        ZCmdBase.buildOptions(self)
        self.parser.add_option(
            '--xmlrpcport',
            '-x',
            dest='xmlrpcport',
            type='int',
            default=server_config.defaults.xmlrpcport,
            help='Port to use for XML-based Remote Procedure Calls (RPC)')
        self.parser.add_option('--pbport',
                               dest='pbport',
                               type='int',
                               default=server_config.defaults.pbport,
                               help="Port to use for Twisted's pb service")
        self.parser.add_option('--passwd',
                               dest='passwordfile',
                               type='string',
                               default=zenPath('etc', 'hubpasswd'),
                               help='File where passwords are stored')
        self.parser.add_option(
            '--monitor',
            dest='monitor',
            default='localhost',
            help='Name of the distributed monitor this hub runs on')
        self.parser.add_option(
            '--workers-reserved-for-events',
            dest='workersReservedForEvents',
            type='int',
            default=1,
            help="Number of worker instances to reserve for handling events")
        self.parser.add_option(
            '--invalidation-poll-interval',
            type='int',
            default=30,
            help="Interval at which to poll invalidations (default: %default)")
        self.parser.add_option('--profiling',
                               dest='profiling',
                               action='store_true',
                               default=False,
                               help="Run with profiling on")
        self.parser.add_option(
            '--modeling-pause-timeout',
            type='int',
            default=server_config.defaults.modeling_pause_timeout,
            help='Maximum number of seconds to pause modeling during ZenPack'
            ' install/upgrade/removal (default: %default)')

        notify(ParserReadyForOptionsEvent(self.parser))
Exemplo n.º 27
0
 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.')
Exemplo n.º 28
0
 def buildOptions(self):
     ZCmdBase.buildOptions(self)
     self.parser.add_option('--class',
                            dest='deviceClass',
                            default='/',
                            help="Device class to operate on")
     self.parser.add_option('--zproperty',
                            dest='zPropName',
                            default=None,
                            help="Name of the zProperty to remove from"
                                 " devices")
     self.parser.add_option('-r', '--recurse',
                            dest='recurse',
                            action="store_true",
                            default=False,
                            help="Recurse into subclasses of --class")
Exemplo n.º 29
0
    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." )
Exemplo n.º 30
0
    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)')
Exemplo n.º 31
0
 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)
     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 distributed monitor this hub runs on')
     self.parser.add_option('--workernum',
                            dest='workernum',
                            type='int',
                            default=0)
Exemplo n.º 32
0
    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?")
Exemplo n.º 33
0
 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")
Exemplo n.º 34
0
 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")
Exemplo n.º 35
0
 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")
Exemplo n.º 36
0
 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")
Exemplo n.º 37
0
    def buildOptions(self):
        """
        Adds our command line options to ZCmdBase command line options.
        """
        ZCmdBase.buildOptions(self)
        self.parser.add_option(
            '--xmlrpcport', '-x', dest='xmlrpcport',
            type='int', default=XML_RPC_PORT,
            help='Port to use for XML-based Remote Procedure Calls (RPC)')
        self.parser.add_option(
            '--pbport', dest='pbport',
            type='int', default=PB_PORT,
            help="Port to use for Twisted's pb service")
        self.parser.add_option(
            '--passwd', dest='passwordfile',
            type='string', default=zenPath('etc', 'hubpasswd'),
            help='File where passwords are stored')
        self.parser.add_option(
            '--monitor', dest='monitor',
            default='localhost',
            help='Name of the distributed monitor this hub runs on')
        self.parser.add_option(
            '--workers-reserved-for-events', dest='workersReservedForEvents',
            type='int', default=1,
            help="Number of worker instances to reserve for handling events")
        self.parser.add_option(
            '--invalidation-poll-interval',
            type='int', default=30,
            help="Interval at which to poll invalidations (default: %default)")
        self.parser.add_option(
            '--profiling', dest='profiling',
            action='store_true', default=False,
            help="Run with profiling on")
        self.parser.add_option(
            '--modeling-pause-timeout',
            type='int', default=3600,
            help='Maximum number of seconds to pause modeling during ZenPack'
                 ' install/upgrade/removal (default: %default)')

        notify(ParserReadyForOptionsEvent(self.parser))
Exemplo n.º 38
0
 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")
Exemplo n.º 39
0
 def buildOptions(self):
     """
     Command-line options
     """
     ZCmdBase.buildOptions(self)
     self.parser.add_option('--mibsdir',
                            dest='mibsdir', default=zenPath('share/mibs/site'),
                    help="Directory of input MIB files [ default: %default ]")
     self.parser.add_option('--mibdepsdir',
                     dest='mibdepsdir', default=zenPath('share/mibs'),
                    help="Directory of input MIB files [ default: %default ]")
     self.parser.add_option('--path',
                            dest='path', default="/",
                            help="Path to load MIB into the DMD")
     self.parser.add_option('--nocommit', action='store_true',
                            dest='nocommit', default=False,
                        help="Don't commit the MIB to the DMD after loading")
     self.parser.add_option('--keeppythoncode', action='store_true',
                            dest='keeppythoncode', default=False,
                        help="Don't commit the MIB to the DMD after loading")
     self.parser.add_option('--pythoncodedir', dest='pythoncodedir',
         default=tempfile.gettempdir() + "/mib_pythoncode/",
         help="This is the directory where the converted MIB will be output. " \
             "[ default: %default ]")
     self.parser.add_option('--downloaddir', dest='downloaddir',
         default=tempfile.gettempdir() + "/mib_downloads/",
         help="This is the directory where the MIB will be downloaded. " \
             "[ default: %default ]")
     self.parser.add_option('--extractdir', dest='extractdir',
         default=tempfile.gettempdir() + "/mib_extract/",
         help="This is the directory where unzipped MIB files will be stored. " \
             "[ default: %default ]")
     self.parser.add_option('--evalSavedPython', dest='evalSavedPython',
                        default=[], action='append',
                        help="Execute the Python code previously generated" \
                             " and saved.")
     self.parser.add_option('--keepMiddleZeros', dest='keep_middle_zeros',
                        default=False, action='store_true',
                        help="Does not remove zeros found in the middle of the oid.")
Exemplo n.º 40
0
    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)')
Exemplo n.º 41
0
    def buildOptions(self):
        """
        Adds our command line options to ZCmdBase command line options.
        """
        ZCmdBase.buildOptions(self)
        self.parser.add_option(
            '--xmlrpcport',
            '-x',
            dest='xmlrpcport',
            type='int',
            default=XML_RPC_PORT,
            help='Port to use for XML-based Remote Procedure Calls (RPC)')
        self.parser.add_option('--pbport',
                               dest='pbport',
                               type='int',
                               default=PB_PORT,
                               help="Port to use for Twisted's pb service")
        self.parser.add_option('--passwd',
                               dest='passwordfile',
                               type='string',
                               default=zenPath('etc', 'hubpasswd'),
                               help='File where passwords are stored')
        self.parser.add_option(
            '--monitor',
            dest='monitor',
            default='localhost',
            help='Name of the distributed monitor this hub runs on')
        self.parser.add_option(
            '--workers',
            dest='workers',
            type='int',
            default=2,
            help="Number of worker instances to handle requests")
        self.parser.add_option(
            '--hubworker-priority',
            type='int',
            default=5,
            help="Relative process priority for hub workers (%default)")
        self.parser.add_option(
            '--prioritize',
            dest='prioritize',
            action='store_true',
            default=False,
            help="Run higher priority jobs before lower priority ones")
        self.parser.add_option(
            '--anyworker',
            dest='anyworker',
            action='store_true',
            default=False,
            help='Allow any priority job to run on any worker')
        self.parser.add_option(
            '--workers-reserved-for-events',
            dest='workersReservedForEvents',
            type='int',
            default=1,
            help="Number of worker instances to reserve for handling events")
        self.parser.add_option(
            '--worker-call-limit',
            dest='worker_call_limit',
            type='int',
            default=200,
            help=
            "Maximum number of remote calls a worker can run before restarting"
        )
        self.parser.add_option(
            '--invalidation-poll-interval',
            type='int',
            default=30,
            help="Interval at which to poll invalidations (default: %default)")
        self.parser.add_option('--profiling',
                               dest='profiling',
                               action='store_true',
                               default=False,
                               help="Run with profiling on")
        self.parser.add_option(
            '--modeling-pause-timeout',
            type='int',
            default=3600,
            help=
            "Maximum number of seconds to pause modeling during ZenPack install/upgrade/removal (default: %default)"
        )

        notify(ParserReadyForOptionsEvent(self.parser))
Exemplo n.º 42
0
 def buildOptions(self):
     ZCmdBase.buildOptions(self)
     self.parser.add_option('-i', '--file',
      dest = "input_file",
      help = "Events.xml file to import")
Exemplo n.º 43
0
 def buildOptions(self):
     ZCmdBase.buildOptions(self)
     self.parser.add_option('-i', '-f', '--file',
                 dest='eventFile',
                 help='Name of the file to replay')
     self.parser.set_defaults(logseverity=logging.DEBUG)
Exemplo n.º 44
0
 def buildOptions(self):
     ZCmdBase.buildOptions(self)
     self.parser.add_option('--monitor', '--collector', dest='monitor', default='localhost',
                            help="Specify the collector to collect against.")
     self.parser.add_option('-d', '--device', dest='device',
                            help="Show the configs for a single device")
Exemplo n.º 45
0
 def buildOptions(self):
     ZCmdBase.buildOptions(self)
     self.parser.add_option('-f', '--force', dest='force', 
                            action='store_true', default=0,
                            help="Force load all the reports")