SensusAgent/app/docs/collectors.md

15 lines
763 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### Коллекторы
Расположение бинарников: `bin/agent/collectors/`
Добавление собственного коллектора на Go:
1. Создайте каталог `src/collectors/<name>/` с `main.go`, печатающим JSON в stdout.
2. Сборка:
- `make collectors` — соберёт под текущую платформу в `bin/agent/collectors/<name>`
- `make collectors-linux|collectors-darwin|collectors-windows` — кросс-сборка
3. Добавьте в `bin/agent/config.yaml` блок с `type: exec` и `exec: ./bin/agent/collectors/<name>`.
Требования к выводу: корректный JSON на stdout. В случае ошибки — пустой JSON `{}`.