Exemple #1
0
 def test_loggables_not_equal(self):
     cmd1 = sysinfo_collectible.Command("ls -l")
     cmd2 = sysinfo_collectible.Command("ls -la")
     self.assertNotEqual(cmd1, cmd2)
     file1 = sysinfo_collectible.Logfile("/proc/cpuinfo")
     file2 = sysinfo_collectible.Logfile("/etc/fstab")
     self.assertNotEqual(file1, file2)
Exemple #2
0
    def _set_collectibles(self):
        timeout = self.config.get("sysinfo.collect.commands_timeout")
        locale = self.config.get("sysinfo.collect.locale")
        if self.profiler:
            for cmd in self.sysinfo_files["profilers"]:
                self.start_collectibles.add(sysinfo.Daemon(cmd, locale=locale))

        for cmd in self.sysinfo_files["commands"]:
            self.start_collectibles.add(
                sysinfo.Command(cmd, timeout=timeout, locale=locale))
            self.end_collectibles.add(
                sysinfo.Command(cmd, timeout=timeout, locale=locale))

        for fail_cmd in self.sysinfo_files["fail_commands"]:
            self.end_fail_collectibles.add(
                sysinfo.Command(fail_cmd, timeout=timeout, locale=locale))

        for filename in self.sysinfo_files["files"]:
            self.start_collectibles.add(sysinfo.Logfile(filename))
            self.end_collectibles.add(sysinfo.Logfile(filename))

        for fail_filename in self.sysinfo_files["fail_files"]:
            self.end_fail_collectibles.add(sysinfo.Logfile(fail_filename))
        try:
            self.end_collectibles.add(sysinfo.JournalctlWatcher())
        except sysinfo.CollectibleException as e:
            log.debug(e.args[0])
Exemple #3
0
    def _set_collectibles(self):
        for cmd in self.sysinfo_config.get("commands", []):
            self.collectibles.add(
                sysinfo_collectible.Command(cmd,
                                            timeout=self.timeout,
                                            locale=self.locale))

        for filename in self.sysinfo_config.get("files", []):
            self.collectibles.add(sysinfo_collectible.Logfile(filename))
Exemple #4
0
    def _set_collectibles(self):
        super()._set_collectibles()
        if self.test_fail:
            for fail_cmd in self.sysinfo_config.get("fail_commands", []):
                self.collectibles.add(
                    sysinfo_collectible.Command(fail_cmd,
                                                timeout=self.timeout,
                                                locale=self.locale))

            for fail_filename in self.sysinfo_config.get("fail_files", []):
                self.collectibles.add(
                    sysinfo_collectible.Logfile(fail_filename))