Пример #1
0
 def _do_autofix(self, event, autofix_script, log_id):
     trigger_name = event["trigger_name"]
     hostname = event["hostname"]
     executor = self.executor(hostname=hostname, user=options.executor_user)
     autofix_method = get_autofix_scripts().get(autofix_script).get(
         "fix_method")
     # do autofix, if it fix failed, it should raise an exception and
     # upper level codes will catch it then record it into database.
     autofix_method(trigger_name, hostname, executor, event)
Пример #2
0
 def _do_autofix(self, event, autofix_script, log_id):
     trigger_name = event["trigger_name"]
     hostname = event["hostname"]
     executor = self.executor(hostname=hostname, user=options.executor_user)
     autofix_method = get_autofix_scripts().get(autofix_script).get(
         "fix_method"
     )
     # do autofix, if it fix failed, it should raise an exception and
     # upper level codes will catch it then record it into database.
     autofix_method(trigger_name, hostname, executor, event)
Пример #3
0
    def get(self):
        def convert_list_to_dict(ls):
            d = dict()
            for l in ls:
                name = l["trigger_name"]
                d[name] = l
            return d

        scripts = get_autofix_scripts().keys()
        triggers = self.zabbix.get_triggers_info(db=self.db).keys()
        bindings = convert_list_to_dict(self.db.get_autofix_bindings())
        self.render("autofixbinding.html",
                    scripts=scripts,
                    triggers=triggers,
                    bindings=bindings)
Пример #4
0
    def get(self):
        def convert_list_to_dict(ls):
            d = dict()
            for l in ls:
                name = l["trigger_name"]
                d[name] = l
            return d

        scripts = get_autofix_scripts().keys()
        triggers = self.zabbix.get_triggers_info(db=self.db).keys()
        bindings = convert_list_to_dict(
            self.db.get_autofix_bindings()
        )
        self.render("autofixbinding.html", scripts=scripts,
                    triggers=triggers, bindings=bindings)
Пример #5
0
 def get(self):
     scripts = get_autofix_scripts()
     self.render("autofixscriptslist.html", scripts=scripts)
Пример #6
0
 def get(self):
     scripts = get_autofix_scripts()
     self.render("autofixscriptslist.html", scripts=scripts)