Export all Hosts as CSV
The Syncer can return the hosts visible in the admin list as a single CSV file. The host list page has an Export CSV button next to the saved-search bar; the same download is also reachable directly via the URL:
https://<your-syncer>/admin/host/csv
The export honours the same filters and search expression as the host list, so what you see in the table is what ends up in the file. To export every host, open the list with no filters and search box empty.
The response is a download named hosts_export_<YYYYMMDD_HHMMSS>.csv.
Permissions
The endpoint is gated by the normal admin login and requires the host right
on the current user. Unauthenticated requests get a 401 Unauthorized.
What is Exported
- All hosts where
is_objectis notTrue(templates are excluded) - Sorted alphabetically by hostname
- One row per host, one column per field
Fixed Columns
| Column | Description |
|---|---|
hostname |
Host name as stored in the Syncer. |
object_type |
Object type of the host. |
available |
True/False — whether the host is currently marked as available. |
source_account_name |
Name of the account the host was last imported from. |
folder |
Resolved target folder (e.g. for Checkmk). |
last_import_seen |
Timestamp the host was last seen by an import run (YYYY-MM-DD HH:MM:SS). |
last_import_sync |
Timestamp of the last successful sync. |
no_autodelete |
True if the host is protected from automatic cleanup. |
label_<name> |
One column per label name listed in export_labels_list. |
inventory_<name> |
One column per inventory field listed in export_inventory_list. |
Configurable Columns
Which labels and inventory fields end up in the CSV is controlled in the global Syncer configuration, not via a query parameter:
export_labels_list— list of label keys; each one becomes a column prefixed withlabel_.export_inventory_list— list of inventory keys; each one becomes a column prefixed withinventory_.
Both settings live in the Syncer Config (Local Config Variables). Hosts that don't have a value for a configured label or inventory key get an empty cell.
Format
- Separator:
,(standard CSV) - Quoting: Python
csv.writerdefault (minimal) - Encoding: UTF-8
- First row: header
See also
- Hosts, Labels and Inventory — where
export_labels_listandexport_inventory_listare described. - CSV Basics — CLI-driven CSV import (the opposite direction).