> For the complete documentation index, see [llms.txt](https://newmishka.gitbook.io/newmishka-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://newmishka.gitbook.io/newmishka-docs/diagnostika/avtomatizaciya-i-sravnenie-arm.md).

# Автоматизация и сравнение АРМ

## Exit codes

| Код  | Значение                                                                     |
| ---- | ---------------------------------------------------------------------------- |
| `0`  | норма, проверка достаточно полная                                            |
| `1`  | предупреждения / неудовлетворительное состояние; для compare найдены отличия |
| `2`  | критическое состояние                                                        |
| `3`  | состояние нормальное, но проверка неполная                                   |
| `64` | ошибка CLI                                                                   |

## Machine-readable диагностика сервисов

В стандартном JSON (schema v1) для SSSD и CUPS объект `diagnostics` дополнен полями:

* `sssd_result` / `cups_result` — результат systemd;
* `sssd_error_count` / `cups_error_count` — число уникальных warning/error текущей загрузки;
* `sssd_likely_cause` / `cups_likely_cause` — обезличенная категория вероятной причины.

`*_likely_cause` не содержит сырых строк journal и предназначен как направление для следующей проверки, а не как окончательный диагноз.

Пример:

```bash
sudo arm_info --json --privacy | jq '.diagnostics | {
  sssd_result,
  sssd_error_count,
  sssd_likely_cause,
  cups_result,
  cups_error_count,
  cups_likely_cause
}'
```

Для автоматизации следует использовать эти поля вместе с `recommendations[]`, а не разбирать текстовый вывод.

## Сравнение исправного и проблемного АРМ

На обоих компьютерах создайте обезличенные JSON:

```bash
sudo arm_info --corp --privacy --json --save -o arm-a.json
sudo arm_info --corp --privacy --json --save -o arm-b.json
```

Затем:

```bash
arm_info --compare arm-a.json arm-b.json
```

`--compare` возвращает `0`, если сравниваемые поля совпадают, и `1`, если найдены отличия. Требуется `python3`.

## CI и проверки проекта

Проект использует `make version`, `make check` и `make test`. CI проверяет Bash syntax, ShellCheck уровня error, CLI/JSON/privacy, корпоративные профили, команды рекомендаций, разделы отчёта, compatibility syntax, installer smoke, документационный contract и RPM build smoke test.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://newmishka.gitbook.io/newmishka-docs/diagnostika/avtomatizaciya-i-sravnenie-arm.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
