def _map_scan_cfg(self): if self.args.cfg: self.cfg_path = self.args.cfg for map_n in self.args.scan: cfg = ConfigLoader(self.cfg_path + '/' + map_n + '.yaml') map_data = cfg.zbx.scan_map(map_n) scan_map = ConfigCreate(map_data, cfg.zbx) scan_map.create() scan_map.check_map(self.cfg_path) scan_map.save(self.cfg_path) del cfg, scan_map, map_data
def _map_scan(self): if self.args.cfg: self.cfg_path = self.args.cfg for map_n in self.args.scan: zbx = ZabbixAgent(self.args.zabbix, self.args.login, self.args.pwd) map_data = zbx.scan_map(map_n) scan_map = ConfigCreate(map_data, zbx) scan_map.create() scan_map.check_map(self.cfg_path) scan_map.save(self.cfg_path) del zbx, scan_map, map_data