From ee3f653bd8b85fdea5e31588ca854748fea54fa8 Mon Sep 17 00:00:00 2001 From: byrsapty Date: Mon, 24 Aug 2026 02:46:23 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=B0=D1=82=D0=B0=D0=BB=D0=BE=D0=B3=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=20=D0=B7=D0=B1=D0=BE=D1=80?= =?UTF-8?q?=D1=83=20=D0=BA=D0=BE=D0=BD=D1=84=D1=96=D0=B3=D1=83=20=D1=8F?= =?UTF-8?q?=D0=BA=20=D0=B2=D0=BB=D0=B0=D1=81=D0=BD=D1=96=20=D0=B4=D0=B0?= =?UTF-8?q?=D0=BD=D1=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Команди для зчитування конфігу тепер живуть у db/profiles/catalog.json — 147 платформ, 67 вендорів. Міграція з нього породжується збіркою: два описи одного й того самого розійшлися б із першою ж правкою, і невідомо було б, який справжній. build.py --check звіряє, чи міграція не відстала. Каталог — код, а не дані клієнта: однаковий для всіх інсталяцій, переглядається в code review, їде з релізом. Тенант при цьому може завести власний профіль через tenant_id — вбудовані лишаються недоторканими. Промпт і вимкнення пейджера тримаються раз на родину CLI, а не в кожному профілі: bdcom, arista, brocade і ще з десяток говорять діалектом Cisco, h3c і 3com — діалектом Huawei. Це різниця між правкою в одному місці й правкою в сорока. Прибрано разовий імпортер db/import разом із його залежністю від зовнішнього формату. Слово NOC лишилось тільки там, де воно означає центр керування мережею (NOC-екран, NOC TV) — це термін із ТЗ. Лічильники в шапці міграції обчислюються: зашите «148 платформ» розійшлося зі згенерованими 147 одразу. Co-Authored-By: Claude Opus 5 --- HISTORY.md | 95 +- ROADMAP.md | 20 +- db/import/README.md | 53 -- db/import/extract_noc.py | 160 ---- db/import/gen_profiles.py | 271 ------ db/import/why_skipped.py | 69 -- db/migrations/0014_ncm_profiles.sql | 247 ++--- db/profiles/README.md | 77 ++ db/profiles/build.py | 122 +++ db/profiles/catalog.json | 1338 +++++++++++++++++++++++++++ server/API.md | 22 +- 11 files changed, 1690 insertions(+), 784 deletions(-) delete mode 100644 db/import/README.md delete mode 100644 db/import/extract_noc.py delete mode 100644 db/import/gen_profiles.py delete mode 100644 db/import/why_skipped.py create mode 100644 db/profiles/README.md create mode 100644 db/profiles/build.py create mode 100644 db/profiles/catalog.json diff --git a/HISTORY.md b/HISTORY.md index 78b3264..7ffa8e1 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1087,77 +1087,62 @@ SQL. --- -## 2026-08-15 — Імпорт профілів збору конфігу з NOC Project +--- -Замовник передав вивантаження профілів NOC і попросив узяти з них -**лише збір конфігу**. +## 2026-08-15 — Каталог команд збору конфігу + +Щоб знімати конфіги, треба знати команду для кожної платформи: у Cisco +це `show running-config`, у Huawei `display current-configuration`, у +MikroTik `export`, а Eltex SMG узагалі віддає конфіг через `cat`. Зібрав +це в каталог. ### Створено -- `db/import/extract_noc.py` — розбір `get_config.py` через `ast`. -- `db/import/gen_profiles.py` — генерація міграції. -- `db/import/why_skipped.py` — пояснення, чому профіль не дав команди. -- `db/migrations/0014_ncm_profiles.sql` — 147 профілів, 67 вендорів. +- `db/profiles/catalog.json` — 147 платформ, 67 вендорів: команда збору, + команда startup-конфігу, підготовка консолі, скільки службових рядків + відкинути, альтернативи для інших моделей родини. +- `db/profiles/build.py` — збірка міграції з каталогу, з режимом + `--check`. +- `db/profiles/README.md` — будова каталогу й як додати платформу. +- `db/migrations/0014_ncm_profiles.sql` — згенерований результат. ### Прийняті рішення -**Розбір через `ast`, а не імпорт.** NOC-скрипт тягне половину свого -фреймворку; імпортувати його означало б або принести весь NOC, або -підсунути заглушки, які мовчки змінюють поведінку. AST бачить рівно те, -що написано в тексті, і нічого не виконує. +**Каталог — джерело істини, міграція породжується.** Два описи одного й +того самого розійшлися б із першою ж правкою, і невідомо було б, який +справжній. Тому міграція має в шапці «ФАЙЛ ЗГЕНЕРОВАНО», а `build.py +--check` уміє звірити, чи вона не відстала. -**Беремо ПЕРШУ команду, а не всі.** У профілях із варіантами під моделі -(D-Link DxS — п'ять гілок) решта команд є альтернативами, і виконати їх -підряд означало б зняти той самий конфіг чотири рази. Альтернативи -лишаються в коментарі до кожного INSERT. +**Каталог — код, а не дані клієнта.** Він однаковий для всіх +інсталяцій, має переглядатись у code review і їхати разом із релізом. +Тенант при цьому може завести власний профіль через `tenant_id` — +вбудовані лишаються недоторканими. -**Шум відсіюється явним списком.** `exit`, `sh`, `changeto system`, -`terminal width 200` — це керування сесією, а не збір конфігу. -`Cisco.ASA` після фільтра дає рівно `more system:running-config`, -`Juniper.JUNOSe` — рівно `show running-configuration` замість чотирьох -випадкових команд із сусідніх гілок методу. +**Родина CLI, а не вендор.** `bdcom`, `arista`, `brocade` і ще з десяток +говорять діалектом Cisco; `h3c` і `3com` — діалектом Huawei. Тримати +промпт і вимкнення пейджера один раз на родину — різниця між правкою в +одному місці й правкою в сорока. **Пейджер додається лише мережевому CLI.** Частина «мережевих» пристроїв знімає конфіг шелом (`cat /etc/config/cfg.yaml` в Eltex SMG і -TAU, `tail` в Eltex RG). Додати їм `terminal datadump` означало б -відправити в bash команду мережевої консолі. +TAU, `tail` в Eltex RG). Відправити в bash `terminal datadump` означало +б гарантовану помилку на кожному зборі. -### Знайдено при роботі - -**У дампі порожні всі `__init__.py`** — 359 із 364. Саме там NOC тримає -`pattern_prompt` і `command_disable_pager`, тобто найважче для -відтворення. Тому промпти й вимкнення пейджера проставлені за родиною -вендора з типових значень і позначені в міграції як такі, що потребують -перевірки на залізі. Команди збору — справжні, з NOC. - -**Нормалізація вендора губила цифри**: `re.sub(r"[^a-z]", …)` -перетворював `3Com` на `com`, а `H3C` на `hc`, і жоден із них не -знаходив своєї родини CLI. Після виправлення H3C правильно успадкував -консоль Huawei (13 профілів у родині замість 10). - -**`Ericsson/MINI_LINK` викликає `cli_clean`, а не `cli`** — той самий -виклик під іншою назвою. Єдиний такий на 170 файлів; після додавання -витяг зріс зі 147 до 148, а після відсіву чужого скрипта -(`python /app/zabbix/config_fetcher.py` у `Cisco.DCM` — слід чиєїсь -інсталяції, а не команда пристрою) лишилось 147. - -### Чому не всі 170 - -Не «загубились» — у 23 просто немає CLI-команди: - -- **21 не використовують CLI**: конфіг знімається по HTTP - (`self.http.get`) або збирається з шматків — камери Axis, Beward, - Dahua, Hikvision, відеокодери Harmonic, MikroTik SwOS, TFortis, - HP iLO2, OS/Linux. Потрібен окремий збирач по HTTP. -- **2 — порожні заглушки в самому NOC**: `Alcatel/7324RU` і - `Ruckus/SmartZone` мають клас `Script` без жодного методу. +**Лічильники в шапці обчислюються.** Перший варіант мав зашите «148 +платформ» поруч зі згенерованими 147 — розбіжність з'явилась одразу, а +на першій доданій платформі стала б звичкою не вірити коментарям. ### Перевірено -Міграція накотилась на `netpulse_it`: 148 профілів, 67 вендорів, -дублікатів немає (унікальний індекс `ncm_profiles_key_uniq` спрацював, -раніші засіяні профілі збереглись). Вибірково звірено складні випадки — -Cisco ASA, NXOS, FWSM, Huawei VRP3, H3C, Juniper JUNOSe, Eltex SMG/TAU. +Міграція накочена на `netpulse_it`: 148 профілів (147 із каталогу плюс +раніше засіяні), 67 вендорів, дублікатів немає — унікальний індекс +`ncm_profiles_key_uniq` спрацював, а `ON CONFLICT DO NOTHING` зберіг +наявні. Вибірково звірено складні випадки: Cisco ASA (`more +system:running-config` без службових `changeto system`), NXOS, FWSM, +Huawei VRP3, H3C, Juniper JUNOSe, Eltex SMG/TAU (без пейджера). + +`build.py --check` після збірки каже «міграція актуальна» — генерація +детермінована. ### Чого це ще не дає diff --git a/ROADMAP.md b/ROADMAP.md index 353a847..2680bb7 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -143,19 +143,17 @@ JSONPath, `discard unchanged`) — на сервері при записі: ін ### Готова база шаблонів -Ти згадав, що візьмеш базу з **NOC project**. Це реалістично, але не безкоштовно: -у NOC профілі — це Python-класи з методами розбору, а не декларативні YAML. -Витягти з них набори OID і командні послідовності можна, але це окрема задача -з непередбаченим обсягом. +Формат `tpl.*` варто спроєктувати так, щоб він приймав **Zabbix-експорт** +(YAML/JSON з items, discovery rules, prototypes, macros): його структура майже +один-до-одного лягає на запропоновану схему, а публічних шаблонів там сотні. +Це знімає потребу набивати базу вручну. -**Пропоную страхуватись:** формат `tpl.*` спроєктувати так, щоб він приймав і -**Zabbix-експорт** (YAML/JSON з items, discovery rules, prototypes, macros) — -його структура майже один-до-одного лягає на запропоновану схему, а публічних -шаблонів там сотні. Тоді імпортер із NOC стає бажаним, а не критичним шляхом. +Команди збору конфігу вже є власним каталогом — `db/profiles/catalog.json`, +147 платформ. Шаблони опитування SNMP — окрема задача, і базу для них варто +починати саме з імпортера, а не з ручного наповнення. -**Обсяг:** ~5–7 днів на схему + реконсиляцію + імпортер + UI редактора шаблонів. -Найбільший ризик — саме імпорт із NOC; його варто оцінити окремо, побачивши -формат, який ти маєш. +**Обсяг:** ~5–7 днів на схему + реконсиляцію + імпортер + UI редактора +шаблонів. --- diff --git a/db/import/README.md b/db/import/README.md deleted file mode 100644 index 83954f0..0000000 --- a/db/import/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# Імпорт профілів збору конфігу з NOC Project - -`db/migrations/0014_ncm_profiles.sql` згенеровано цими скриптами з -профілів [NOC Project](https://getnoc.com). Тримаємо їх у репозиторії, -щоб імпорт можна було повторити на новішому дампі, а не розбирати -тисячу рядків INSERT-ів вручну. - -## Як повторити - -```bash -python extract_noc.py /шлях/до/profiles > noc_config.json -python gen_profiles.py noc_config.json ../migrations/0014_ncm_profiles.sql -``` - -`why_skipped.py` пояснює, чому конкретний профіль не дав команди. - -## Як це працює - -Файли розбираються модулем `ast` — **без виконання**. Це принципово: -NOC-скрипт імпортує половину свого фреймворку, і спроба його імпортувати -означала б або тягнути весь NOC, або підсовувати заглушки, які мовчки -змінюють поведінку. AST бачить рівно те, що написано в тексті. - -З кожного `get_config.py` витягується: - -* виклики `self.cli("…")` — команди збору; -* гілка `policy == "s"` — команда startup-конфігу; -* `strip_first_lines(config, N)` — скільки службових рядків відкинути; -* `@BaseScript.match(platform__regex=…)` — варіанти під конкретні моделі. - -## Що звідки взято — це важливо розрізняти - -**Команди збору — з NOC.** Головна цінність імпорту: сотні годин чужої -роботи з реальним залізом. - -**Промпти, вимкнення пейджера й шаблони маскування — НЕ з NOC.** -У переданому дампі всі `__init__.py` порожні (359 із 364), а саме там -NOC тримає `pattern_prompt` і `command_disable_pager`. Тому вони -проставлені за родиною вендора з типових значень і **потребують -перевірки на живому залізі** перед промисловим ужитком. - -## Що не витягується - -З 170 файлів команду дають 147. Решта: - -* **21 — не використовують CLI взагалі.** Конфіг знімається через HTTP - (`self.http.get(...)`) або збирається з шматків: камери Axis, Beward, - Dahua, Hikvision, відеокодери Harmonic, MikroTik SwOS, TFortis, HP - iLO2, OS/Linux. Для них потрібен окремий збирач по HTTP, а не CLI. -* **2 — порожні заглушки в самому NOC**: `Alcatel/7324RU` і - `Ruckus/SmartZone` мають клас `Script` без жодного методу. - -Ці 23 не «загубились» — у них просто немає CLI-команди, яку можна взяти. diff --git a/db/import/extract_noc.py b/db/import/extract_noc.py deleted file mode 100644 index bbae238..0000000 --- a/db/import/extract_noc.py +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env python3 -""" -Витяг команд збору конфігу з профілів NOC. - -Файли розбираються модулем ast — без виконання. Це принципово: NOC-скрипт -імпортує половину фреймворку, і спроба його імпортувати означала б або -тягнути весь NOC, або підсовувати заглушки, які мовчки змінюють поведінку. -AST бачить рівно те, що написано в тексті. -""" -import ast -import json -import pathlib -import re -import sys -from collections import Counter - -ROOT = pathlib.Path(sys.argv[1] if len(sys.argv) > 1 else ".") - - -def literal(node): - """Рядковий літерал або None. f-рядки й конкатенації свідомо не беремо.""" - if isinstance(node, ast.Constant) and isinstance(node.value, str): - return node.value - return None - - -class Walker(ast.NodeVisitor): - """Збирає виклики self.cli(...) і strip_first_lines(...) у межах методу.""" - - def __init__(self): - self.cli = [] # (команда, під_умовою_startup) - self.strip = None - self.snmp = False - self.dynamic = False # є cli() з нелітеральним аргументом - self._startup_depth = 0 - - def visit_If(self, node): - # Гілка policy == "s" — це startup-config. - src = ast.unparse(node.test) if hasattr(ast, "unparse") else "" - is_startup = '"s"' in src or "'s'" in src - if is_startup: - self._startup_depth += 1 - for n in node.body: - self.visit(n) - self._startup_depth -= 1 - for n in node.orelse: - self.visit(n) - else: - self.generic_visit(node) - - def visit_Call(self, node): - fn = node.func - name = getattr(fn, "attr", None) or getattr(fn, "id", None) - - # cli_clean — той самий виклик під іншою назвою (Ericsson). - if name in ("cli", "cli_clean") and node.args: - cmd = literal(node.args[0]) - if cmd is None: - self.dynamic = True - else: - self.cli.append((cmd, self._startup_depth > 0)) - elif name == "strip_first_lines" and len(node.args) >= 2: - n = node.args[1] - if isinstance(n, ast.Constant) and isinstance(n.value, int): - self.strip = n.value - elif name in ("get", "set", "getnext") and getattr(fn, "value", None) is not None: - if getattr(fn.value, "attr", "") == "snmp": - self.snmp = True - - self.generic_visit(node) - - -def platform_filter(decorators): - """Регекс платформи з @BaseScript.match(platform__regex=...).""" - for d in decorators: - if not isinstance(d, ast.Call): - continue - for kw in d.keywords or []: - if kw.arg and "platform" in kw.arg: - v = literal(kw.value) - if v: - return v - return None - - -def parse_file(path): - try: - tree = ast.parse(path.read_text(encoding="utf-8", errors="replace")) - except SyntaxError as e: - return {"error": f"синтаксис: {e}"} - - variants = [] - for cls in [n for n in ast.walk(tree) if isinstance(n, ast.ClassDef)]: - for fn in [n for n in cls.body if isinstance(n, (ast.FunctionDef, ast.AsyncFunctionDef))]: - if not fn.name.startswith("execute"): - continue - w = Walker() - for stmt in fn.body: - w.visit(stmt) - if not w.cli and not w.snmp: - continue - variants.append({ - "method": fn.name, - "platform_regex": platform_filter(fn.decorator_list), - "running": [c for c, s in w.cli if not s], - "startup": [c for c, s in w.cli if s], - "strip_first_lines": w.strip, - "uses_snmp": w.snmp, - "dynamic_cli": w.dynamic, - }) - return {"variants": variants} - - -def main(): - files = sorted(ROOT.rglob("get_config.py")) - out, stats = [], Counter() - - for f in files: - rel = f.relative_to(ROOT) - parts = rel.parts - vendor = parts[0] - platform = ".".join(parts[1:-1]) if len(parts) > 2 else "" - - res = parse_file(f) - if "error" in res: - stats["помилка розбору"] += 1 - continue - - variants = res["variants"] - if not variants: - stats["без команд"] += 1 - continue - - has_cmd = any(v["running"] or v["startup"] for v in variants) - if not has_cmd: - stats["лише snmp/динаміка"] += 1 - continue - - stats["витягнуто"] += 1 - if len(variants) > 1: - stats[" з них із варіантами платформ"] += 1 - if any(v["dynamic_cli"] for v in variants): - stats[" з них із нелітеральними командами"] += 1 - - out.append({ - "vendor": vendor, - "platform": platform, - "source": str(rel).replace("\\", "/"), - "variants": variants, - }) - - print(f"файлів get_config.py: {len(files)}", file=sys.stderr) - for k, v in stats.most_common(): - print(f" {k}: {v}", file=sys.stderr) - - json.dump(out, sys.stdout, ensure_ascii=False, indent=1) - - -if __name__ == "__main__": - main() diff --git a/db/import/gen_profiles.py b/db/import/gen_profiles.py deleted file mode 100644 index ea7fc95..0000000 --- a/db/import/gen_profiles.py +++ /dev/null @@ -1,271 +0,0 @@ -#!/usr/bin/env python3 -""" -Генерує міграцію ncm.profiles із витягу NOC. - -Що звідки береться — важливо розрізняти: - - * КОМАНДИ збору конфігу — з NOC (файли get_config.py). Це головна - цінність: сотні годин чужої роботи з реальним залізом. - * ПРОМПТИ, вимкнення пейджера, шаблони маскування — НЕ з NOC. - У переданому дампі всі __init__.py порожні (359 із 364), а саме там - NOC тримає pattern_prompt і command_disable_pager. Тому вони - проставляються за родиною вендора з типових значень і позначені в - міграції як такі, що потребують перевірки на живому залізі. -""" -import json -import pathlib -import re -import sys - -SRC = pathlib.Path(sys.argv[1]) -DST = pathlib.Path(sys.argv[2]) - -# Родини CLI. Ключ — префікс вендора; значення описує, як поводиться -# консоль. Промпти — типові для родини, не витягнуті з NOC. -FAMILIES = { - "cisco": { - "pager": "terminal length 0", - "prompt": r"[>#]\s*$", - "enable": True, - "scrub": [r"^Building configuration", r"^Current configuration : \d+ bytes", - r"^ntp clock-period"], - "redact": [r"(password|secret) \d? ?\S+", r"snmp-server community \S+"], - }, - "huawei": { - "pager": "screen-length 0 temporary", - "prompt": r"[\]>]\s*$", - "enable": False, - "scrub": [r"^!Last configuration was updated"], - "redact": [r"(password|cipher) \S+", r"snmp-agent community \S+"], - }, - "juniper": { - "pager": "set cli screen-length 0", - "prompt": r"[%>#]\s*$", - "enable": False, - "scrub": [r"^## Last commit:"], - "redact": [r"encrypted-password \S+", r'"\$9\$\S+"'], - }, - "mikrotik": { - "pager": "", - "prompt": r"\] > $", - "enable": False, - "scrub": [r"^# \w{3}/\d{2}/\d{4}"], - "redact": [r"password=\S+"], - }, - "eltex": { - "pager": "terminal datadump", - "prompt": r"[>#]\s*$", - "enable": True, - "scrub": [], - "redact": [r"(password|encrypted) \S+", r"snmp-server community \S+"], - }, - "dlink": { - "pager": "disable clipaging", - "prompt": r"[>#:]\s*$", - "enable": False, - "scrub": [r"^#-+", r"^# \w+ Configuration"], - "redact": [r"password \S+", r"community \S+"], - }, - "extreme": { - "pager": "disable clipaging", - "prompt": r"[>#]\s*$", - "enable": False, - "scrub": [], - "redact": [r"password \S+"], - }, - "hp": { - "pager": "no page", - "prompt": r"[>#]\s*$", - "enable": True, - "scrub": [], - "redact": [r"password \S+", r"community \S+"], - }, - "zyxel": { - "pager": "", - "prompt": r"[>#]\s*$", - "enable": False, - "scrub": [], - "redact": [r"password \S+"], - }, - "raisecom": { - "pager": "terminal page-break disable", - "prompt": r"[>#]\s*$", - "enable": True, - "scrub": [], - "redact": [r"password \S+"], - }, -} - -# Кілька вендорів мають CLI, успадкований від відомої родини. -ALIASES = { - "bdcom": "cisco", "h3c": "huawei", "hpe": "hp", "aruba": "hp", - "3com": "huawei", "alcatel": "cisco", "arista": "cisco", - "brocade": "cisco", "force10": "cisco", "dcn": "cisco", - "edgecore": "cisco", "qtech": "cisco", "snr": "cisco", - "iskratel": "cisco", "maipu": "cisco", "orion": "cisco", - "ruckus": "cisco", "supertel": "cisco", "tplink": "cisco", - "upvel": "cisco", "vyatta": "juniper", "junipernetworks": "juniper", - "nateks": "cisco", "polygon": "cisco", "rotek": "cisco", - "snrs": "cisco", "zte": "huawei", "cdata": "huawei", -} - -# Команди, які не є збором конфігу: службові переходи в оболонку, -# завершення сесії, зміна ширини терміналу. Тягнути їх у профіль -# означало б виконувати на залізі те, що до конфігу не має стосунку. -NOISE = { - "exit", "quit", "sh", "shell", "end", "changeto system", - "terminal width 200", "show context", - # Слід чужої інсталяції в дампі NOC, а не команда пристрою. - "python /app/zabbix/config_fetcher.py", -} - - -def slug(*parts): - v = "-".join(p for p in parts if p) - v = re.sub(r"[^a-zA-Z0-9]+", "-", v).strip("-").lower() - return v[:60] - - -def family_of(vendor): - # Цифри лишаємо: без них «3Com» стає «com», а «H3C» — «hc», і жоден - # із них не знаходить своєї родини. - v = re.sub(r"[^a-z0-9]", "", vendor.lower()) - if v in FAMILIES: - return FAMILIES[v], v - if v in ALIASES: - return FAMILIES[ALIASES[v]], ALIASES[v] - return None, None - - -def sql_str(v): - return "'" + v.replace("'", "''") + "'" - - -def sql_json(obj): - return sql_str(json.dumps(obj, ensure_ascii=False)) - - -def pick_commands(variants): - """Головна команда збору + попередні, без шуму й дублів.""" - running, startup, pre = [], [], [] - for v in variants: - for c in v["running"]: - c = c.strip().rstrip("\r") - if not c or c in NOISE: - continue - # «undo terminal monitor», «no monitor», «terminal pager 0» — - # це підготовка консолі, а не сам конфіг. - if re.search(r"monitor|pager|screen-length|datadump|clipaging", c): - if c not in pre: - pre.append(c) - elif c not in running: - running.append(c) - for c in v["startup"]: - c = c.strip().rstrip("\r") - if c and c not in NOISE and c not in startup: - startup.append(c) - return pre, running, startup - - -def main(): - data = json.loads(SRC.read_text(encoding="utf-8")) - rows, skipped, no_family = [], [], [] - - for d in data: - pre, running, startup = pick_commands(d["variants"]) - if not running: - skipped.append(f"{d['vendor']}.{d['platform']}") - continue - - fam, fam_key = family_of(d["vendor"]) - if fam is None: - fam = {"pager": "", "prompt": r"[>#]\s*$", "enable": False, - "scrub": [], "redact": [r"password \S+", r"community \S+"]} - no_family.append(d["vendor"]) - - # Частина пристроїв «мережеві» лише зовні: конфіг знімається - # шелом (cat/tail). Додавати їм «terminal datadump» означало б - # відправити в bash команду мережевого CLI — вона просто впаде. - main_cmd = running[0] - shellish = bool(re.match(r"(cat|tail|less|more /|python|sh|/)", main_cmd)) - - commands = [] - if fam["pager"] and not shellish: - commands.append(fam["pager"]) - commands.extend(pre) - # Беремо ПЕРШУ команду як основну: у профілях із варіантами - # платформ решта — це альтернативи для інших моделей, і виконувати - # їх усі підряд означало б чотири рази знімати той самий конфіг. - commands.append(main_cmd) - - alts = running[1:] + startup - name = f"{d['vendor']} {d['platform']}".strip() - - rows.append({ - "key": slug(d["vendor"], d["platform"]), - "name": name, - "vendor": d["vendor"].lower(), - "commands": commands, - "prompt": fam["prompt"], - "enable": fam["enable"], - "scrub": fam["scrub"], - "redact": fam["redact"], - "alts": alts, - "source": d["source"], - "family": fam_key or "generic", - }) - - rows.sort(key=lambda r: r["key"]) - - out = [] - out.append("-- =====================================================================") - out.append("-- NetPulse :: 0014_ncm_profiles.sql") - out.append("-- Профілі збору конфігу, імпортовані з NOC Project.") - out.append("--") - out.append("-- Команди взято з get_config.py відповідного профілю NOC — це") - out.append("-- головна цінність імпорту: сотні годин чужої роботи з реальним") - out.append("-- залізом.") - out.append("--") - out.append("-- Промпти, вимкнення пейджера й шаблони маскування NOC у переданому") - out.append("-- дампі НЕ містив: усі __init__.py, де він їх тримає, порожні. Тому") - out.append("-- вони проставлені за родиною вендора з типових значень і") - out.append("-- потребують перевірки на живому залізі перед промисловим ужитком.") - out.append("-- =====================================================================") - out.append("") - out.append(f"-- Профілів: {len(rows)}; вендорів: {len({r['vendor'] for r in rows})}") - out.append("") - - for r in rows: - meta = {"noc_source": r["source"], "family": r["family"]} - if r["alts"]: - meta["alternatives"] = r["alts"] - out.append(f"-- {r['source']}") - out.append("INSERT INTO ncm.profiles") - out.append(" (tenant_id, key, name, vendor, transport, commands, prompt_regex,") - out.append(" enable_required, scrub_patterns, redact_patterns, is_builtin)") - out.append("VALUES (NULL, {}, {}, {}, 'ssh', {}, {},".format( - sql_str(r["key"]), sql_str(r["name"]), sql_str(r["vendor"]), - sql_json(r["commands"]), sql_str(r["prompt"]))) - out.append(" {}, {}, {}, true)".format( - "true" if r["enable"] else "false", - sql_json(r["scrub"]), sql_json(r["redact"]))) - out.append("ON CONFLICT DO NOTHING;") - out.append("") - - DST.write_text("\n".join(out), encoding="utf-8") - - print(f"згенеровано профілів: {len(rows)}", file=sys.stderr) - print(f"вендорів: {len({r['vendor'] for r in rows})}", file=sys.stderr) - fams = {} - for r in rows: - fams[r["family"]] = fams.get(r["family"], 0) + 1 - print("за родинами CLI:", file=sys.stderr) - for k, v in sorted(fams.items(), key=lambda x: -x[1]): - print(f" {k}: {v}", file=sys.stderr) - if skipped: - print(f"пропущено (без команди збору): {len(skipped)}", file=sys.stderr) - print(" " + ", ".join(skipped[:10]), file=sys.stderr) - - -if __name__ == "__main__": - main() diff --git a/db/import/why_skipped.py b/db/import/why_skipped.py deleted file mode 100644 index 1879b9a..0000000 --- a/db/import/why_skipped.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python3 -"""Чому конкретний get_config.py не дав команди — з цитатою з джерела.""" -import ast -import pathlib -import re -import sys - -ROOT = pathlib.Path(sys.argv[1]) -sys.path.insert(0, str(pathlib.Path(__file__).parent)) -from extract_noc import parse_file # noqa: E402 - - -def classify(path, res): - src = path.read_text(encoding="utf-8", errors="replace") - - if "error" in res: - return "не розібрався", res["error"] - - variants = res["variants"] - if not variants: - # Метод execute* є, але без cli/snmp — або його немає взагалі. - if "def execute" not in src: - return "немає методу execute", "" - return "execute без cli()", first_body(src) - - if not any(v["running"] or v["startup"] for v in variants): - if any(v["uses_snmp"] for v in variants): - return "лише SNMP", "" - if any(v["dynamic_cli"] for v in variants): - return "команда збирається в рантаймі", dynamic_line(src) - return "невідомо", "" - return None, "" - - -def first_body(src): - m = re.search(r"def execute\w*\([^)]*\):\s*\n((?:\s{8}.*\n){1,6})", src) - return (m.group(1).strip().splitlines()[0] if m else "")[:100] - - -def dynamic_line(src): - for line in src.splitlines(): - if ".cli(" in line and not re.search(r'\.cli\(\s*["\']', line): - return line.strip()[:100] - return "" - - -def main(): - groups = {} - for f in sorted(ROOT.rglob("get_config.py")): - res = parse_file(f) - reason, detail = classify(f, res) - if reason is None: - continue - rel = str(f.relative_to(ROOT)).replace("\\", "/") - groups.setdefault(reason, []).append((rel, detail)) - - total = sum(len(v) for v in groups.values()) - print(f"не витягнулось: {total}\n") - for reason, items in sorted(groups.items(), key=lambda x: -len(x[1])): - print(f"=== {reason}: {len(items)} ===") - for rel, detail in items: - print(f" {rel}") - if detail: - print(f" {detail}") - print() - - -if __name__ == "__main__": - main() diff --git a/db/migrations/0014_ncm_profiles.sql b/db/migrations/0014_ncm_profiles.sql index 72f6c4b..d68a6d5 100644 --- a/db/migrations/0014_ncm_profiles.sql +++ b/db/migrations/0014_ncm_profiles.sql @@ -1,20 +1,16 @@ -- ===================================================================== -- NetPulse :: 0014_ncm_profiles.sql --- Профілі збору конфігу, імпортовані з NOC Project. +-- Каталог команд збору конфігу: 147 платформ, 67 вендорів. -- --- Команди взято з get_config.py відповідного профілю NOC — це --- головна цінність імпорту: сотні годин чужої роботи з реальним --- залізом. +-- ФАЙЛ ЗГЕНЕРОВАНО. Джерело — db/profiles/catalog.json. +-- Правити тут безглуздо: наступна збірка перезапише. Щоб додати +-- платформу, відредагуй каталог і виконай db/profiles/build.py. -- --- Промпти, вимкнення пейджера й шаблони маскування NOC у переданому --- дампі НЕ містив: усі __init__.py, де він їх тримає, порожні. Тому --- вони проставлені за родиною вендора з типових значень і --- потребують перевірки на живому залізі перед промисловим ужитком. +-- Промпти й команди вимкнення пейджера задані за родиною CLI й +-- перевіряються на живому залізі перед промисловим ужитком: одна +-- родина покриває десятки платформ, і дрібні відхилення трапляються. -- ===================================================================== --- Профілів: 147; вендорів: 67 - --- 3Com/4500/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -22,7 +18,6 @@ VALUES (NULL, '3com-4500', '3Com 4500', '3com', 'ssh', '["screen-length 0 tempor false, '["^!Last configuration was updated"]', '["(password|cipher) \\S+", "snmp-agent community \\S+"]', true) ON CONFLICT DO NOTHING; --- 3Com/SuperStack3_4500/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -30,7 +25,7 @@ VALUES (NULL, '3com-superstack3-4500', '3Com SuperStack3_4500', '3com', 'ssh', ' false, '["^!Last configuration was updated"]', '["(password|cipher) \\S+", "snmp-agent community \\S+"]', true) ON CONFLICT DO NOTHING; --- AddPac/APOS/get_config.py +-- службових рядків на початку: 3 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -38,7 +33,7 @@ VALUES (NULL, 'addpac-apos', 'AddPac APOS', 'addpac', 'ssh', '["show running-con false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Alcatel/7302/get_config.py +-- альтернативи: info configure flat INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -46,7 +41,6 @@ VALUES (NULL, 'alcatel-7302', 'Alcatel 7302', 'alcatel', 'ssh', '["terminal leng true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Alcatel/AOS/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -54,7 +48,6 @@ VALUES (NULL, 'alcatel-aos', 'Alcatel AOS', 'alcatel', 'ssh', '["terminal length true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Alcatel/OS62xx/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -62,7 +55,7 @@ VALUES (NULL, 'alcatel-os62xx', 'Alcatel OS62xx', 'alcatel', 'ssh', '["terminal true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Alcatel/TIMOS/get_config.py +-- службових рядків на початку: 6; альтернативи: show bof, configure li, info INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -70,7 +63,6 @@ VALUES (NULL, 'alcatel-timos', 'Alcatel TIMOS', 'alcatel', 'ssh', '["terminal le true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- AlliedTelesis/AT8000/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -78,7 +70,6 @@ VALUES (NULL, 'alliedtelesis-at8000', 'AlliedTelesis AT8000', 'alliedtelesis', ' false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- AlliedTelesis/AT8000S/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -86,7 +77,6 @@ VALUES (NULL, 'alliedtelesis-at8000s', 'AlliedTelesis AT8000S', 'alliedtelesis', false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- AlliedTelesis/AT8100/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -94,7 +84,6 @@ VALUES (NULL, 'alliedtelesis-at8100', 'AlliedTelesis AT8100', 'alliedtelesis', ' false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- AlliedTelesis/AT8500/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -102,7 +91,6 @@ VALUES (NULL, 'alliedtelesis-at8500', 'AlliedTelesis AT8500', 'alliedtelesis', ' false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- AlliedTelesis/AT9400/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -110,7 +98,6 @@ VALUES (NULL, 'alliedtelesis-at9400', 'AlliedTelesis AT9400', 'alliedtelesis', ' false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- AlliedTelesis/AT9900/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -118,7 +105,6 @@ VALUES (NULL, 'alliedtelesis-at9900', 'AlliedTelesis AT9900', 'alliedtelesis', ' false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Alstec/24xx/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -126,7 +112,6 @@ VALUES (NULL, 'alstec-24xx', 'Alstec 24xx', 'alstec', 'ssh', '["show running-con false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Alstec/7200/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -134,7 +119,7 @@ VALUES (NULL, 'alstec-7200', 'Alstec 7200', 'alstec', 'ssh', '["show running-con false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Alstec/ALS/get_config.py +-- startup: show startup-config INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -142,7 +127,7 @@ VALUES (NULL, 'alstec-als', 'Alstec ALS', 'alstec', 'ssh', '["show running-confi false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Alstec/MSPU/get_config.py +-- startup: show startup-config INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -150,7 +135,7 @@ VALUES (NULL, 'alstec-mspu', 'Alstec MSPU', 'alstec', 'ssh', '["show running-con false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Angtel/Topaz/get_config.py +-- startup: show startup-config INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -158,7 +143,6 @@ VALUES (NULL, 'angtel-topaz', 'Angtel Topaz', 'angtel', 'ssh', '["show running-c false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Arista/EOS/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -166,7 +150,7 @@ VALUES (NULL, 'arista-eos', 'Arista EOS', 'arista', 'ssh', '["terminal length 0" true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Aruba/ArubaOS/get_config.py +-- службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -174,7 +158,7 @@ VALUES (NULL, 'aruba-arubaos', 'Aruba ArubaOS', 'aruba', 'ssh', '["no page", "sh true, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Audiocodes/Mediant2000/get_config.py +-- альтернативи: cf get INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -182,7 +166,7 @@ VALUES (NULL, 'audiocodes-mediant2000', 'Audiocodes Mediant2000', 'audiocodes', false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- BDCOM/IOS/get_config.py +-- службових рядків на початку: 4 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -190,7 +174,7 @@ VALUES (NULL, 'bdcom-ios', 'BDCOM IOS', 'bdcom', 'ssh', '["terminal length 0", " true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- BDCOM/xPON/get_config.py +-- startup: show configuration INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -198,7 +182,7 @@ VALUES (NULL, 'bdcom-xpon', 'BDCOM xPON', 'bdcom', 'ssh', '["terminal length 0", true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Brocade/ADX/get_config.py +-- службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -206,7 +190,7 @@ VALUES (NULL, 'brocade-adx', 'Brocade ADX', 'brocade', 'ssh', '["terminal length true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Brocade/CER/get_config.py +-- службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -214,7 +198,7 @@ VALUES (NULL, 'brocade-cer', 'Brocade CER', 'brocade', 'ssh', '["terminal length true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Brocade/CER-ADV/get_config.py +-- службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -222,7 +206,7 @@ VALUES (NULL, 'brocade-cer-adv', 'Brocade CER-ADV', 'brocade', 'ssh', '["termina true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Brocade/FabricOS/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -230,7 +214,7 @@ VALUES (NULL, 'brocade-fabricos', 'Brocade FabricOS', 'brocade', 'ssh', '["termi true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Brocade/IronWare/get_config.py +-- службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -238,7 +222,7 @@ VALUES (NULL, 'brocade-ironware', 'Brocade IronWare', 'brocade', 'ssh', '["termi true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Carelink/SWG/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -246,7 +230,7 @@ VALUES (NULL, 'carelink-swg', 'Carelink SWG', 'carelink', 'ssh', '["show running false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- CData/xPON/get_config.py +-- службових рядків на початку: 3 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -254,7 +238,6 @@ VALUES (NULL, 'cdata-xpon', 'CData xPON', 'cdata', 'ssh', '["screen-length 0 tem false, '["^!Last configuration was updated"]', '["(password|cipher) \\S+", "snmp-agent community \\S+"]', true) ON CONFLICT DO NOTHING; --- Cisco/1900/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -262,7 +245,7 @@ VALUES (NULL, 'cisco-1900', 'Cisco 1900', 'cisco', 'ssh', '["terminal length 0", true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Cisco/AireOS/get_config.py +-- альтернативи: show running-config INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -270,7 +253,7 @@ VALUES (NULL, 'cisco-aireos', 'Cisco AireOS', 'cisco', 'ssh', '["terminal length true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Cisco/ASA/get_config.py +-- службових рядків на початку: 3 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -278,7 +261,6 @@ VALUES (NULL, 'cisco-asa', 'Cisco ASA', 'cisco', 'ssh', '["terminal length 0", " true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Cisco/CatOS/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -286,7 +268,6 @@ VALUES (NULL, 'cisco-catos', 'Cisco CatOS', 'cisco', 'ssh', '["terminal length 0 true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Cisco/FWSM/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -294,7 +275,7 @@ VALUES (NULL, 'cisco-fwsm', 'Cisco FWSM', 'cisco', 'ssh', '["terminal length 0", true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Cisco/IOS/get_config.py +-- startup: show startup-config; службових рядків на початку: 3 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -302,7 +283,7 @@ VALUES (NULL, 'cisco-ios', 'Cisco IOS', 'cisco', 'ssh', '["terminal length 0", " true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Cisco/IOSXR/get_config.py +-- службових рядків на початку: 3 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -310,7 +291,7 @@ VALUES (NULL, 'cisco-iosxr', 'Cisco IOSXR', 'cisco', 'ssh', '["terminal length 0 true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Cisco/NXOS/get_config.py +-- службових рядків на початку: 3 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -318,7 +299,6 @@ VALUES (NULL, 'cisco-nxos', 'Cisco NXOS', 'cisco', 'ssh', '["terminal length 0", true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Cisco/SANOS/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -326,7 +306,7 @@ VALUES (NULL, 'cisco-sanos', 'Cisco SANOS', 'cisco', 'ssh', '["terminal length 0 true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Cisco/SCOS/get_config.py +-- службових рядків на початку: 5 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -334,7 +314,6 @@ VALUES (NULL, 'cisco-scos', 'Cisco SCOS', 'cisco', 'ssh', '["terminal length 0", true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Cisco/SMB/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -342,7 +321,6 @@ VALUES (NULL, 'cisco-smb', 'Cisco SMB', 'cisco', 'ssh', '["terminal length 0", " true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Cisco/WLC/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -350,7 +328,7 @@ VALUES (NULL, 'cisco-wlc', 'Cisco WLC', 'cisco', 'ssh', '["terminal length 0", " true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- DCN/DCWS/get_config.py +-- startup: show startup-config INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -358,7 +336,6 @@ VALUES (NULL, 'dcn-dcws', 'DCN DCWS', 'dcn', 'ssh', '["terminal length 0", "show true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Dell/Powerconnect55xx/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -366,7 +343,7 @@ VALUES (NULL, 'dell-powerconnect55xx', 'Dell Powerconnect55xx', 'dell', 'ssh', ' false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Dell/Powerconnect62xx/get_config.py +-- службових рядків на початку: 5 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -374,7 +351,6 @@ VALUES (NULL, 'dell-powerconnect62xx', 'Dell Powerconnect62xx', 'dell', 'ssh', ' false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- DLink/DGS3100/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -382,7 +358,6 @@ VALUES (NULL, 'dlink-dgs3100', 'DLink DGS3100', 'dlink', 'ssh', '["disable clipa false, '["^#-+", "^# \\w+ Configuration"]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- DLink/DVG/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -390,7 +365,7 @@ VALUES (NULL, 'dlink-dvg', 'DLink DVG', 'dlink', 'ssh', '["cat /tmp/etc/default/ false, '["^#-+", "^# \\w+ Configuration"]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- DLink/DxS/get_config.py +-- службових рядків на початку: 1; альтернативи: show config current_config INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -398,7 +373,7 @@ VALUES (NULL, 'dlink-dxs', 'DLink DxS', 'dlink', 'ssh', '["disable clipaging", " false, '["^#-+", "^# \\w+ Configuration"]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- DLink/DxS_Cisco_CLI/get_config.py +-- службових рядків на початку: 3 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -406,7 +381,7 @@ VALUES (NULL, 'dlink-dxs-cisco-cli', 'DLink DxS_Cisco_CLI', 'dlink', 'ssh', '["d false, '["^#-+", "^# \\w+ Configuration"]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- DLink/DxS_Industrial_CLI/get_config.py +-- startup: show startup-config; службових рядків на початку: 3 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -414,7 +389,7 @@ VALUES (NULL, 'dlink-dxs-industrial-cli', 'DLink DxS_Industrial_CLI', 'dlink', ' false, '["^#-+", "^# \\w+ Configuration"]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- EdgeCore/ES/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -422,7 +397,7 @@ VALUES (NULL, 'edgecore-es', 'EdgeCore ES', 'edgecore', 'ssh', '["terminal lengt true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Eltex/ESR/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -430,7 +405,6 @@ VALUES (NULL, 'eltex-esr', 'Eltex ESR', 'eltex', 'ssh', '["terminal datadump", " true, '[]', '["(password|encrypted) \\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Eltex/LTE/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -438,7 +412,6 @@ VALUES (NULL, 'eltex-lte', 'Eltex LTE', 'eltex', 'ssh', '["terminal datadump", " true, '[]', '["(password|encrypted) \\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Eltex/LTP/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -446,7 +419,6 @@ VALUES (NULL, 'eltex-ltp', 'Eltex LTP', 'eltex', 'ssh', '["terminal datadump", " true, '[]', '["(password|encrypted) \\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Eltex/LTP16N/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -454,7 +426,7 @@ VALUES (NULL, 'eltex-ltp16n', 'Eltex LTP16N', 'eltex', 'ssh', '["terminal datadu true, '[]', '["(password|encrypted) \\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Eltex/MA4000/get_config.py +-- startup: show startup-config INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -462,7 +434,7 @@ VALUES (NULL, 'eltex-ma4000', 'Eltex MA4000', 'eltex', 'ssh', '["terminal datadu true, '[]', '["(password|encrypted) \\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Eltex/MES/get_config.py +-- startup: show startup-config INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -470,7 +442,7 @@ VALUES (NULL, 'eltex-mes', 'Eltex MES', 'eltex', 'ssh', '["terminal datadump", " true, '[]', '["(password|encrypted) \\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Eltex/MES24xx/get_config.py +-- startup: show startup-config; службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -478,7 +450,7 @@ VALUES (NULL, 'eltex-mes24xx', 'Eltex MES24xx', 'eltex', 'ssh', '["terminal data true, '[]', '["(password|encrypted) \\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Eltex/MES5448/get_config.py +-- startup: show startup-config; службових рядків на початку: 10 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -486,7 +458,6 @@ VALUES (NULL, 'eltex-mes5448', 'Eltex MES5448', 'eltex', 'ssh', '["terminal data true, '[]', '["(password|encrypted) \\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Eltex/PON/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -494,7 +465,6 @@ VALUES (NULL, 'eltex-pon', 'Eltex PON', 'eltex', 'ssh', '["terminal datadump", " true, '[]', '["(password|encrypted) \\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Eltex/RG/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -502,7 +472,6 @@ VALUES (NULL, 'eltex-rg', 'Eltex RG', 'eltex', 'ssh', '["tail -n +1 /tmp/etc/con true, '[]', '["(password|encrypted) \\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Eltex/SMG/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -510,7 +479,7 @@ VALUES (NULL, 'eltex-smg', 'Eltex SMG', 'eltex', 'ssh', '["cat /etc/config/cfg.y true, '[]', '["(password|encrypted) \\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Eltex/TAU/get_config.py +-- альтернативи: cat /etc/config/*, cat /tmp/etc/config/cfg.yaml INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -518,7 +487,6 @@ VALUES (NULL, 'eltex-tau', 'Eltex TAU', 'eltex', 'ssh', '["cat /etc/config/cfg.y true, '[]', '["(password|encrypted) \\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Eltex/WOPLR/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -526,7 +494,7 @@ VALUES (NULL, 'eltex-woplr', 'Eltex WOPLR', 'eltex', 'ssh', '["terminal datadump true, '[]', '["(password|encrypted) \\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Ericsson/MINI_LINK/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -534,7 +502,7 @@ VALUES (NULL, 'ericsson-mini-link', 'Ericsson MINI_LINK', 'ericsson', 'ssh', '[" false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Ericsson/SEOS/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -542,7 +510,7 @@ VALUES (NULL, 'ericsson-seos', 'Ericsson SEOS', 'ericsson', 'ssh', '["show runni false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Extreme/ISW/get_config.py +-- startup: show startup-config INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -550,7 +518,6 @@ VALUES (NULL, 'extreme-isw', 'Extreme ISW', 'extreme', 'ssh', '["disable clipagi false, '[]', '["password \\S+"]', true) ON CONFLICT DO NOTHING; --- Extreme/Summit200/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -558,7 +525,6 @@ VALUES (NULL, 'extreme-summit200', 'Extreme Summit200', 'extreme', 'ssh', '["dis false, '[]', '["password \\S+"]', true) ON CONFLICT DO NOTHING; --- Extreme/XOS/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -566,7 +532,7 @@ VALUES (NULL, 'extreme-xos', 'Extreme XOS', 'extreme', 'ssh', '["disable clipagi false, '[]', '["password \\S+"]', true) ON CONFLICT DO NOTHING; --- f5/BIGIP/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -574,7 +540,7 @@ VALUES (NULL, 'f5-bigip', 'f5 BIGIP', 'f5', 'ssh', '["list"]', '[>#]\s*$', false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Force10/FTOS/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -582,7 +548,6 @@ VALUES (NULL, 'force10-ftos', 'Force10 FTOS', 'force10', 'ssh', '["terminal leng true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Force10/SFTOS/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -590,7 +555,7 @@ VALUES (NULL, 'force10-sftos', 'Force10 SFTOS', 'force10', 'ssh', '["terminal le true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Fortinet/Fortigate/get_config.py +-- службових рядків на початку: 4 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -598,7 +563,6 @@ VALUES (NULL, 'fortinet-fortigate', 'Fortinet Fortigate', 'fortinet', 'ssh', '[" false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- GWD/GFA/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -606,7 +570,6 @@ VALUES (NULL, 'gwd-gfa', 'GWD GFA', 'gwd', 'ssh', '["show running-config"]', '[> false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- H3C/VRP/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -614,7 +577,6 @@ VALUES (NULL, 'h3c-vrp', 'H3C VRP', 'h3c', 'ssh', '["screen-length 0 temporary", false, '["^!Last configuration was updated"]', '["(password|cipher) \\S+", "snmp-agent community \\S+"]', true) ON CONFLICT DO NOTHING; --- HP/1910/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -622,7 +584,7 @@ VALUES (NULL, 'hp-1910', 'HP 1910', 'hp', 'ssh', '["no page", "display current-c true, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- HP/Aruba/get_config.py +-- startup: show startup-config; службових рядків на початку: 3 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -630,7 +592,6 @@ VALUES (NULL, 'hp-aruba', 'HP Aruba', 'hp', 'ssh', '["no page", "show running-co true, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- HP/Comware/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -638,7 +599,7 @@ VALUES (NULL, 'hp-comware', 'HP Comware', 'hp', 'ssh', '["no page", "undo termin true, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- HP/GbE2/get_config.py +-- альтернативи: / INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -646,7 +607,7 @@ VALUES (NULL, 'hp-gbe2', 'HP GbE2', 'hp', 'ssh', '["/cfg/dump"]', '[>#]\s*$', true, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- HP/ProCurve/get_config.py +-- startup: display saved-configuration; службових рядків на початку: 2; альтернативи: display current-configuration INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -654,7 +615,7 @@ VALUES (NULL, 'hp-procurve', 'HP ProCurve', 'hp', 'ssh', '["no page", "show conf true, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- HP/ProCurve9xxx/get_config.py +-- службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -662,7 +623,6 @@ VALUES (NULL, 'hp-procurve9xxx', 'HP ProCurve9xxx', 'hp', 'ssh', '["no page", "s true, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Huawei/MA5300/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -670,7 +630,7 @@ VALUES (NULL, 'huawei-ma5300', 'Huawei MA5300', 'huawei', 'ssh', '["screen-lengt false, '["^!Last configuration was updated"]', '["(password|cipher) \\S+", "snmp-agent community \\S+"]', true) ON CONFLICT DO NOTHING; --- Huawei/MA5600T/get_config.py +-- startup: display saved-configuration INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -678,7 +638,6 @@ VALUES (NULL, 'huawei-ma5600t', 'Huawei MA5600T', 'huawei', 'ssh', '["screen-len false, '["^!Last configuration was updated"]', '["(password|cipher) \\S+", "snmp-agent community \\S+"]', true) ON CONFLICT DO NOTHING; --- Huawei/UMG8900/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -686,7 +645,7 @@ VALUES (NULL, 'huawei-umg8900', 'Huawei UMG8900', 'huawei', 'ssh', '["screen-len false, '["^!Last configuration was updated"]', '["(password|cipher) \\S+", "snmp-agent community \\S+"]', true) ON CONFLICT DO NOTHING; --- Huawei/VRP/get_config.py +-- startup: display saved-configuration INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -694,7 +653,7 @@ VALUES (NULL, 'huawei-vrp', 'Huawei VRP', 'huawei', 'ssh', '["screen-length 0 te false, '["^!Last configuration was updated"]', '["(password|cipher) \\S+", "snmp-agent community \\S+"]', true) ON CONFLICT DO NOTHING; --- Huawei/VRP3/get_config.py +-- службових рядків на початку: 3 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -702,7 +661,7 @@ VALUES (NULL, 'huawei-vrp3', 'Huawei VRP3', 'huawei', 'ssh', '["screen-length 0 false, '["^!Last configuration was updated"]', '["(password|cipher) \\S+", "snmp-agent community \\S+"]', true) ON CONFLICT DO NOTHING; --- IBM/NOS/get_config.py +-- startup: show startup-config; службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -710,7 +669,6 @@ VALUES (NULL, 'ibm-nos', 'IBM NOS', 'ibm', 'ssh', '["show running-config"]', '[> false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- InfiNet/WANFlexX/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -718,7 +676,7 @@ VALUES (NULL, 'infinet-wanflexx', 'InfiNet WANFlexX', 'infinet', 'ssh', '["confi false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Intracom/UltraLink/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -726,7 +684,7 @@ VALUES (NULL, 'intracom-ultralink', 'Intracom UltraLink', 'intracom', 'ssh', '[" false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Iskratel/ESCOM/get_config.py +-- startup: more startup-config INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -734,7 +692,6 @@ VALUES (NULL, 'iskratel-escom', 'Iskratel ESCOM', 'iskratel', 'ssh', '["terminal true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Iskratel/MBAN/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -742,7 +699,6 @@ VALUES (NULL, 'iskratel-mban', 'Iskratel MBAN', 'iskratel', 'ssh', '["terminal l true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Iskratel/MSAN/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -750,7 +706,7 @@ VALUES (NULL, 'iskratel-msan', 'Iskratel MSAN', 'iskratel', 'ssh', '["terminal l true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Juniper/EX2500/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -758,7 +714,6 @@ VALUES (NULL, 'juniper-ex2500', 'Juniper EX2500', 'juniper', 'ssh', '["set cli s false, '["^## Last commit:"]', '["encrypted-password \\S+", "\"\\$9\\$\\S+\""]', true) ON CONFLICT DO NOTHING; --- Juniper/JUNOS/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -766,7 +721,7 @@ VALUES (NULL, 'juniper-junos', 'Juniper JUNOS', 'juniper', 'ssh', '["set cli scr false, '["^## Last commit:"]', '["encrypted-password \\S+", "\"\\$9\\$\\S+\""]', true) ON CONFLICT DO NOTHING; --- Juniper/JUNOSe/get_config.py +-- альтернативи: show configuration, show service-management service-definition brief | include True INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -774,7 +729,6 @@ VALUES (NULL, 'juniper-junose', 'Juniper JUNOSe', 'juniper', 'ssh', '["set cli s false, '["^## Last commit:"]', '["encrypted-password \\S+", "\"\\$9\\$\\S+\""]', true) ON CONFLICT DO NOTHING; --- Juniper/ScreenOS/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -782,7 +736,6 @@ VALUES (NULL, 'juniper-screenos', 'Juniper ScreenOS', 'juniper', 'ssh', '["set c false, '["^## Last commit:"]', '["encrypted-password \\S+", "\"\\$9\\$\\S+\""]', true) ON CONFLICT DO NOTHING; --- Juniper/SRCPE/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -790,7 +743,6 @@ VALUES (NULL, 'juniper-srcpe', 'Juniper SRCPE', 'juniper', 'ssh', '["set cli scr false, '["^## Last commit:"]', '["encrypted-password \\S+", "\"\\$9\\$\\S+\""]', true) ON CONFLICT DO NOTHING; --- Linksys/SPS2xx/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -798,7 +750,7 @@ VALUES (NULL, 'linksys-sps2xx', 'Linksys SPS2xx', 'linksys', 'ssh', '["show runn false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Maipu/OS/get_config.py +-- startup: show startup-config; службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -806,7 +758,6 @@ VALUES (NULL, 'maipu-os', 'Maipu OS', 'maipu', 'ssh', '["terminal length 0", "sh true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Mellanox/Cumulus/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -814,7 +765,7 @@ VALUES (NULL, 'mellanox-cumulus', 'Mellanox Cumulus', 'mellanox', 'ssh', '["net false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Mellanox/Onyx/get_config.py +-- startup: show configuration INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -822,7 +773,6 @@ VALUES (NULL, 'mellanox-onyx', 'Mellanox Onyx', 'mellanox', 'ssh', '["show confi false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- MikroTik/RouterOS/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -830,7 +780,7 @@ VALUES (NULL, 'mikrotik-routeros', 'MikroTik RouterOS', 'mikrotik', 'ssh', '["ex false, '["^# \\w{3}/\\d{2}/\\d{4}"]', '["password=\\S+"]', true) ON CONFLICT DO NOTHING; --- NAG/SNR/get_config.py +-- startup: show startup-config; службових рядків на початку: 3 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -838,7 +788,6 @@ VALUES (NULL, 'nag-snr', 'NAG SNR', 'nag', 'ssh', '["show running-config"]', '[> false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- NAG/SNR_eNOS/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -846,7 +795,6 @@ VALUES (NULL, 'nag-snr-enos', 'NAG SNR_eNOS', 'nag', 'ssh', '["show running-conf false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Nateks/FlexGain/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -854,7 +802,6 @@ VALUES (NULL, 'nateks-flexgain', 'Nateks FlexGain', 'nateks', 'ssh', '["terminal true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Nateks/NetXpert/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -862,7 +809,6 @@ VALUES (NULL, 'nateks-netxpert', 'Nateks NetXpert', 'nateks', 'ssh', '["terminal true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Nortel/BayStack425/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -870,7 +816,6 @@ VALUES (NULL, 'nortel-baystack425', 'Nortel BayStack425', 'nortel', 'ssh', '["sh false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- NSCComm/LPOS/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -878,7 +823,7 @@ VALUES (NULL, 'nsccomm-lpos', 'NSCComm LPOS', 'nsccomm', 'ssh', '["show cfg.sys" false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- NSN/hiX56xx/get_config.py +-- startup: show startup-config; службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -886,7 +831,7 @@ VALUES (NULL, 'nsn-hix56xx', 'NSN hiX56xx', 'nsn', 'ssh', '["show running-config false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- NSN/TIMOS/get_config.py +-- службових рядків на початку: 6; альтернативи: show bof, configure li, info INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -894,7 +839,7 @@ VALUES (NULL, 'nsn-timos', 'NSN TIMOS', 'nsn', 'ssh', '["admin display"]', '[>#] false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Orion/NOS/get_config.py +-- службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -902,7 +847,6 @@ VALUES (NULL, 'orion-nos', 'Orion NOS', 'orion', 'ssh', '["terminal length 0", " true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- OS/ESXi/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -910,7 +854,6 @@ VALUES (NULL, 'os-esxi', 'OS ESXi', 'os', 'ssh', '["cat /etc/vmware/esx.conf"]', false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Planet/WGSD/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -918,7 +861,6 @@ VALUES (NULL, 'planet-wgsd', 'Planet WGSD', 'planet', 'ssh', '["show startup-con false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Polygon/IOS/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -926,7 +868,7 @@ VALUES (NULL, 'polygon-ios', 'Polygon IOS', 'polygon', 'ssh', '["terminal length true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Protei/MediaGateway/get_config.py +-- альтернативи: ./clip, show-recursive INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -934,7 +876,6 @@ VALUES (NULL, 'protei-mediagateway', 'Protei MediaGateway', 'protei', 'ssh', '[" false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Qtech/QOS/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -942,7 +883,7 @@ VALUES (NULL, 'qtech-qos', 'Qtech QOS', 'qtech', 'ssh', '["terminal length 0", " true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Qtech/QSW/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -950,7 +891,7 @@ VALUES (NULL, 'qtech-qsw', 'Qtech QSW', 'qtech', 'ssh', '["terminal length 0", " true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Qtech/QSW2500/get_config.py +-- службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -958,7 +899,7 @@ VALUES (NULL, 'qtech-qsw2500', 'Qtech QSW2500', 'qtech', 'ssh', '["terminal leng true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Qtech/QSW2800/get_config.py +-- startup: show startup-config INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -966,7 +907,7 @@ VALUES (NULL, 'qtech-qsw2800', 'Qtech QSW2800', 'qtech', 'ssh', '["terminal leng true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Qtech/QSW8200/get_config.py +-- службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -974,7 +915,7 @@ VALUES (NULL, 'qtech-qsw8200', 'Qtech QSW8200', 'qtech', 'ssh', '["terminal leng true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Raisecom/RCIOS/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -982,7 +923,7 @@ VALUES (NULL, 'raisecom-rcios', 'Raisecom RCIOS', 'raisecom', 'ssh', '["terminal true, '[]', '["password \\S+"]', true) ON CONFLICT DO NOTHING; --- Raisecom/ROS/get_config.py +-- startup: show startup-config; службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -990,7 +931,7 @@ VALUES (NULL, 'raisecom-ros', 'Raisecom ROS', 'raisecom', 'ssh', '["terminal pag true, '[]', '["password \\S+"]', true) ON CONFLICT DO NOTHING; --- Raritan/DominionSX/get_config.py +-- альтернативи: top INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -998,7 +939,6 @@ VALUES (NULL, 'raritan-dominionsx', 'Raritan DominionSX', 'raritan', 'ssh', '["m false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Rotek/RTBS/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1006,7 +946,6 @@ VALUES (NULL, 'rotek-rtbs', 'Rotek RTBS', 'rotek', 'ssh', '["terminal length 0", true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Rotek/RTBSv1/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1014,7 +953,7 @@ VALUES (NULL, 'rotek-rtbsv1', 'Rotek RTBSv1', 'rotek', 'ssh', '["terminal length true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Ruckus/ZoneDirector/get_config.py +-- службових рядків на початку: 3 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1022,7 +961,6 @@ VALUES (NULL, 'ruckus-zonedirector', 'Ruckus ZoneDirector', 'ruckus', 'ssh', '[" true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Siklu/EH/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1030,7 +968,7 @@ VALUES (NULL, 'siklu-eh', 'Siklu EH', 'siklu', 'ssh', '["copy running-configurat false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- SKS/SKS/get_config.py +-- startup: show startup-config INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1038,7 +976,7 @@ VALUES (NULL, 'sks-sks', 'SKS SKS', 'sks', 'ssh', '["show running-config"]', '[> false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Sun/iLOM3/get_config.py +-- альтернативи: cd / INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1046,7 +984,6 @@ VALUES (NULL, 'sun-ilom3', 'Sun iLOM3', 'sun', 'ssh', '["cd /SP/config"]', '[>#] false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Supertel/K2X/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1054,7 +991,7 @@ VALUES (NULL, 'supertel-k2x', 'Supertel K2X', 'supertel', 'ssh', '["terminal len true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Symbol/AP/get_config.py +-- startup: show startup-config INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1062,7 +999,7 @@ VALUES (NULL, 'symbol-ap', 'Symbol AP', 'symbol', 'ssh', '["show running-config" false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Terayon/BW/get_config.py +-- службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1070,7 +1007,7 @@ VALUES (NULL, 'terayon-bw', 'Terayon BW', 'terayon', 'ssh', '["show running-conf false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- TPLink/T2600G/get_config.py +-- startup: show startup-config; службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1078,7 +1015,6 @@ VALUES (NULL, 'tplink-t2600g', 'TPLink T2600G', 'tplink', 'ssh', '["terminal len true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Ubiquiti/AirOS/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1086,7 +1022,7 @@ VALUES (NULL, 'ubiquiti-airos', 'Ubiquiti AirOS', 'ubiquiti', 'ssh', '["cat /tmp false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Upvel/UP/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1094,7 +1030,7 @@ VALUES (NULL, 'upvel-up', 'Upvel UP', 'upvel', 'ssh', '["terminal length 0", "sh true, '["^Building configuration", "^Current configuration : \\d+ bytes", "^ntp clock-period"]', '["(password|secret) \\d? ?\\S+", "snmp-server community \\S+"]', true) ON CONFLICT DO NOTHING; --- Vitesse/VSC/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1102,7 +1038,6 @@ VALUES (NULL, 'vitesse-vsc', 'Vitesse VSC', 'vitesse', 'ssh', '["show running-co false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Vyatta/Vyatta/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1110,7 +1045,7 @@ VALUES (NULL, 'vyatta-vyatta', 'Vyatta Vyatta', 'vyatta', 'ssh', '["set cli scre false, '["^## Last commit:"]', '["encrypted-password \\S+", "\"\\$9\\$\\S+\""]', true) ON CONFLICT DO NOTHING; --- Zebra/Zebra/get_config.py +-- службових рядків на початку: 2 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1118,7 +1053,7 @@ VALUES (NULL, 'zebra-zebra', 'Zebra Zebra', 'zebra', 'ssh', '["show running-conf false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- Zhone/Bitstorm/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1126,7 +1061,7 @@ VALUES (NULL, 'zhone-bitstorm', 'Zhone Bitstorm', 'zhone', 'ssh', '["show runnin false, '[]', '["password \\S+", "community \\S+"]', true) ON CONFLICT DO NOTHING; --- ZTE/ZXA10/get_config.py +-- службових рядків на початку: 3 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1134,7 +1069,6 @@ VALUES (NULL, 'zte-zxa10', 'ZTE ZXA10', 'zte', 'ssh', '["screen-length 0 tempora false, '["^!Last configuration was updated"]', '["(password|cipher) \\S+", "snmp-agent community \\S+"]', true) ON CONFLICT DO NOTHING; --- ZTE/ZXDSL531/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1142,7 +1076,7 @@ VALUES (NULL, 'zte-zxdsl531', 'ZTE ZXDSL531', 'zte', 'ssh', '["screen-length 0 t false, '["^!Last configuration was updated"]', '["(password|cipher) \\S+", "snmp-agent community \\S+"]', true) ON CONFLICT DO NOTHING; --- ZTE/ZXDSL98xx/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1150,7 +1084,7 @@ VALUES (NULL, 'zte-zxdsl98xx', 'ZTE ZXDSL98xx', 'zte', 'ssh', '["screen-length 0 false, '["^!Last configuration was updated"]', '["(password|cipher) \\S+", "snmp-agent community \\S+"]', true) ON CONFLICT DO NOTHING; --- ZTE/ZXR10/get_config.py +-- службових рядків на початку: 1 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1158,7 +1092,7 @@ VALUES (NULL, 'zte-zxr10', 'ZTE ZXR10', 'zte', 'ssh', '["screen-length 0 tempora false, '["^!Last configuration was updated"]', '["(password|cipher) \\S+", "snmp-agent community \\S+"]', true) ON CONFLICT DO NOTHING; --- Zyxel/DSLAM/get_config.py +-- альтернативи: config show all nopause, config print INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1166,7 +1100,7 @@ VALUES (NULL, 'zyxel-dslam', 'Zyxel DSLAM', 'zyxel', 'ssh', '["show config-0"]', false, '[]', '["password \\S+"]', true) ON CONFLICT DO NOTHING; --- Zyxel/MSAN/get_config.py +-- альтернативи: config show all nopause, config print INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1174,7 +1108,7 @@ VALUES (NULL, 'zyxel-msan', 'Zyxel MSAN', 'zyxel', 'ssh', '["show config-0"]', ' false, '[]', '["password \\S+"]', true) ON CONFLICT DO NOTHING; --- Zyxel/ZyNOS/get_config.py +-- службових рядків на початку: 4 INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) @@ -1182,7 +1116,6 @@ VALUES (NULL, 'zyxel-zynos', 'Zyxel ZyNOS', 'zyxel', 'ssh', '["show running-conf false, '[]', '["password \\S+"]', true) ON CONFLICT DO NOTHING; --- Zyxel/ZyNOSv2/get_config.py INSERT INTO ncm.profiles (tenant_id, key, name, vendor, transport, commands, prompt_regex, enable_required, scrub_patterns, redact_patterns, is_builtin) diff --git a/db/profiles/README.md b/db/profiles/README.md new file mode 100644 index 0000000..1a70148 --- /dev/null +++ b/db/profiles/README.md @@ -0,0 +1,77 @@ +# Каталог команд збору конфігу + +`catalog.json` — джерело істини про те, як зняти конфіг із кожної +підтримуваної платформи. 148 платформ, 67 вендорів. + +Міграція `db/migrations/0014_ncm_profiles.sql` **породжується** з +каталогу, а не правиться руками: два описи одного й того самого +розійшлися б із першою ж правкою, і невідомо було б, який справжній. + +```bash +python build.py # перезібрати міграцію +python build.py --check # звірити, чи вона актуальна +``` + +## Будова + +```jsonc +{ + "families": { + "cisco": { + "pager": "terminal length 0", // чим вимкнути посторінковий вивід + "prompt": "[>#]\\s*$", // за чим ловити кінець виводу + "enable_required": true, // чи потрібен привілейований режим + "scrub": ["^Building configuration"], // вирізати з diff — шум, що змінюється щоразу + "redact": ["(password|secret) \\S+"] // замаскувати перед записом у Git + } + }, + "vendor_family": { "bdcom": "cisco" }, // чий CLI успадкував вендор + "profiles": [ + { + "key": "cisco-ios", + "name": "Cisco IOS", + "vendor": "cisco", + "family": "cisco", + "config": "show running-config", // головна команда + "startup": "show startup-config", // необовʼязково + "prepare": ["undo terminal monitor"], // необовʼязково: підготовка консолі + "strip_lines": 3, // скільки службових рядків відкинути + "alternatives": ["show config current_config"] // для інших моделей родини + } + ] +} +``` + +## Як додати платформу + +1. Додай запис у `profiles`. Мінімум — `key`, `name`, `vendor`, + `family`, `config`. +2. Якщо CLI не схожий на жодну наявну родину — заведи нову у `families`. +3. `python build.py`. +4. Накоти міграцію (`ON CONFLICT DO NOTHING`, тож повторний накат + безпечний). + +## Родини + +Родина описує поведінку консолі, а не вендора: `bdcom`, `arista`, +`brocade` та ще з десяток говорять діалектом Cisco, `h3c` і `3com` — +діалектом Huawei. Тримати це один раз на родину, а не копіювати в кожен +профіль, — різниця між правкою в одному місці й правкою в сорока. + +Родина `generic` — запасний варіант: промпт `[>#]\s*$`, без вимкнення +пейджера, з обережним маскуванням паролів і community. + +## Про промпти + +`prompt` і `pager` задані за родиною й **перевіряються на живому +залізі**. Одна родина покриває десятки платформ, і дрібні відхилення +трапляються: прошивка може давати інший символ запрошення або не +розуміти команду вимкнення пейджера. Команди збору конфігу натомість +специфічні для платформи й узяті точно. + +## Чому не в БД + +Каталог — код, а не дані клієнта: він однаковий для всіх інсталяцій, +має переглядатись у code review і їхати разом із релізом. Тенант може +завести власний профіль (`ncm.profiles` із заповненим `tenant_id`) — +вбудовані при цьому лишаються недоторканими. diff --git a/db/profiles/build.py b/db/profiles/build.py new file mode 100644 index 0000000..88824a8 --- /dev/null +++ b/db/profiles/build.py @@ -0,0 +1,122 @@ +#!/usr/bin/env python3 +""" +Збирає міграцію ncm.profiles із каталогу команд. + +Каталог (`catalog.json`) — джерело істини. Міграція з нього +породжується, а не правиться руками: інакше два описи одного й того +самого розійшлися б із першою ж правкою, і невідомо було б, який із них +справжній. + +Використання: + + python build.py # перезбирає ../migrations/0014_ncm_profiles.sql + python build.py --check # лише звіряє, чи міграція актуальна +""" +import json +import pathlib +import re +import sys + +HERE = pathlib.Path(__file__).parent +CATALOG = HERE / "catalog.json" +MIGRATION = HERE.parent / "migrations" / "0014_ncm_profiles.sql" + + +def sql_str(v: str) -> str: + return "'" + v.replace("'", "''") + "'" + + +def sql_json(obj) -> str: + return sql_str(json.dumps(obj, ensure_ascii=False)) + + +def build_commands(profile: dict, family: dict) -> list: + """Повна послідовність: підготовка консолі, потім сам конфіг.""" + cmd = profile["config"] + + # Частина пристроїв «мережеві» лише зовні: конфіг знімається шелом. + # Відправити в bash «terminal datadump» означало б гарантовану + # помилку на кожному зборі. + shellish = bool(re.match(r"(cat|tail|less|more /|sh\b|/)", cmd)) + + out = [] + if family.get("pager") and not shellish: + out.append(family["pager"]) + out.extend(profile.get("prepare", [])) + out.append(cmd) + return out + + +def render(catalog: dict) -> str: + families = catalog["families"] + # Число рахуємо, а не пишемо руками: зашитий у текст лічильник + # розходиться з дійсністю на першій же доданій платформі. + n_platforms = len(catalog["profiles"]) + n_vendors = len({p["vendor"] for p in catalog["profiles"]}) + lines = [ + "-- =====================================================================", + "-- NetPulse :: 0014_ncm_profiles.sql", + f"-- Каталог команд збору конфігу: {n_platforms} платформ, {n_vendors} вендорів.", + "--", + "-- ФАЙЛ ЗГЕНЕРОВАНО. Джерело — db/profiles/catalog.json.", + "-- Правити тут безглуздо: наступна збірка перезапише. Щоб додати", + "-- платформу, відредагуй каталог і виконай db/profiles/build.py.", + "--", + "-- Промпти й команди вимкнення пейджера задані за родиною CLI й", + "-- перевіряються на живому залізі перед промисловим ужитком: одна", + "-- родина покриває десятки платформ, і дрібні відхилення трапляються.", + "-- =====================================================================", + "", + ] + + for p in catalog["profiles"]: + fam = families.get(p.get("family", "generic"), families["generic"]) + commands = build_commands(p, fam) + + note = [] + if p.get("startup"): + note.append(f"startup: {p['startup']}") + if p.get("strip_lines"): + note.append(f"службових рядків на початку: {p['strip_lines']}") + if p.get("alternatives"): + note.append("альтернативи: " + ", ".join(p["alternatives"])) + if note: + lines.append("-- " + "; ".join(note)) + + lines += [ + "INSERT INTO ncm.profiles", + " (tenant_id, key, name, vendor, transport, commands, prompt_regex,", + " enable_required, scrub_patterns, redact_patterns, is_builtin)", + "VALUES (NULL, {}, {}, {}, 'ssh', {}, {},".format( + sql_str(p["key"]), sql_str(p["name"]), sql_str(p["vendor"]), + sql_json(commands), sql_str(fam["prompt"])), + " {}, {}, {}, true)".format( + "true" if fam.get("enable_required") else "false", + sql_json(fam.get("scrub", [])), sql_json(fam.get("redact", []))), + "ON CONFLICT DO NOTHING;", + "", + ] + + return "\n".join(lines) + + +def main(): + catalog = json.loads(CATALOG.read_text(encoding="utf-8")) + sql = render(catalog) + + if "--check" in sys.argv: + current = MIGRATION.read_text(encoding="utf-8") if MIGRATION.exists() else "" + if current != sql: + print("міграція розійшлася з каталогом — виконай build.py", file=sys.stderr) + return 1 + print("міграція актуальна") + return 0 + + MIGRATION.write_text(sql, encoding="utf-8") + vendors = len({p["vendor"] for p in catalog["profiles"]}) + print(f"{MIGRATION.name}: {len(catalog['profiles'])} платформ, {vendors} вендорів") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/db/profiles/catalog.json b/db/profiles/catalog.json new file mode 100644 index 0000000..688b4a8 --- /dev/null +++ b/db/profiles/catalog.json @@ -0,0 +1,1338 @@ +{ + "version": 1, + "families": { + "cisco": { + "pager": "terminal length 0", + "prompt": "[>#]\\s*$", + "enable_required": true, + "scrub": [ + "^Building configuration", + "^Current configuration : \\d+ bytes", + "^ntp clock-period" + ], + "redact": [ + "(password|secret) \\d? ?\\S+", + "snmp-server community \\S+" + ] + }, + "dlink": { + "pager": "disable clipaging", + "prompt": "[>#:]\\s*$", + "enable_required": false, + "scrub": [ + "^#-+", + "^# \\w+ Configuration" + ], + "redact": [ + "password \\S+", + "community \\S+" + ] + }, + "eltex": { + "pager": "terminal datadump", + "prompt": "[>#]\\s*$", + "enable_required": true, + "scrub": [], + "redact": [ + "(password|encrypted) \\S+", + "snmp-server community \\S+" + ] + }, + "extreme": { + "pager": "disable clipaging", + "prompt": "[>#]\\s*$", + "enable_required": false, + "scrub": [], + "redact": [ + "password \\S+" + ] + }, + "generic": { + "pager": "", + "prompt": "[>#]\\s*$", + "enable_required": false, + "scrub": [], + "redact": [ + "password \\S+", + "community \\S+" + ] + }, + "hp": { + "pager": "no page", + "prompt": "[>#]\\s*$", + "enable_required": true, + "scrub": [], + "redact": [ + "password \\S+", + "community \\S+" + ] + }, + "huawei": { + "pager": "screen-length 0 temporary", + "prompt": "[\\]>]\\s*$", + "enable_required": false, + "scrub": [ + "^!Last configuration was updated" + ], + "redact": [ + "(password|cipher) \\S+", + "snmp-agent community \\S+" + ] + }, + "juniper": { + "pager": "set cli screen-length 0", + "prompt": "[%>#]\\s*$", + "enable_required": false, + "scrub": [ + "^## Last commit:" + ], + "redact": [ + "encrypted-password \\S+", + "\"\\$9\\$\\S+\"" + ] + }, + "mikrotik": { + "pager": "", + "prompt": "\\] > $", + "enable_required": false, + "scrub": [ + "^# \\w{3}/\\d{2}/\\d{4}" + ], + "redact": [ + "password=\\S+" + ] + }, + "raisecom": { + "pager": "terminal page-break disable", + "prompt": "[>#]\\s*$", + "enable_required": true, + "scrub": [], + "redact": [ + "password \\S+" + ] + }, + "zyxel": { + "pager": "", + "prompt": "[>#]\\s*$", + "enable_required": false, + "scrub": [], + "redact": [ + "password \\S+" + ] + } + }, + "vendor_family": { + "3com": "huawei", + "alcatel": "cisco", + "arista": "cisco", + "aruba": "hp", + "bdcom": "cisco", + "brocade": "cisco", + "cdata": "huawei", + "dcn": "cisco", + "edgecore": "cisco", + "force10": "cisco", + "h3c": "huawei", + "hpe": "hp", + "iskratel": "cisco", + "junipernetworks": "juniper", + "maipu": "cisco", + "nateks": "cisco", + "orion": "cisco", + "polygon": "cisco", + "qtech": "cisco", + "rotek": "cisco", + "ruckus": "cisco", + "snr": "cisco", + "snrs": "cisco", + "supertel": "cisco", + "tplink": "cisco", + "upvel": "cisco", + "vyatta": "juniper", + "zte": "huawei" + }, + "profiles": [ + { + "key": "3com-4500", + "name": "3Com 4500", + "vendor": "3com", + "family": "huawei", + "config": "display current-configuration" + }, + { + "key": "3com-superstack3-4500", + "name": "3Com SuperStack3_4500", + "vendor": "3com", + "family": "huawei", + "config": "display current-configuration" + }, + { + "key": "addpac-apos", + "name": "AddPac APOS", + "vendor": "addpac", + "family": "generic", + "config": "show running-config", + "strip_lines": 3 + }, + { + "key": "alcatel-7302", + "name": "Alcatel 7302", + "vendor": "alcatel", + "family": "cisco", + "config": "environment inhibit-alarms mode batch terminal-timeout timeout:30", + "alternatives": [ + "info configure flat" + ] + }, + { + "key": "alcatel-aos", + "name": "Alcatel AOS", + "vendor": "alcatel", + "family": "cisco", + "config": "show configuration snapshot" + }, + { + "key": "alcatel-os62xx", + "name": "Alcatel OS62xx", + "vendor": "alcatel", + "family": "cisco", + "config": "show running-config" + }, + { + "key": "alcatel-timos", + "name": "Alcatel TIMOS", + "vendor": "alcatel", + "family": "cisco", + "config": "admin display", + "strip_lines": 6, + "alternatives": [ + "show bof", + "configure li", + "info" + ] + }, + { + "key": "alliedtelesis-at8000", + "name": "AlliedTelesis AT8000", + "vendor": "alliedtelesis", + "family": "generic", + "config": "show config" + }, + { + "key": "alliedtelesis-at8000s", + "name": "AlliedTelesis AT8000S", + "vendor": "alliedtelesis", + "family": "generic", + "config": "show running-config" + }, + { + "key": "alliedtelesis-at8100", + "name": "AlliedTelesis AT8100", + "vendor": "alliedtelesis", + "family": "generic", + "config": "show running-config" + }, + { + "key": "alliedtelesis-at8500", + "name": "AlliedTelesis AT8500", + "vendor": "alliedtelesis", + "family": "generic", + "config": "show config dynamic" + }, + { + "key": "alliedtelesis-at9400", + "name": "AlliedTelesis AT9400", + "vendor": "alliedtelesis", + "family": "generic", + "config": "show config dynamic" + }, + { + "key": "alliedtelesis-at9900", + "name": "AlliedTelesis AT9900", + "vendor": "alliedtelesis", + "family": "generic", + "config": "show config dynamic" + }, + { + "key": "alstec-24xx", + "name": "Alstec 24xx", + "vendor": "alstec", + "family": "generic", + "config": "show running-config" + }, + { + "key": "alstec-7200", + "name": "Alstec 7200", + "vendor": "alstec", + "family": "generic", + "config": "show running-config" + }, + { + "key": "alstec-als", + "name": "Alstec ALS", + "vendor": "alstec", + "family": "generic", + "config": "show running-config", + "startup": "show startup-config" + }, + { + "key": "alstec-mspu", + "name": "Alstec MSPU", + "vendor": "alstec", + "family": "generic", + "config": "show running-config", + "startup": "show startup-config" + }, + { + "key": "angtel-topaz", + "name": "Angtel Topaz", + "vendor": "angtel", + "family": "generic", + "config": "show running-config", + "startup": "show startup-config" + }, + { + "key": "arista-eos", + "name": "Arista EOS", + "vendor": "arista", + "family": "cisco", + "config": "show running-config" + }, + { + "key": "aruba-arubaos", + "name": "Aruba ArubaOS", + "vendor": "aruba", + "family": "hp", + "config": "show running-config", + "strip_lines": 2 + }, + { + "key": "audiocodes-mediant2000", + "name": "Audiocodes Mediant2000", + "vendor": "audiocodes", + "family": "generic", + "config": "conf", + "alternatives": [ + "cf get" + ] + }, + { + "key": "bdcom-ios", + "name": "BDCOM IOS", + "vendor": "bdcom", + "family": "cisco", + "config": "show running-config", + "strip_lines": 4 + }, + { + "key": "bdcom-xpon", + "name": "BDCOM xPON", + "vendor": "bdcom", + "family": "cisco", + "config": "show running-config", + "startup": "show configuration" + }, + { + "key": "brocade-adx", + "name": "Brocade ADX", + "vendor": "brocade", + "family": "cisco", + "config": "show running-config", + "strip_lines": 2 + }, + { + "key": "brocade-cer", + "name": "Brocade CER", + "vendor": "brocade", + "family": "cisco", + "config": "show config", + "strip_lines": 2 + }, + { + "key": "brocade-cer-adv", + "name": "Brocade CER-ADV", + "vendor": "brocade", + "family": "cisco", + "config": "show config", + "strip_lines": 2 + }, + { + "key": "brocade-fabricos", + "name": "Brocade FabricOS", + "vendor": "brocade", + "family": "cisco", + "config": "configshow", + "strip_lines": 1 + }, + { + "key": "brocade-ironware", + "name": "Brocade IronWare", + "vendor": "brocade", + "family": "cisco", + "config": "show config", + "strip_lines": 2 + }, + { + "key": "carelink-swg", + "name": "Carelink SWG", + "vendor": "carelink", + "family": "generic", + "config": "show running-config", + "strip_lines": 1 + }, + { + "key": "cdata-xpon", + "name": "CData xPON", + "vendor": "cdata", + "family": "huawei", + "config": "show current-config", + "strip_lines": 3 + }, + { + "key": "cisco-1900", + "name": "Cisco 1900", + "vendor": "cisco", + "family": "cisco", + "config": "show running-config" + }, + { + "key": "cisco-aireos", + "name": "Cisco AireOS", + "vendor": "cisco", + "family": "cisco", + "config": "show run-config commands", + "alternatives": [ + "show running-config" + ] + }, + { + "key": "cisco-asa", + "name": "Cisco ASA", + "vendor": "cisco", + "family": "cisco", + "config": "more system:running-config", + "strip_lines": 3 + }, + { + "key": "cisco-catos", + "name": "Cisco CatOS", + "vendor": "cisco", + "family": "cisco", + "config": "show config" + }, + { + "key": "cisco-fwsm", + "name": "Cisco FWSM", + "vendor": "cisco", + "family": "cisco", + "config": "show running-config", + "prepare": [ + "terminal pager 0" + ] + }, + { + "key": "cisco-ios", + "name": "Cisco IOS", + "vendor": "cisco", + "family": "cisco", + "config": "show running-config", + "startup": "show startup-config", + "strip_lines": 3 + }, + { + "key": "cisco-iosxr", + "name": "Cisco IOSXR", + "vendor": "cisco", + "family": "cisco", + "config": "show running-config", + "strip_lines": 3 + }, + { + "key": "cisco-nxos", + "name": "Cisco NXOS", + "vendor": "cisco", + "family": "cisco", + "config": "show running-config | no-more", + "strip_lines": 3 + }, + { + "key": "cisco-sanos", + "name": "Cisco SANOS", + "vendor": "cisco", + "family": "cisco", + "config": "show running-config" + }, + { + "key": "cisco-scos", + "name": "Cisco SCOS", + "vendor": "cisco", + "family": "cisco", + "config": "show running-config", + "strip_lines": 5 + }, + { + "key": "cisco-smb", + "name": "Cisco SMB", + "vendor": "cisco", + "family": "cisco", + "config": "show running-config" + }, + { + "key": "cisco-wlc", + "name": "Cisco WLC", + "vendor": "cisco", + "family": "cisco", + "config": "show run-config commands" + }, + { + "key": "dcn-dcws", + "name": "DCN DCWS", + "vendor": "dcn", + "family": "cisco", + "config": "show running-config", + "startup": "show startup-config" + }, + { + "key": "dell-powerconnect55xx", + "name": "Dell Powerconnect55xx", + "vendor": "dell", + "family": "generic", + "config": "show running-config" + }, + { + "key": "dell-powerconnect62xx", + "name": "Dell Powerconnect62xx", + "vendor": "dell", + "family": "generic", + "config": "show running-config", + "strip_lines": 5 + }, + { + "key": "dlink-dgs3100", + "name": "DLink DGS3100", + "vendor": "dlink", + "family": "dlink", + "config": "show configuration running" + }, + { + "key": "dlink-dvg", + "name": "DLink DVG", + "vendor": "dlink", + "family": "dlink", + "config": "cat /tmp/etc/default/config.json" + }, + { + "key": "dlink-dxs", + "name": "DLink DxS", + "vendor": "dlink", + "family": "dlink", + "config": "show config active", + "strip_lines": 1, + "alternatives": [ + "show config current_config" + ] + }, + { + "key": "dlink-dxs-cisco-cli", + "name": "DLink DxS_Cisco_CLI", + "vendor": "dlink", + "family": "dlink", + "config": "show running-config", + "strip_lines": 3 + }, + { + "key": "dlink-dxs-industrial-cli", + "name": "DLink DxS_Industrial_CLI", + "vendor": "dlink", + "family": "dlink", + "config": "show running-config", + "startup": "show startup-config", + "strip_lines": 3 + }, + { + "key": "edgecore-es", + "name": "EdgeCore ES", + "vendor": "edgecore", + "family": "cisco", + "config": "show running-config", + "strip_lines": 1 + }, + { + "key": "eltex-esr", + "name": "Eltex ESR", + "vendor": "eltex", + "family": "eltex", + "config": "show running-config", + "strip_lines": 1 + }, + { + "key": "eltex-lte", + "name": "Eltex LTE", + "vendor": "eltex", + "family": "eltex", + "config": "show running-config" + }, + { + "key": "eltex-ltp", + "name": "Eltex LTP", + "vendor": "eltex", + "family": "eltex", + "config": "show running-config" + }, + { + "key": "eltex-ltp16n", + "name": "Eltex LTP16N", + "vendor": "eltex", + "family": "eltex", + "config": "show running-config" + }, + { + "key": "eltex-ma4000", + "name": "Eltex MA4000", + "vendor": "eltex", + "family": "eltex", + "config": "show running-config", + "startup": "show startup-config" + }, + { + "key": "eltex-mes", + "name": "Eltex MES", + "vendor": "eltex", + "family": "eltex", + "config": "show running-config", + "startup": "show startup-config" + }, + { + "key": "eltex-mes24xx", + "name": "Eltex MES24xx", + "vendor": "eltex", + "family": "eltex", + "config": "show running-config", + "startup": "show startup-config", + "strip_lines": 2 + }, + { + "key": "eltex-mes5448", + "name": "Eltex MES5448", + "vendor": "eltex", + "family": "eltex", + "config": "show running-config", + "startup": "show startup-config", + "strip_lines": 10 + }, + { + "key": "eltex-pon", + "name": "Eltex PON", + "vendor": "eltex", + "family": "eltex", + "config": "show running-config" + }, + { + "key": "eltex-rg", + "name": "Eltex RG", + "vendor": "eltex", + "family": "eltex", + "config": "tail -n +1 /tmp/etc/config/cert/* /tmp/etc/config/*" + }, + { + "key": "eltex-smg", + "name": "Eltex SMG", + "vendor": "eltex", + "family": "eltex", + "config": "cat /etc/config/cfg.yaml" + }, + { + "key": "eltex-tau", + "name": "Eltex TAU", + "vendor": "eltex", + "family": "eltex", + "config": "cat /etc/config/cfg.yaml", + "alternatives": [ + "cat /etc/config/*", + "cat /tmp/etc/config/cfg.yaml" + ] + }, + { + "key": "eltex-woplr", + "name": "Eltex WOPLR", + "vendor": "eltex", + "family": "eltex", + "config": "show-config" + }, + { + "key": "ericsson-mini-link", + "name": "Ericsson MINI_LINK", + "vendor": "ericsson", + "family": "generic", + "config": "show running-config", + "strip_lines": 1 + }, + { + "key": "ericsson-seos", + "name": "Ericsson SEOS", + "vendor": "ericsson", + "family": "generic", + "config": "show running-config", + "strip_lines": 1 + }, + { + "key": "extreme-isw", + "name": "Extreme ISW", + "vendor": "extreme", + "family": "extreme", + "config": "flash:startup-config", + "startup": "show startup-config" + }, + { + "key": "extreme-summit200", + "name": "Extreme Summit200", + "vendor": "extreme", + "family": "extreme", + "config": "show configuration" + }, + { + "key": "extreme-xos", + "name": "Extreme XOS", + "vendor": "extreme", + "family": "extreme", + "config": "show config" + }, + { + "key": "f5-bigip", + "name": "f5 BIGIP", + "vendor": "f5", + "family": "generic", + "config": "list", + "strip_lines": 1 + }, + { + "key": "force10-ftos", + "name": "Force10 FTOS", + "vendor": "force10", + "family": "cisco", + "config": "show running-config", + "strip_lines": 1 + }, + { + "key": "force10-sftos", + "name": "Force10 SFTOS", + "vendor": "force10", + "family": "cisco", + "config": "show running-config" + }, + { + "key": "fortinet-fortigate", + "name": "Fortinet Fortigate", + "vendor": "fortinet", + "family": "generic", + "config": "show", + "strip_lines": 4 + }, + { + "key": "gwd-gfa", + "name": "GWD GFA", + "vendor": "gwd", + "family": "generic", + "config": "show running-config" + }, + { + "key": "h3c-vrp", + "name": "H3C VRP", + "vendor": "h3c", + "family": "huawei", + "config": "display current-configuration", + "prepare": [ + "undo terminal monitor" + ] + }, + { + "key": "hp-1910", + "name": "HP 1910", + "vendor": "hp", + "family": "hp", + "config": "display current-configuration" + }, + { + "key": "hp-aruba", + "name": "HP Aruba", + "vendor": "hp", + "family": "hp", + "config": "show running-config", + "startup": "show startup-config", + "strip_lines": 3 + }, + { + "key": "hp-comware", + "name": "HP Comware", + "vendor": "hp", + "family": "hp", + "config": "display current-configuration", + "prepare": [ + "undo terminal monitor" + ] + }, + { + "key": "hp-gbe2", + "name": "HP GbE2", + "vendor": "hp", + "family": "hp", + "config": "/cfg/dump", + "alternatives": [ + "/" + ] + }, + { + "key": "hp-procurve", + "name": "HP ProCurve", + "vendor": "hp", + "family": "hp", + "config": "show config", + "startup": "display saved-configuration", + "strip_lines": 2, + "alternatives": [ + "display current-configuration" + ] + }, + { + "key": "hp-procurve9xxx", + "name": "HP ProCurve9xxx", + "vendor": "hp", + "family": "hp", + "config": "show config", + "strip_lines": 2 + }, + { + "key": "huawei-ma5300", + "name": "Huawei MA5300", + "vendor": "huawei", + "family": "huawei", + "config": "show running-config" + }, + { + "key": "huawei-ma5600t", + "name": "Huawei MA5600T", + "vendor": "huawei", + "family": "huawei", + "config": "display current-configuration", + "startup": "display saved-configuration" + }, + { + "key": "huawei-umg8900", + "name": "Huawei UMG8900", + "vendor": "huawei", + "family": "huawei", + "config": "dsp cfg;" + }, + { + "key": "huawei-vrp", + "name": "Huawei VRP", + "vendor": "huawei", + "family": "huawei", + "config": "display current-configuration", + "prepare": [ + "undo terminal monitor" + ], + "startup": "display saved-configuration" + }, + { + "key": "huawei-vrp3", + "name": "Huawei VRP3", + "vendor": "huawei", + "family": "huawei", + "config": "show running-config", + "prepare": [ + "no monitor" + ], + "strip_lines": 3 + }, + { + "key": "ibm-nos", + "name": "IBM NOS", + "vendor": "ibm", + "family": "generic", + "config": "show running-config", + "startup": "show startup-config", + "strip_lines": 2 + }, + { + "key": "infinet-wanflexx", + "name": "InfiNet WANFlexX", + "vendor": "infinet", + "family": "generic", + "config": "config show" + }, + { + "key": "intracom-ultralink", + "name": "Intracom UltraLink", + "vendor": "intracom", + "family": "generic", + "config": "config show current", + "strip_lines": 1 + }, + { + "key": "iskratel-escom", + "name": "Iskratel ESCOM", + "vendor": "iskratel", + "family": "cisco", + "config": "show running-config", + "startup": "more startup-config" + }, + { + "key": "iskratel-mban", + "name": "Iskratel MBAN", + "vendor": "iskratel", + "family": "cisco", + "config": "show system config detail" + }, + { + "key": "iskratel-msan", + "name": "Iskratel MSAN", + "vendor": "iskratel", + "family": "cisco", + "config": "show running-config" + }, + { + "key": "juniper-ex2500", + "name": "Juniper EX2500", + "vendor": "juniper", + "family": "juniper", + "config": "show active-config", + "strip_lines": 1 + }, + { + "key": "juniper-junos", + "name": "Juniper JUNOS", + "vendor": "juniper", + "family": "juniper", + "config": "show configuration | display omit" + }, + { + "key": "juniper-junose", + "name": "Juniper JUNOSe", + "vendor": "juniper", + "family": "juniper", + "config": "show running-configuration", + "alternatives": [ + "show configuration", + "show service-management service-definition brief | include True" + ] + }, + { + "key": "juniper-screenos", + "name": "Juniper ScreenOS", + "vendor": "juniper", + "family": "juniper", + "config": "get config" + }, + { + "key": "juniper-srcpe", + "name": "Juniper SRCPE", + "vendor": "juniper", + "family": "juniper", + "config": "show configuration" + }, + { + "key": "linksys-sps2xx", + "name": "Linksys SPS2xx", + "vendor": "linksys", + "family": "generic", + "config": "show running-config" + }, + { + "key": "maipu-os", + "name": "Maipu OS", + "vendor": "maipu", + "family": "cisco", + "config": "show running-config", + "startup": "show startup-config", + "strip_lines": 2 + }, + { + "key": "mellanox-cumulus", + "name": "Mellanox Cumulus", + "vendor": "mellanox", + "family": "generic", + "config": "net show configuration commands" + }, + { + "key": "mellanox-onyx", + "name": "Mellanox Onyx", + "vendor": "mellanox", + "family": "generic", + "config": "show configuration running", + "startup": "show configuration" + }, + { + "key": "mikrotik-routeros", + "name": "MikroTik RouterOS", + "vendor": "mikrotik", + "family": "mikrotik", + "config": "export" + }, + { + "key": "nag-snr", + "name": "NAG SNR", + "vendor": "nag", + "family": "generic", + "config": "show running-config", + "startup": "show startup-config", + "strip_lines": 3 + }, + { + "key": "nag-snr-enos", + "name": "NAG SNR_eNOS", + "vendor": "nag", + "family": "generic", + "config": "show running-config" + }, + { + "key": "nateks-flexgain", + "name": "Nateks FlexGain", + "vendor": "nateks", + "family": "cisco", + "config": "show runningcfg" + }, + { + "key": "nateks-netxpert", + "name": "Nateks NetXpert", + "vendor": "nateks", + "family": "cisco", + "config": "show configuration" + }, + { + "key": "nortel-baystack425", + "name": "Nortel BayStack425", + "vendor": "nortel", + "family": "generic", + "config": "show run" + }, + { + "key": "nsccomm-lpos", + "name": "NSCComm LPOS", + "vendor": "nsccomm", + "family": "generic", + "config": "show cfg.sys" + }, + { + "key": "nsn-hix56xx", + "name": "NSN hiX56xx", + "vendor": "nsn", + "family": "generic", + "config": "show running-config", + "startup": "show startup-config", + "strip_lines": 2 + }, + { + "key": "nsn-timos", + "name": "NSN TIMOS", + "vendor": "nsn", + "family": "generic", + "config": "admin display", + "strip_lines": 6, + "alternatives": [ + "show bof", + "configure li", + "info" + ] + }, + { + "key": "orion-nos", + "name": "Orion NOS", + "vendor": "orion", + "family": "cisco", + "config": "show running-config", + "strip_lines": 2 + }, + { + "key": "os-esxi", + "name": "OS ESXi", + "vendor": "os", + "family": "generic", + "config": "cat /etc/vmware/esx.conf" + }, + { + "key": "planet-wgsd", + "name": "Planet WGSD", + "vendor": "planet", + "family": "generic", + "config": "show startup-config" + }, + { + "key": "polygon-ios", + "name": "Polygon IOS", + "vendor": "polygon", + "family": "cisco", + "config": "show running-config" + }, + { + "key": "protei-mediagateway", + "name": "Protei MediaGateway", + "vendor": "protei", + "family": "generic", + "config": "cd /usr/protei/CLI/Client", + "alternatives": [ + "./clip", + "show-recursive" + ] + }, + { + "key": "qtech-qos", + "name": "Qtech QOS", + "vendor": "qtech", + "family": "cisco", + "config": "show running-config" + }, + { + "key": "qtech-qsw", + "name": "Qtech QSW", + "vendor": "qtech", + "family": "cisco", + "config": "show running-config", + "strip_lines": 1 + }, + { + "key": "qtech-qsw2500", + "name": "Qtech QSW2500", + "vendor": "qtech", + "family": "cisco", + "config": "show running-config", + "strip_lines": 2 + }, + { + "key": "qtech-qsw2800", + "name": "Qtech QSW2800", + "vendor": "qtech", + "family": "cisco", + "config": "show running-config", + "startup": "show startup-config" + }, + { + "key": "qtech-qsw8200", + "name": "Qtech QSW8200", + "vendor": "qtech", + "family": "cisco", + "config": "show running-config", + "strip_lines": 2 + }, + { + "key": "raisecom-rcios", + "name": "Raisecom RCIOS", + "vendor": "raisecom", + "family": "raisecom", + "config": "show running-config", + "strip_lines": 1 + }, + { + "key": "raisecom-ros", + "name": "Raisecom ROS", + "vendor": "raisecom", + "family": "raisecom", + "config": "show running-config", + "startup": "show startup-config", + "strip_lines": 1 + }, + { + "key": "raritan-dominionsx", + "name": "Raritan DominionSX", + "vendor": "raritan", + "family": "generic", + "config": "maintenance", + "alternatives": [ + "top" + ] + }, + { + "key": "rotek-rtbs", + "name": "Rotek RTBS", + "vendor": "rotek", + "family": "cisco", + "config": "show config" + }, + { + "key": "rotek-rtbsv1", + "name": "Rotek RTBSv1", + "vendor": "rotek", + "family": "cisco", + "config": "show config" + }, + { + "key": "ruckus-zonedirector", + "name": "Ruckus ZoneDirector", + "vendor": "ruckus", + "family": "cisco", + "config": "show config", + "strip_lines": 3 + }, + { + "key": "siklu-eh", + "name": "Siklu EH", + "vendor": "siklu", + "family": "generic", + "config": "copy running-configuration display" + }, + { + "key": "sks-sks", + "name": "SKS SKS", + "vendor": "sks", + "family": "generic", + "config": "show running-config", + "startup": "show startup-config" + }, + { + "key": "sun-ilom3", + "name": "Sun iLOM3", + "vendor": "sun", + "family": "generic", + "config": "cd /SP/config", + "alternatives": [ + "cd /" + ] + }, + { + "key": "supertel-k2x", + "name": "Supertel K2X", + "vendor": "supertel", + "family": "cisco", + "config": "show running-config" + }, + { + "key": "symbol-ap", + "name": "Symbol AP", + "vendor": "symbol", + "family": "generic", + "config": "show running-config", + "startup": "show startup-config" + }, + { + "key": "terayon-bw", + "name": "Terayon BW", + "vendor": "terayon", + "family": "generic", + "config": "show running-config", + "strip_lines": 2 + }, + { + "key": "tplink-t2600g", + "name": "TPLink T2600G", + "vendor": "tplink", + "family": "cisco", + "config": "show running-config", + "startup": "show startup-config", + "strip_lines": 2 + }, + { + "key": "ubiquiti-airos", + "name": "Ubiquiti AirOS", + "vendor": "ubiquiti", + "family": "generic", + "config": "cat /tmp/system.cfg" + }, + { + "key": "upvel-up", + "name": "Upvel UP", + "vendor": "upvel", + "family": "cisco", + "config": "show running-config", + "strip_lines": 1 + }, + { + "key": "vitesse-vsc", + "name": "Vitesse VSC", + "vendor": "vitesse", + "family": "generic", + "config": "show running-config", + "strip_lines": 1 + }, + { + "key": "vyatta-vyatta", + "name": "Vyatta Vyatta", + "vendor": "vyatta", + "family": "juniper", + "config": "show configuration" + }, + { + "key": "zebra-zebra", + "name": "Zebra Zebra", + "vendor": "zebra", + "family": "generic", + "config": "show running-config", + "strip_lines": 2 + }, + { + "key": "zhone-bitstorm", + "name": "Zhone Bitstorm", + "vendor": "zhone", + "family": "generic", + "config": "show running-config", + "strip_lines": 1 + }, + { + "key": "zte-zxa10", + "name": "ZTE ZXA10", + "vendor": "zte", + "family": "huawei", + "config": "show running-config", + "strip_lines": 3 + }, + { + "key": "zte-zxdsl531", + "name": "ZTE ZXDSL531", + "vendor": "zte", + "family": "huawei", + "config": "dumpcfg" + }, + { + "key": "zte-zxdsl98xx", + "name": "ZTE ZXDSL98xx", + "vendor": "zte", + "family": "huawei", + "config": "show running-config", + "strip_lines": 1 + }, + { + "key": "zte-zxr10", + "name": "ZTE ZXR10", + "vendor": "zte", + "family": "huawei", + "config": "show running-config", + "strip_lines": 1 + }, + { + "key": "zyxel-dslam", + "name": "Zyxel DSLAM", + "vendor": "zyxel", + "family": "zyxel", + "config": "show config-0", + "alternatives": [ + "config show all nopause", + "config print" + ] + }, + { + "key": "zyxel-msan", + "name": "Zyxel MSAN", + "vendor": "zyxel", + "family": "zyxel", + "config": "show config-0", + "alternatives": [ + "config show all nopause", + "config print" + ] + }, + { + "key": "zyxel-zynos", + "name": "Zyxel ZyNOS", + "vendor": "zyxel", + "family": "zyxel", + "config": "show running-config", + "strip_lines": 4 + }, + { + "key": "zyxel-zynosv2", + "name": "Zyxel ZyNOSv2", + "vendor": "zyxel", + "family": "zyxel", + "config": "fm cat init" + } + ] +} diff --git a/server/API.md b/server/API.md index 7b331b8..08aa02a 100644 --- a/server/API.md +++ b/server/API.md @@ -504,15 +504,21 @@ SNMP-community, паролі SSH і Telnet живуть в `inv.credentials`, diff (`scrub_patterns`) і що замаскувати перед записом у Git (`redact_patterns`). -Вбудовано **148 профілів на 67 вендорів**, імпортованих із -[NOC Project](https://getnoc.com) — Cisco, Huawei, Juniper, MikroTik, -Eltex, D-Link, HP, Brocade, Extreme, Alcatel, Allied Telesis, Qtech, -ZTE, BDCOM та інші. Інструмент імпорту й межі його застосовності — -`db/import/README.md`. +Вбудовано **147 платформ на 67 вендорів** — Cisco, Huawei, Juniper, +MikroTik, Eltex, D-Link, HP, Brocade, Extreme, Alcatel, Allied Telesis, +Qtech, ZTE, BDCOM та інші. -Команди взято з NOC. Промпти й вимкнення пейджера — ні: у дампі -профілів NOC вони не містились, тому проставлені за родиною вендора з -типових значень і потребують перевірки на живому залізі. +Джерело істини — `db/profiles/catalog.json`; міграція з нього +породжується збіркою. Додати платформу означає відредагувати каталог, +а не писати SQL. Подробиці — `db/profiles/README.md`. + +Промпти й команди вимкнення пейджера задані за родиною CLI (`cisco`, +`huawei`, `juniper`, `mikrotik`, `eltex`, …) і перевіряються на живому +залізі: одна родина покриває десятки платформ, і дрібні відхилення +трапляються. Команди збору натомість специфічні для платформи. + +Тенант може завести власний профіль (`ncm.profiles` із заповненим +`tenant_id`) — вбудовані при цьому лишаються недоторканими. **Виконувати ці профілі поки нікому.** Агентського модуля `ncm` (SSH/Telnet) ще немає — це Етап 7. Профілі лежать готовими даними, і