Ejemplo n.º 1
0
 def options(cls):
     logging.debug('Making options for %s', cls)
     result = configs.BASIC_OPTIONS + [
         configs.OxMonOption('target',
                             help=('Path to target file to check.')),
         configs.OxMonOption(
             '--live',
             default=False,
             type=bool,
             is_flag=1,
             help=('If this option is given then file must exist.')),
         configs.OxMonOption(
             '--dead',
             default=False,
             type=bool,
             is_flag=1,
             help=('If this option is given then file must not exist.')),
         configs.OxMonOption(
             '--max-age-in-hours',
             type=float,
             help=(
                 'If given and file exists and is older then alarm raised.'
             )),
         configs.OxMonOption(
             '--max-age-in-days',
             type=float,
             help=(
                 'If given and file exists and is older then alarm raised.'
             ))
     ]
     return result
Ejemplo n.º 2
0
 def options(cls):
     logging.debug('Making options for %s', cls)
     result = configs.BASIC_OPTIONS + [
         configs.OxMonOption(
             '--cmd', help=('Command to run.')),
         configs.OxMonOption(
             '--args', default='', help=(
                 'Comma separated list of args to pass to --cmd. '
                 'We replace colons with dashes so e.g., :v becomes -v.')),
         configs.OxMonOption(
             '--stdout', default='@STDOUT', help=(
                 'Where to send stdout of the underling command. '
                 'If you provide @STDOUT then the output from --cmd '
                 'will go on the standard output stream. You can also '
                 'provide @STDERR or path to a file or @NULL.')),
         configs.OxMonOption(
             '--stderr', default='@STDERR', help=(
                 'Where to send stderr of the underling command. '
                 'If you provide @STDERR then the output from --cmd '
                 'will go on the standard error stream. You can also '
                 'provide @STDERR or path to a file or @NULL.')),
         configs.OxMonOption(
             '--shell', default=False, help=(
                 'Whether to run --cmd through the shell.')),
         ]
     return result
Ejemplo n.º 3
0
 def options(cls):
     logging.debug('Making options for %s', cls)
     result = configs.BASIC_OPTIONS + [
         configs.OxMonOption('watch',
                             default=None,
                             required=True,
                             help=('Directory to watch for changes.')),
         configs.OxMonOption('archive',
                             default=None,
                             required=True,
                             help=('Directory to copy changes to.')),
     ]
     return result
Ejemplo n.º 4
0
 def options(cls):
     "Override to provide options for ClamScanShellChecker."
     logging.debug('Making options for %s', cls)
     result = configs.BASIC_OPTIONS + [
         configs.OxMonOption(
             'target', type=click.Path(exists=True), help=(
                 'Path to target file or directory to scan.')),
         configs.OxMonOption(
             'clamopts', default=':r', help=(
                 'Comma separated list of options for clamscan. '
                 'We replace colons with dashes so e.g., :r becomes -r.'))
         ]
     return result
Ejemplo n.º 5
0
 def options(cls):
     logging.debug('Making options for %s', cls)
     result = configs.BASIC_OPTIONS + [
         configs.OxMonOption(
             '--cmd', help=('Command to run to generate version')),
         configs.OxMonOption(
             '--flags', default='::version', help=(
                 'Comma separated list of options to pass to --cmd. '
                 'We replace colons with dashes so e.g., :v becomes -v.')),
         configs.OxMonOption(
             '--vre', default='[0-9]+[.][0-9]+[.]?[0-9]*', help=(
                 'Regular expression to find version in --cmd output.'
                 )),
         configs.OxMonOption('--exact', default=None, help=(
             'If provided, version must exactly match this.')),
         configs.OxMonOption('--cmpmode', default='int', help=(
             'If "str" compare as strings. If int compare as integers. '
             'In either case, first we split on the "." character.')),
         configs.OxMonOption('--minv', default=None, help=(
             'If given then this is minimum allowed version with '
             'comparison done based on --cmpmode.')),
         configs.OxMonOption('--maxv', default=None, help=(
             'If given then this is maximum allowed version with '
             'comparison done based on --cmpmode.')),
         ]
     return result
Ejemplo n.º 6
0
 def options(cls):
     logging.debug('Making options for %s', cls)
     result = configs.BASIC_OPTIONS + [
         configs.OxMonOption(
             'age-in-days',
             default=7.0,
             type=float,
             help=(
                 'Max age in days allowed since last update of apt sources'
             )),
         configs.OxMonOption(
             'limit',
             default=0,
             type=int,
             help=(
                 'Max allowed un-installed packages to allow. Default is 0 '
                 'so that any un-installed packages cause an alarm.'))
     ]
     return result
Ejemplo n.º 7
0
 def options(cls):
     logging.debug('Making options for %s', cls)
     result = configs.BASIC_OPTIONS + [
         configs.OxMonOption(
             'tool',
             default='shutil',
             help=('Tool to use to determine disk usage. Default is '
                   'shutil which is sometimes flaky. If you install '
                   'psutil you can provide psutil for better results.')),
         configs.OxMonOption(
             'target',
             default='/',
             help=('Target location to check for usage (e.g., /).')),
         configs.OxMonOption(
             'max-used-pct',
             default=85.0,
             type=float,
             help=('Maximum percentage allowed for disk usage.'))
     ]
     return result
Ejemplo n.º 8
0
    def options(cls):
        "Override to provide options for OxMonBackup"

        result = configs.BASIC_OPTIONS + [
            configs.OxMonOption(
                'tool', default='rsync', help=(
                    'Tool to use to do the backup. Default is '
                    'rsync.')),
            configs.OxMonOption(
                'source', type=click.Path(exists=True), help=(
                    'Path to location to backup.')),
            configs.OxMonOption(
                'dest', type=click.Path(exists=False), help=(
                    'Path to location store backup.')),
            configs.OxMonOption(
                'opts', default=':av,::delete', help=(
                    'Comma separated list of options for tool. We replace '
                    'colons with dashes so e.g., :av becomes -av.')),
            ]
        return result