Add "Copy hosts (JSON)" and "Copy hosts (TSV)" buttons for host list views
Adds two buttons to the view.py menu bar that copy hostname (FQDN) and IP for every host on the page to the clipboard, as JSON or as tab-separated lines. Works on views grouped by folder across multiple tables as well as single-table views, and correctly handles views that render 2 hosts per physical row as side-by-side column pairs.
This commit is contained in:
parent
f91470d103
commit
b0252672fa
3 changed files with 170 additions and 44 deletions
|
|
@ -33,6 +33,7 @@ A [Tampermonkey](https://www.tampermonkey.net/) userscript that enhances the Che
|
|||
| **Extra Column Toggle** | Adds an ON/OFF button to the menu bar to show/hide the Extra column; the choice is remembered across reloads | `addExtraColumnToggle` |
|
||||
| **Copy Host List (JSON)** | Adds a button to the menu bar that copies hostname, alias, IPv4 address and monitored site for every host in the list to the clipboard as JSON | `addHostListCopyButton` |
|
||||
| **Service Export to Markdown** | On any view.py services table (Host + Display name/Service columns), adds a button that exports a Markdown table with whichever of Site/Host/IP/Display name/Summary/Details are present, to the clipboard and as a downloaded `.md` file | `addServiceExportButton` |
|
||||
| **Copy Hosts (JSON/TSV)** | Adds two buttons to the menu bar on any view.py host list that copy hostname (FQDN) and IP for every host on the page to the clipboard, as JSON or as tab-separated lines | `addHostExportButtons` |
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -176,6 +177,13 @@ On any monitoring view showing a services table — detected structurally by a *
|
|||
|
||||
Applies to: any `view.py` page with a services table (with or without sidebar).
|
||||
|
||||
---
|
||||
|
||||
### Copy Hosts (JSON/TSV)
|
||||
Adds **"Copy hosts (JSON)"** and **"Copy hosts (TSV)"** buttons to the menu bar on any monitoring view listing hosts (e.g. "Host search"), whether results are grouped by folder across several tables or shown as a single table. Clicking one copies hostname (FQDN) and IP for every host currently listed to the clipboard — deduplicated — either as a JSON array or as tab-separated `FQDN` / `IP` lines (with a header row) ready to paste into a spreadsheet.
|
||||
|
||||
Applies to: any `view.py` page listing hosts (with or without sidebar).
|
||||
|
||||
## How it works
|
||||
|
||||
The script injects enhancements at page load and re-applies them on SPA navigation (Checkmk reloads content inside an `<iframe>` without a full page reload). Each feature is independent — a feature that does not apply to the current page does nothing and stops polling.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue