zabbix-cli-uio 3.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zabbix_cli_uio-3.1.1/.github/workflows/build.yml +122 -0
- zabbix_cli_uio-3.1.1/.github/workflows/docs.yml +38 -0
- zabbix_cli_uio-3.1.1/.github/workflows/test.yml +37 -0
- zabbix_cli_uio-3.1.1/.gitignore +30 -0
- zabbix_cli_uio-3.1.1/.pre-commit-config.yaml +28 -0
- zabbix_cli_uio-3.1.1/AUTHORS +32 -0
- zabbix_cli_uio-3.1.1/CHANGELOG +271 -0
- zabbix_cli_uio-3.1.1/LICENSE +674 -0
- zabbix_cli_uio-3.1.1/PKG-INFO +404 -0
- zabbix_cli_uio-3.1.1/README.md +355 -0
- zabbix_cli_uio-3.1.1/TODO +275 -0
- zabbix_cli_uio-3.1.1/bin/zabbix-cli +23 -0
- zabbix_cli_uio-3.1.1/bin/zabbix-cli-bulk-execution +23 -0
- zabbix_cli_uio-3.1.1/bin/zabbix-cli-init +23 -0
- zabbix_cli_uio-3.1.1/docs/.includes/config-locations.md +17 -0
- zabbix_cli_uio-3.1.1/docs/.includes/pipx-multiple.md +17 -0
- zabbix_cli_uio-3.1.1/docs/.includes/quick-install.md +54 -0
- zabbix_cli_uio-3.1.1/docs/.includes/upgrade.md +17 -0
- zabbix_cli_uio-3.1.1/docs/changelog.md +8 -0
- zabbix_cli_uio-3.1.1/docs/guide/authentication.md +110 -0
- zabbix_cli_uio-3.1.1/docs/guide/configuration.md +300 -0
- zabbix_cli_uio-3.1.1/docs/guide/installation.md +15 -0
- zabbix_cli_uio-3.1.1/docs/guide/introduction.md +5 -0
- zabbix_cli_uio-3.1.1/docs/guide/migration.md +199 -0
- zabbix_cli_uio-3.1.1/docs/guide/usage.md +61 -0
- zabbix_cli_uio-3.1.1/docs/index.md +9 -0
- zabbix_cli_uio-3.1.1/docs/plugins/external-plugins.md +141 -0
- zabbix_cli_uio-3.1.1/docs/plugins/guide.md +531 -0
- zabbix_cli_uio-3.1.1/docs/plugins/index.md +26 -0
- zabbix_cli_uio-3.1.1/docs/plugins/local-plugins.md +36 -0
- zabbix_cli_uio-3.1.1/docs/scripts/__init__.py +0 -0
- zabbix_cli_uio-3.1.1/docs/scripts/common.py +19 -0
- zabbix_cli_uio-3.1.1/docs/scripts/gen_cli_data.py +76 -0
- zabbix_cli_uio-3.1.1/docs/scripts/gen_cli_options.py +78 -0
- zabbix_cli_uio-3.1.1/docs/scripts/gen_command_list.py +47 -0
- zabbix_cli_uio-3.1.1/docs/scripts/gen_commands.py +85 -0
- zabbix_cli_uio-3.1.1/docs/scripts/gen_formats.py +22 -0
- zabbix_cli_uio-3.1.1/docs/scripts/gen_ref_pages.py +27 -0
- zabbix_cli_uio-3.1.1/docs/scripts/run.py +24 -0
- zabbix_cli_uio-3.1.1/docs/scripts/utils/__init__.py +0 -0
- zabbix_cli_uio-3.1.1/docs/scripts/utils/commands.py +341 -0
- zabbix_cli_uio-3.1.1/docs/scripts/utils/markup.py +155 -0
- zabbix_cli_uio-3.1.1/docs/static/img/plugins/console01.png +0 -0
- zabbix_cli_uio-3.1.1/docs/static/img/plugins/help_cat.png +0 -0
- zabbix_cli_uio-3.1.1/docs/static/img/plugins/help_command_empty.png +0 -0
- zabbix_cli_uio-3.1.1/docs/static/img/plugins/help_empty.png +0 -0
- zabbix_cli_uio-3.1.1/docs/static/img/plugins/render_header.png +0 -0
- zabbix_cli_uio-3.1.1/docs/static/img/plugins/render_list.png +0 -0
- zabbix_cli_uio-3.1.1/docs/static/img/plugins/render_table.png +0 -0
- zabbix_cli_uio-3.1.1/docs/static/img/plugins/speedscope.png +0 -0
- zabbix_cli_uio-3.1.1/docs/templates/category.md.j2 +108 -0
- zabbix_cli_uio-3.1.1/docs/templates/command_list.md.j2 +26 -0
- zabbix_cli_uio-3.1.1/mkdocs.yml +113 -0
- zabbix_cli_uio-3.1.1/pyproject.toml +155 -0
- zabbix_cli_uio-3.1.1/resources/help.png +0 -0
- zabbix_cli_uio-3.1.1/resources/host-inventory.png +0 -0
- zabbix_cli_uio-3.1.1/resources/hosts.png +0 -0
- zabbix_cli_uio-3.1.1/resources/open-autocomplete.png +0 -0
- zabbix_cli_uio-3.1.1/resources/proxies.png +0 -0
- zabbix_cli_uio-3.1.1/tests/__init__.py +0 -0
- zabbix_cli_uio-3.1.1/tests/conftest.py +81 -0
- zabbix_cli_uio-3.1.1/tests/data/zabbix-cli.conf +141 -0
- zabbix_cli_uio-3.1.1/tests/data/zabbix-cli.toml +30 -0
- zabbix_cli_uio-3.1.1/tests/pyzabbix/__init__.py +0 -0
- zabbix_cli_uio-3.1.1/tests/pyzabbix/test_client.py +72 -0
- zabbix_cli_uio-3.1.1/tests/pyzabbix/test_enums.py +124 -0
- zabbix_cli_uio-3.1.1/tests/pyzabbix/test_types.py +115 -0
- zabbix_cli_uio-3.1.1/tests/test_app.py +37 -0
- zabbix_cli_uio-3.1.1/tests/test_bulk.py +196 -0
- zabbix_cli_uio-3.1.1/tests/test_compat.py +90 -0
- zabbix_cli_uio-3.1.1/tests/test_config.py +247 -0
- zabbix_cli_uio-3.1.1/tests/test_console.py +232 -0
- zabbix_cli_uio-3.1.1/tests/test_docs/__init__.py +0 -0
- zabbix_cli_uio-3.1.1/tests/test_docs/test_markup.py +236 -0
- zabbix_cli_uio-3.1.1/tests/test_exceptions.py +60 -0
- zabbix_cli_uio-3.1.1/tests/test_logging.py +76 -0
- zabbix_cli_uio-3.1.1/tests/test_models.py +113 -0
- zabbix_cli_uio-3.1.1/tests/test_prompts.py +64 -0
- zabbix_cli_uio-3.1.1/tests/test_style.py +14 -0
- zabbix_cli_uio-3.1.1/tests/test_utils.py +172 -0
- zabbix_cli_uio-3.1.1/uv.lock +881 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/__about__.py +5 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/__init__.py +5 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/__main__.py +6 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/_patches/__init__.py +10 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/_patches/click_repl.py +149 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/_patches/common.py +80 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/_patches/typer.py +317 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/_types.py +12 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/_v2_compat.py +102 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/app/__init__.py +32 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/app/app.py +232 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/app/plugins.py +180 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/auth.py +366 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/bulk.py +226 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/cache.py +86 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/__init__.py +13 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/cli.py +298 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/common/__init__.py +0 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/common/args.py +24 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/export.py +688 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/host.py +846 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/hostgroup.py +494 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/item.py +76 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/macro.py +258 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/maintenance.py +238 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/problem.py +284 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/proxy.py +658 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/results/__init__.py +11 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/results/cli.py +149 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/results/export.py +53 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/results/host.py +59 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/results/hostgroup.py +177 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/results/item.py +122 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/results/macro.py +115 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/results/maintenance.py +105 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/results/problem.py +20 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/results/proxy.py +184 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/results/template.py +123 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/results/templategroup.py +110 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/results/user.py +236 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/template.py +609 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/templategroup.py +377 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/commands/user.py +861 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/config/__init__.py +0 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/config/__main__.py +9 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/config/constants.py +40 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/config/model.py +524 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/config/run.py +30 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/config/utils.py +128 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/dirs.py +80 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/exceptions.py +308 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/logs.py +171 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/main.py +256 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/models.py +302 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/output/__init__.py +1 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/output/console.py +201 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/output/formatting/__init__.py +1 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/output/formatting/bytes.py +11 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/output/formatting/constants.py +5 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/output/formatting/dates.py +38 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/output/formatting/grammar.py +51 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/output/formatting/path.py +15 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/output/prompts.py +385 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/output/render.py +155 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/output/style.py +207 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/py.typed +0 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/pyzabbix/__init__.py +3 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/pyzabbix/client.py +2509 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/pyzabbix/compat.py +134 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/pyzabbix/enums.py +527 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/pyzabbix/types.py +1285 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/pyzabbix/utils.py +36 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/scripts/__init__.py +1 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/scripts/bulk_execution.py +60 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/scripts/init.py +65 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/state.py +260 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/table.py +29 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/utils/__init__.py +3 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/utils/args.py +164 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/utils/commands.py +47 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/utils/fs.py +90 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/utils/rich.py +35 -0
- zabbix_cli_uio-3.1.1/zabbix_cli/utils/utils.py +330 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
name: build zabbix-cli
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- '[0-9]+.[0-9]+.[0-9]+**'
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: build-zabbix-cli-${{ github.head_ref }}
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build_pypi:
|
|
13
|
+
name: Build wheels and source distribution
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: '3.12'
|
|
21
|
+
|
|
22
|
+
- name: Install uv
|
|
23
|
+
uses: astral-sh/setup-uv@v2
|
|
24
|
+
|
|
25
|
+
- name: Install build dependencies
|
|
26
|
+
run: uv sync --all-extras --dev
|
|
27
|
+
|
|
28
|
+
- name: Build source distribution
|
|
29
|
+
run: uv run python -m build
|
|
30
|
+
|
|
31
|
+
- uses: actions/upload-artifact@v4
|
|
32
|
+
with:
|
|
33
|
+
name: pypi_artifacts
|
|
34
|
+
path: dist/*
|
|
35
|
+
if-no-files-found: error
|
|
36
|
+
|
|
37
|
+
build_pyinstaller:
|
|
38
|
+
name: Build pyinstaller binary
|
|
39
|
+
strategy:
|
|
40
|
+
matrix:
|
|
41
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
42
|
+
python-version:
|
|
43
|
+
- '3.12'
|
|
44
|
+
include:
|
|
45
|
+
- os: ubuntu-latest
|
|
46
|
+
container: centos:8
|
|
47
|
+
runs-on: ${{ matrix.os }}
|
|
48
|
+
container: ${{ matrix.container }}
|
|
49
|
+
|
|
50
|
+
steps:
|
|
51
|
+
- uses: actions/checkout@v4
|
|
52
|
+
|
|
53
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
54
|
+
uses: actions/setup-python@v5
|
|
55
|
+
with:
|
|
56
|
+
python-version: ${{ matrix.python-version }}
|
|
57
|
+
|
|
58
|
+
- name: Install uv
|
|
59
|
+
uses: astral-sh/setup-uv@v2
|
|
60
|
+
|
|
61
|
+
- name: Install build dependencies
|
|
62
|
+
run: uv sync --all-extras --dev
|
|
63
|
+
|
|
64
|
+
- name: Build binary with PyInstaller
|
|
65
|
+
run: uv run pyinstaller --onefile zabbix_cli/main.py --name zabbix-cli
|
|
66
|
+
|
|
67
|
+
- name: Rename binary
|
|
68
|
+
run: |
|
|
69
|
+
mv dist/zabbix-cli${{ contains(matrix.os, 'windows') && '.exe' || '' }} dist/zabbix-cli-${{ matrix.os }}-${{ matrix.python-version }}${{ contains(matrix.os, 'windows') && '.exe' || '' }}
|
|
70
|
+
|
|
71
|
+
- uses: actions/upload-artifact@v4
|
|
72
|
+
with:
|
|
73
|
+
name: zabbix-cli-${{ matrix.os }}-${{ matrix.python-version }}${{ contains(matrix.os, 'windows') && '.exe' || '' }}
|
|
74
|
+
path: dist/zabbix-cli-${{ matrix.os }}-${{ matrix.python-version }}${{ contains(matrix.os, 'windows') && '.exe' || '' }}
|
|
75
|
+
if-no-files-found: error
|
|
76
|
+
|
|
77
|
+
publish_pypi:
|
|
78
|
+
name: Publish PyPI release
|
|
79
|
+
needs:
|
|
80
|
+
- build_pypi
|
|
81
|
+
runs-on: ubuntu-latest
|
|
82
|
+
permissions:
|
|
83
|
+
id-token: write
|
|
84
|
+
steps:
|
|
85
|
+
- uses: actions/download-artifact@v4
|
|
86
|
+
with:
|
|
87
|
+
name: pypi_artifacts
|
|
88
|
+
path: dist
|
|
89
|
+
|
|
90
|
+
- name: Push build artifacts to PyPI
|
|
91
|
+
uses: pypa/gh-action-pypi-publish@v1.8.14
|
|
92
|
+
|
|
93
|
+
publish_github:
|
|
94
|
+
name: Publish GitHub release
|
|
95
|
+
needs:
|
|
96
|
+
- build_pypi
|
|
97
|
+
- build_pyinstaller
|
|
98
|
+
runs-on: ubuntu-latest
|
|
99
|
+
|
|
100
|
+
steps:
|
|
101
|
+
- name: Download PyInstaller binaries
|
|
102
|
+
uses: actions/download-artifact@v4
|
|
103
|
+
with:
|
|
104
|
+
pattern: zabbix-cli-*
|
|
105
|
+
path: dist
|
|
106
|
+
merge-multiple: true
|
|
107
|
+
|
|
108
|
+
- name: Download wheel and source distributions
|
|
109
|
+
uses: actions/download-artifact@v4
|
|
110
|
+
with:
|
|
111
|
+
pattern: pypi_artifacts
|
|
112
|
+
path: dist
|
|
113
|
+
merge-multiple: true
|
|
114
|
+
|
|
115
|
+
- name: Create GitHub release
|
|
116
|
+
uses: softprops/action-gh-release@v2
|
|
117
|
+
with:
|
|
118
|
+
files: dist/*
|
|
119
|
+
body: |
|
|
120
|
+
Release notes for ${{ github.ref_name }}
|
|
121
|
+
draft: false
|
|
122
|
+
prerelease: false
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: build-docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
- docs-dev
|
|
8
|
+
paths:
|
|
9
|
+
- "docs/**"
|
|
10
|
+
- "mkdocs.yml"
|
|
11
|
+
- ".github/workflows/docs.yml"
|
|
12
|
+
- "pyproject.toml"
|
|
13
|
+
- "zabbix_cli/**"
|
|
14
|
+
|
|
15
|
+
concurrency:
|
|
16
|
+
group: docs-deploy
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
build:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.12"
|
|
29
|
+
|
|
30
|
+
- name: Install uv
|
|
31
|
+
uses: astral-sh/setup-uv@v2
|
|
32
|
+
|
|
33
|
+
- name: Install hatch
|
|
34
|
+
run: |
|
|
35
|
+
uv pip install --system hatch
|
|
36
|
+
|
|
37
|
+
- name: Build documentation and publish
|
|
38
|
+
run: hatch run docs:mkdocs gh-deploy --force
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
on:
|
|
2
|
+
push:
|
|
3
|
+
paths-ignore:
|
|
4
|
+
- 'docs/**'
|
|
5
|
+
- 'debian/**'
|
|
6
|
+
- 'rpm/**'
|
|
7
|
+
- 'README.md'
|
|
8
|
+
|
|
9
|
+
pull_request:
|
|
10
|
+
|
|
11
|
+
name: CI
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
name: Test
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
python-version:
|
|
19
|
+
- '3.8'
|
|
20
|
+
- '3.9'
|
|
21
|
+
- '3.10'
|
|
22
|
+
- '3.11'
|
|
23
|
+
- '3.12'
|
|
24
|
+
steps:
|
|
25
|
+
- name: Checkout
|
|
26
|
+
uses: actions/checkout@v4
|
|
27
|
+
- name: Install Python
|
|
28
|
+
uses: actions/setup-python@v5
|
|
29
|
+
with:
|
|
30
|
+
python-version: ${{ matrix.python-version }}
|
|
31
|
+
- name: Install uv
|
|
32
|
+
uses: astral-sh/setup-uv@v2
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: |
|
|
35
|
+
uv sync --all-extras --dev
|
|
36
|
+
- name: Test
|
|
37
|
+
run: uv run pytest -vv tests
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
*.pyc
|
|
2
|
+
|
|
3
|
+
# Build files
|
|
4
|
+
dist/
|
|
5
|
+
build/
|
|
6
|
+
*.egg-info/
|
|
7
|
+
|
|
8
|
+
.coverage
|
|
9
|
+
|
|
10
|
+
.venv/
|
|
11
|
+
venv/
|
|
12
|
+
|
|
13
|
+
.dccache
|
|
14
|
+
.vscode/launch.json
|
|
15
|
+
my_tests/
|
|
16
|
+
|
|
17
|
+
# Hatch Pyapp
|
|
18
|
+
pyapp
|
|
19
|
+
|
|
20
|
+
# Dev commands and directories
|
|
21
|
+
zabbix_cli/commands/_dev.py
|
|
22
|
+
dev/
|
|
23
|
+
|
|
24
|
+
# Auto-generated docs files
|
|
25
|
+
docs/guide/commands/
|
|
26
|
+
docs/data
|
|
27
|
+
site/
|
|
28
|
+
|
|
29
|
+
# Pyinstaller
|
|
30
|
+
*.spec
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# See https://pre-commit.com for more information
|
|
2
|
+
# See https://pre-commit.com/hooks.html for more hooks
|
|
3
|
+
repos:
|
|
4
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
+
rev: v4.6.0
|
|
6
|
+
hooks:
|
|
7
|
+
- id: trailing-whitespace
|
|
8
|
+
- id: end-of-file-fixer
|
|
9
|
+
- id: check-yaml
|
|
10
|
+
- id: check-added-large-files
|
|
11
|
+
- repo: https://github.com/asottile/pyupgrade
|
|
12
|
+
rev: v3.17.0
|
|
13
|
+
hooks:
|
|
14
|
+
- id: pyupgrade
|
|
15
|
+
args: [--py37-plus, --keep-runtime-typing]
|
|
16
|
+
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
|
17
|
+
rev: "v0.6.2"
|
|
18
|
+
hooks:
|
|
19
|
+
# Run the linter.
|
|
20
|
+
- id: ruff
|
|
21
|
+
args: [--fix]
|
|
22
|
+
# Run the formatter.
|
|
23
|
+
- id: ruff-format
|
|
24
|
+
- repo: https://github.com/RobertCraigie/pyright-python
|
|
25
|
+
rev: v1.1.377
|
|
26
|
+
hooks:
|
|
27
|
+
- id: pyright
|
|
28
|
+
exclude: ^(tests|scripts|docs)/
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Based on `git shortlog --all -es` with duplicates removed
|
|
2
|
+
|
|
3
|
+
Alexandru Tică
|
|
4
|
+
Andreas Dobloug
|
|
5
|
+
Boris Manojlovic
|
|
6
|
+
Carl Morten Boger
|
|
7
|
+
Emanuele Borin
|
|
8
|
+
Fabian Arrotin
|
|
9
|
+
Fabian Stelzer
|
|
10
|
+
Florian Tham
|
|
11
|
+
Fredrik Larsen
|
|
12
|
+
Ganesh Hegde
|
|
13
|
+
Herdir
|
|
14
|
+
Jarle Bjørgeengen
|
|
15
|
+
Jean-Baptiste Denis
|
|
16
|
+
Jelmer Vernooij
|
|
17
|
+
Kim Rioux-Paradis
|
|
18
|
+
Logan V
|
|
19
|
+
Marius Bakke
|
|
20
|
+
Mathieu Marleix
|
|
21
|
+
Michael Gindonis
|
|
22
|
+
Mustafa Ocak
|
|
23
|
+
Mélissa Bertin
|
|
24
|
+
Paal Braathen
|
|
25
|
+
Peder Hovdan Andresen
|
|
26
|
+
Peet Whittaker
|
|
27
|
+
Petter Reinholdtsen
|
|
28
|
+
Rafael Martinez Guerrero
|
|
29
|
+
Retyunskikh Dmitriy
|
|
30
|
+
Steve McDuff
|
|
31
|
+
Terje Kvernes
|
|
32
|
+
Volker Fröhlich
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
<!-- released start -->
|
|
9
|
+
|
|
10
|
+
<!-- ## [Unreleased] -->
|
|
11
|
+
|
|
12
|
+
## 3.1.1
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- Publish to PyPI.
|
|
17
|
+
|
|
18
|
+
## 3.1.0
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- Plugin support. See the [plugins documentation](https://unioslo.github.io/zabbix-cli/plugins/) for more information.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- `--config` now always creates the config file at the given location if it doesn't exist.
|
|
27
|
+
- `show_config` now shows the absolute path to the active configuration file.
|
|
28
|
+
|
|
29
|
+
## 3.0.3
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- `--limit` option for `show_*` commands to limit the number of results shown:
|
|
34
|
+
- `show_usermacro_host_list`
|
|
35
|
+
- `show_usermacro_template_list`
|
|
36
|
+
- `show_maintenance_periods`
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- `show_host_usermacros` rendering of `automatic` field.
|
|
41
|
+
- Now shows a human readable string instead of `0` or `1`.
|
|
42
|
+
- Example formatting.
|
|
43
|
+
- Hide defaults for required positional arguments.
|
|
44
|
+
- `show_dirs` and `init` no longer requires logging in to the Zabbix API or an existing configuration file.
|
|
45
|
+
- Log record format:
|
|
46
|
+
- No longer includes the process ID.
|
|
47
|
+
- Now includes filename, line number and function name.
|
|
48
|
+
- Rich markup is no longer included in log messages.
|
|
49
|
+
- Accessing the config when it is not loaded now uses the same sample config as `sample_config` instead of raising an exception.
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
|
|
53
|
+
- `show_usermacro_host_list` not showing all hosts with the given macro.
|
|
54
|
+
- `show_usermacro_template_list` not showing all templates with the given macro.
|
|
55
|
+
- Auth token file using username from config file instead of from prompt.
|
|
56
|
+
|
|
57
|
+
## 3.0.2
|
|
58
|
+
|
|
59
|
+
### Added
|
|
60
|
+
|
|
61
|
+
- `show_hosts`: `--hostgroup` option for filtering by host group names or IDs.
|
|
62
|
+
- `show_last_values`: ` Item ID filtering.
|
|
63
|
+
- `show_usergroup`: Group ID filtering.
|
|
64
|
+
- `show_usergroups`: Group name or ID filtering.
|
|
65
|
+
- `show_users`: `--sort` option for sorting results by a field.
|
|
66
|
+
- Status messages when fetching data from the Zabbix API in most `show_*` commands.
|
|
67
|
+
- `--limit` option for most `show_*` commands to limit the number of results shown.
|
|
68
|
+
- Environment variable `ZABBIX_API_TOKEN` for logging in with an API token.
|
|
69
|
+
|
|
70
|
+
### Fixed
|
|
71
|
+
|
|
72
|
+
- Markup errors when rendering Zabbix items with keys containing special characters.
|
|
73
|
+
- Environment variables not matching V2 names.
|
|
74
|
+
- Before: `ZABBIX_CLI_USERNAME`, `ZABBIX_CLI_PASSWORD`
|
|
75
|
+
- After: `ZABBIX_USERNAME`, `ZABBIX_PASSWORD`
|
|
76
|
+
|
|
77
|
+
## 3.0.1
|
|
78
|
+
|
|
79
|
+
### Changed
|
|
80
|
+
|
|
81
|
+
- `migrate_config` no longer requires logging in to the Zabbix API.
|
|
82
|
+
|
|
83
|
+
### Fixed
|
|
84
|
+
|
|
85
|
+
- `migrate_config` not migrating username to the new `api.username` field in the resulting TOML configuration file.
|
|
86
|
+
- `migrate_config` using `legacy_json_format = true` in the resulting TOML configuration file by default.
|
|
87
|
+
- Can force the old JSON format with the new `--legacy-json-format` flag.
|
|
88
|
+
|
|
89
|
+
## 3.0.0
|
|
90
|
+
|
|
91
|
+
### Added
|
|
92
|
+
|
|
93
|
+
- New CLI powered by `typer` and `click-repl`
|
|
94
|
+
- Shell autocompletion
|
|
95
|
+
- TOML configuration file support
|
|
96
|
+
- Old configuration format is deprecated.
|
|
97
|
+
- Usage examples for most commands.
|
|
98
|
+
- **New configuration options:**
|
|
99
|
+
- `app.default_format`: Sets the default CLI output format. Defaults to `table`.
|
|
100
|
+
- `app.legacy_json_format`: Enables the old JSON output format. Defaults to `false`.
|
|
101
|
+
- **New commands:**
|
|
102
|
+
- `add_proxy_to_group`: Add a proxy to a proxy group.
|
|
103
|
+
- `create_templategroup`: Create a template group.
|
|
104
|
+
- `extend_hostgroup`: Add all hosts from a host group to other host group(s) without removing them from the original group.
|
|
105
|
+
- `extend_templategroup`: Add all templates from a group to other group(s) without removing them from the original group.
|
|
106
|
+
- `init`: Initialize the CLI configuration file.
|
|
107
|
+
- `link_template_to_template`: Link template(s) to template(s).
|
|
108
|
+
- `move_hosts`: Move all hosts from one host group to another.
|
|
109
|
+
- `move_templates`: Move all templates from one group to another.
|
|
110
|
+
- `open`: Open a CLI directory in the system's file manager.
|
|
111
|
+
- `remove_hostgroup`: Delete a host group.
|
|
112
|
+
- `remove_host_interface`: Delete a host interface.
|
|
113
|
+
- `remove_proxy_from_group`: Remove a proxy from a proxy group.
|
|
114
|
+
- `remove_templategroup`: Delete a template group.
|
|
115
|
+
- `show_dirs`: Show directories used by the CLI.
|
|
116
|
+
- `show_host_interfaces`: Show interfaces for a host.
|
|
117
|
+
- `show_media_types`: Show media types.
|
|
118
|
+
- `show_proxies`: Show proxies.
|
|
119
|
+
- `show_proxy_groups`: Show proxy groups.
|
|
120
|
+
- `show_proxy_group_hosts`: Show hosts in a proxy group.
|
|
121
|
+
- `show_templategroup`: Show a single template group.
|
|
122
|
+
- `show_templategroups`: Show all template groups.
|
|
123
|
+
- `show_user`: Show details for a single user.
|
|
124
|
+
- `unlink_template_from_template`: Unlink template(s) from template(s).
|
|
125
|
+
- `update_host_interface`: Update a host interface.
|
|
126
|
+
- `update_user`: Update a user.
|
|
127
|
+
- `update_hostgroup_proxy`: Assign a proxy to all hosts in one or more host groups.
|
|
128
|
+
- `update_hostgroup_proxygroup`: Assign a proxy group to all hosts in one or more host groups.
|
|
129
|
+
- **New command options:**
|
|
130
|
+
- `add_host_to_hostgroup`:
|
|
131
|
+
- `--dryrun`: Preview changes without making them.
|
|
132
|
+
- `create_host`:
|
|
133
|
+
- `--name`: Host name
|
|
134
|
+
- Host name still defaults to host DNS name or IP address if not specified.
|
|
135
|
+
- `--description`: Host description
|
|
136
|
+
- `create_hostgroup`:
|
|
137
|
+
- `--rw-groups`: User groups to give RW permissions to the host group.
|
|
138
|
+
- `--ro-groups`: User groups to give RO permissions to the host group. Uses groups from config file if not specified.
|
|
139
|
+
- `--no-usergroup-permissions`: Do not set user group permissions. Defaults to `false`.
|
|
140
|
+
- `create_host_interface`:
|
|
141
|
+
- `--snmp...` TODO
|
|
142
|
+
- `import_configuration`:
|
|
143
|
+
- `--dryrun`: Preview files to import.
|
|
144
|
+
- `--delete-missing`: Delete objects not found in the import file(s).
|
|
145
|
+
- `link_template_to_host`:
|
|
146
|
+
- `--dryrun`: Preview changes without making them.
|
|
147
|
+
- `remove_host_from_hostgroup`:
|
|
148
|
+
- `--dryrun`: Preview changes without making them.
|
|
149
|
+
- `show_host`:
|
|
150
|
+
- `--monitored/--unmonitored`: Filter by monitored status
|
|
151
|
+
- `--maintenance/--no-maintenance`: Filter by maintenance status
|
|
152
|
+
- `--active [available | unavailable | unknown ]`: Filter by active interface availability
|
|
153
|
+
- Old positional filter argument syntax is deprecated.
|
|
154
|
+
- `show_hosts`:
|
|
155
|
+
- `--limit`: Limit number of hosts to show.
|
|
156
|
+
- As well as the new `show_host` options.
|
|
157
|
+
- `show_hostgroup`:
|
|
158
|
+
- `--hosts/--no-hosts`: Show hosts in the group
|
|
159
|
+
- `show_hostgroups`:
|
|
160
|
+
- `--hosts/--no-hosts`: Show hosts in the group
|
|
161
|
+
- `show_trigger_events`
|
|
162
|
+
- `--trigger-id`: Trigger ID(s) to get events for.
|
|
163
|
+
- Corresponds to old positional argument 1.
|
|
164
|
+
- `--host`: Host(s) to get events for.
|
|
165
|
+
- `--hostgroup`: Host group(s) to get events for.
|
|
166
|
+
- `--limit`: Limit number of events to show
|
|
167
|
+
- Corresponds to old positional argument 2.
|
|
168
|
+
- Defaults to 10 (was 1).
|
|
169
|
+
- `show_usergroup`:
|
|
170
|
+
- `--sort`: Sort results by a field.
|
|
171
|
+
- `show_usergroups`:
|
|
172
|
+
- `--sort`: Sort results by a field.
|
|
173
|
+
- `show_usergroup_permissions`:
|
|
174
|
+
- `--sort`: Sort results by a field.
|
|
175
|
+
- `unlink_template_from_host`:
|
|
176
|
+
- `--dryrun`: Preview changes.
|
|
177
|
+
- `update_host_proxy`:
|
|
178
|
+
- `--dryrun`: Preview changes.
|
|
179
|
+
- **New command arguments:**
|
|
180
|
+
- `show_templates`:
|
|
181
|
+
- `template_names`: Template name(s) to filter by. Shows all templates by default. Supports wildcards.
|
|
182
|
+
- `show_hostgroup`:
|
|
183
|
+
- `name`: Host group name(s) to filter by. Shows all host groups by default. Supports wildcards.
|
|
184
|
+
|
|
185
|
+
### Changed
|
|
186
|
+
|
|
187
|
+
- Commands now take named options instead of positional arguments.
|
|
188
|
+
- Positional arguments are deprecated.
|
|
189
|
+
- JSON output is no longer always a dict with numeric string keys.
|
|
190
|
+
- See V3 migration guide for more information.
|
|
191
|
+
- The old format can be enabled with the new option `app.legacy_json_format` in the new TOML configuration file.
|
|
192
|
+
- When loading configuration from a legacy `.conf` file, the old format is assumed.
|
|
193
|
+
- **TOML configuration file option names:**
|
|
194
|
+
- Table [zabbix_api] → [api]
|
|
195
|
+
- `zabbix_api_url` → `url`
|
|
196
|
+
- `cert_verify` → `verify_ssl`
|
|
197
|
+
- Table [zabbix_config] → [app]
|
|
198
|
+
- `system_id` → `username`
|
|
199
|
+
- `default_directory_exports` → `export_directory`
|
|
200
|
+
- `default_export_format` → `export_format`
|
|
201
|
+
- `include_timestamp_export_filename` → `export_timestamps`
|
|
202
|
+
- `allow_insecure_authfile` → `allow_insecure_auth_file`
|
|
203
|
+
- `logging.logging` → `logging.enabled`
|
|
204
|
+
- The original names are deprecated and slated for removal in a future version.
|
|
205
|
+
- **Configuration file defaults:**
|
|
206
|
+
- `app.default_admin_usergroups` defaults to `[]` (empty list)
|
|
207
|
+
- `app.default_create_user_usergroups` defaults to `[]` (empty list)
|
|
208
|
+
- `app.export_timestamps` defaults to `false`
|
|
209
|
+
- Exports are automatically overwritten if the file already exists.
|
|
210
|
+
- `app.export_format` defaults to `json` (was `xml`)
|
|
211
|
+
- Application now creates a config file on launch if it doesn't exist.
|
|
212
|
+
- **Command changes:**
|
|
213
|
+
- `create_host_interface`
|
|
214
|
+
- Default port number is now determined by interface type.
|
|
215
|
+
- Agent: 10050
|
|
216
|
+
- SNMP: 161
|
|
217
|
+
- IPMI: 623
|
|
218
|
+
- JMX: 12345
|
|
219
|
+
- `define_host_monitoring_status`:
|
|
220
|
+
- Renamed to `monitor_host`.
|
|
221
|
+
- `link_template_to_hostgroup`:
|
|
222
|
+
- Renamed to `add_template_to_group`.
|
|
223
|
+
- `show_host_inventory`
|
|
224
|
+
- Now shows shows any inventory field that is set for the host in the table output.
|
|
225
|
+
- Includes _all_ inventory fields in JSON output.
|
|
226
|
+
- `show_hostgroup_permissions`:
|
|
227
|
+
- Shows permissions for all host groups by default.
|
|
228
|
+
- `show_proxies`:
|
|
229
|
+
- Now takes a `name_or_id` argument to filter by proxy name or ID. Comma-separated. Supports wildcards.
|
|
230
|
+
- `show_zabbixcli_config`:
|
|
231
|
+
- Renamed to `show_config`.
|
|
232
|
+
- `unlink_template_from_hostgroup`:
|
|
233
|
+
- Renamed to `remove_template_from_group`.
|
|
234
|
+
- No longer unlinks and clears templates from each other.
|
|
235
|
+
- This was a bug/misunderstanding of the Zabbix API in the old version.
|
|
236
|
+
- Use `unlink_template_from_template` to unlink and clear templates from each other.
|
|
237
|
+
- `update_host_proxy`
|
|
238
|
+
- Now supports setting proxy for multiple hosts at once using wildcards.
|
|
239
|
+
- Output format is changed.
|
|
240
|
+
- Now groups hosts by proxy prior to update.
|
|
241
|
+
|
|
242
|
+
### Deprecated
|
|
243
|
+
|
|
244
|
+
- `zabbix-cli.conf` format. Prefer the new TOML configuration file format.
|
|
245
|
+
- Config file options:
|
|
246
|
+
- `zabbix_config.system_id` → `api.username`
|
|
247
|
+
- **Commands:**
|
|
248
|
+
- `unlink_template_from_hostgroup`:
|
|
249
|
+
- Renamed to `remove_template_from_group`.
|
|
250
|
+
- `define_host_monitoring_status`:
|
|
251
|
+
- Renamed to `monitor_host`
|
|
252
|
+
- `show_zabbixcli_config`:
|
|
253
|
+
- Renamed to `show_config`
|
|
254
|
+
- `zabbix-cli-init` script.
|
|
255
|
+
- Replaced by `zabbix-cli init` command.
|
|
256
|
+
- `zabbix-cli-bulk-execution` script.
|
|
257
|
+
- Replaced by `zabbix-cli --file`.
|
|
258
|
+
|
|
259
|
+
### Removed
|
|
260
|
+
|
|
261
|
+
- Support for Zabbix <1.8 login using `user.authenticate`.
|
|
262
|
+
|
|
263
|
+
### Internal
|
|
264
|
+
|
|
265
|
+
- Use Hatch for building and publishing.
|
|
266
|
+
- Switch from setup.py to pyproject.toml.
|
|
267
|
+
- Add `pre-commit` hooks.
|
|
268
|
+
- Add `pytest` tests
|
|
269
|
+
- Use Ruff for linting and formatting.
|
|
270
|
+
- Use Pyright for static type checking.
|
|
271
|
+
- API code rewritten with Pydantic data models.
|