{"id":14235362,"url":"https://github.com/unioslo/zabbix-cli","last_synced_at":"2025-10-21T04:50:52.719Z","repository":{"id":21659992,"uuid":"24980870","full_name":"unioslo/zabbix-cli","owner":"unioslo","description":"Command-line interface for Zabbix","archived":false,"fork":false,"pushed_at":"2025-10-15T09:01:32.000Z","size":3619,"stargazers_count":227,"open_issues_count":37,"forks_count":102,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-10-16T00:19:11.429Z","etag":null,"topics":["python","zabbix","zabbix-api","zabbix-cli"],"latest_commit_sha":null,"homepage":"https://unioslo.github.io/zabbix-cli/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unioslo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-10-09T08:47:12.000Z","updated_at":"2025-10-15T09:01:18.000Z","dependencies_parsed_at":"2024-12-04T11:22:26.928Z","dependency_job_id":"319dc972-a9c7-490b-adbf-eb9e71d6f1e7","html_url":"https://github.com/unioslo/zabbix-cli","commit_stats":{"total_commits":407,"total_committers":35,"mean_commits":"11.628571428571428","dds":0.538083538083538,"last_synced_commit":"b34c9b15a830cd7c211bfc6c131680a9e17b138b"},"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"purl":"pkg:github/unioslo/zabbix-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unioslo%2Fzabbix-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unioslo%2Fzabbix-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unioslo%2Fzabbix-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unioslo%2Fzabbix-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unioslo","download_url":"https://codeload.github.com/unioslo/zabbix-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unioslo%2Fzabbix-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280207180,"owners_count":26290616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","zabbix","zabbix-api","zabbix-cli"],"created_at":"2024-08-20T21:01:48.981Z","updated_at":"2025-10-21T04:50:52.686Z","avatar_url":"https://github.com/unioslo.png","language":"Python","readme":"# Zabbix-cli\n\n[![PyPI](https://img.shields.io/pypi/v/zabbix-cli-uio)](https://pypi.org/project/zabbix-cli-uio/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/zabbix-cli-uio)](\u003chttps://pypi.org/project/zabbix-cli-uio/\u003e)\n[![PyPI - License](https://img.shields.io/pypi/l/zabbix-cli-uio)](\u003chttps://pypi.org/project/zabbix-cli-uio/\u003e)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/unioslo/zabbix-cli/test.yml?branch=master\u0026label=tests)\n\n\u003cp align=\"center\"\u003e\n  \u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003cimg width=\"100%\" src=\"https://github.com/unioslo/zabbix-cli/blob/master/resources/help.png?raw=true\"\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\n            \u003cimg width=\"100%\" src=\"https://github.com/unioslo/zabbix-cli/blob/master/resources/hosts.png?raw=true\"\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003cimg width=\"100%\" src=\"https://github.com/unioslo/zabbix-cli/blob/master/resources/host-inventory.png?raw=true\"\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\n            \u003cimg width=\"100%\" src=\"https://github.com/unioslo/zabbix-cli/blob/master/resources/proxies.png?raw=true\"\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/table\u003e\n\u003c/p\u003e\n\n**Zabbix-CLI v3 has been completely rewritten from the ground up. The old version can be found [here](https://github.com/unioslo/zabbix-cli/tree/2.3.2).**\n\n## About\n\nZabbix-cli is a command line interface for performing common administrative tasks tasks in [Zabbix monitoring system](https://www.zabbix.com/) via the [Zabbix API](https://www.zabbix.com/documentation/current/en/manual/api).\n\nThe zabbix-cli code is written in [Python](https://www.python.org/) and distributed under the GNU General Public License v3. It has been developed and tested by [University Center for Information Technology](https://www.usit.uio.no/) at [the University of Oslo, Norway](https://www.uio.no/).\n\nThe project home page is on [GitHub](https://github.com/unioslo/zabbix-cli). Please report any issues or improvements there.\n\nThe manual is available online at \u003chttps://unioslo.github.io/zabbix-cli/\u003e.\n\n## Install\n\n### From source\n\n\u003e [!NOTE]\n\u003e We are in the process of acquiring the name `zabbix-cli` on PyPI. Until then, installation must be done via the mirror package `zabbix-cli-uio`.\n\n#### [uv](https://docs.astral.sh/uv/getting-started/installation/)\n\n```bash\nuv tool install zabbix-cli-uio\n```\n\n#### [uvx](https://docs.astral.sh/uv/#tool-management)\n\n```bash\n\nuvx --from zabbix-cli-uio zabbix-cli\n```\n\n#### [pipx](https://pipx.pypa.io/stable/)\n\n```bash\npipx install zabbix-cli-uio\n```\n\n### Homebrew\n\nA homebrew package exists, but it is maintained by a third party. It can be installed with:\n\n```bash\nbrew install zabbix-cli\n```\n\n### Binary\n\nBinaries built with PyInstaller can be found on the [releases page](https://github.com/unioslo/zabbix-cli/releases). We build binaries for Linux (x86), macOS (ARM \u0026 x86) and Windows (x86) for each release.\n\n## Quick start\n\nRunning `zabbix-cli` for the first time will prompt for a Zabbix URL, username and password. The URL should be the URL of the Zabbix web server without the `/api_jsonrpc.php` path.\n\nRunning without arguments will start the REPL:\n\n```bash\nzabbix-cli\n```\n\n\u003cimg width=\"60%\" src=\"https://github.com/unioslo/zabbix-cli/blob/master/resources/open-autocomplete.png?raw=true\"\u003e\n\n## Usage\n\nZabbix-cli is a command line interface for Zabbix. It can be used in three ways:\n\n1. **Interactive mode**: Start the REPL by running `zabbix-cli`. This will start a shell where you can run multiple commands in a persistent session.\n2. **Single command**: Run a single command by running `zabbix-cli COMMAND`. This will run the command and print the output.\n3. **Batch mode**: Run multiple commands from a file by running `zabbix-cli -f FILE`. The file should contain one command per line.\n\nCommand reference can be found in the [online user guide](https://unioslo.github.io/zabbix-cli/commands/) or by running `zabbix-cli --help`.\n\n### Authentication\n\nBy default, the application will prompt for a username and password. Once authenticated, the application stores the session token in a file for future use.\n\nFor more information about the various authentication methods, see the [authentication guide](https://unioslo.github.io/zabbix-cli/guide/authentication/).\n\n### Configuration\n\nZabbix-cli needs a config file. It is created when the application is started for the first time. The config file can be created manually with the `init` command:\n\n```bash\nzabbix-cli init --zabbix-url https://zabbix.example.com/\n```\n\nFor more detailed information about the configuration file, see the [configuration guide](https://unioslo.github.io/zabbix-cli/guide/configuration/).\n\n### Formats\n\nZabbix-cli supports two output formats: table and JSON. The default format is table, but it can be changed with the `--format` parameter:\n\n```bash\n# Show hosts in table format (default)\nzabbix-cli show_hosts\n\n# Show hosts in JSON format\nzabbix-cli --format json show_hosts\n\n# Set format in REPL mode\n\u003e --format json show_hosts\n```\n\nThe default format can be configured with the `app.output.format` config option:\n\n```toml\n[app.output]\nformat = \"json\"\n```\n\n#### Table\n\n\u003cimg width=\"60%\" alt=\"format-table\" src=\"https://github.com/user-attachments/assets/207fa12b-39c6-45b9-9f0e-7f217c723461\"\u003e\n\nThe default rendering mode is a [Rich](https://github.com/Textualize/rich) table that adapts to the width of the terminal.\n\n#### JSON\n\n\u003cimg width=\"60%\" alt=\"format-json\" src=\"https://github.com/user-attachments/assets/680f507b-dc2a-41b2-87c4-c3a443d83979\"\u003e\n\nThe JSON output format is always in this format, where `ResultT` is the expected result type:\n\n```json\n{\n  \"message\": \"\",\n  \"errors\": [],\n  \"return_code\": \"Done\",\n  \"result\": ResultT\n}\n```\n\nThe type of the `result` field varies based on the command run. For `show_host` it is a single Host object, while for `show_hosts` it is an _array_ of Host objects.\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ccode\u003eshow_host foo.example.com*\u003c/code\u003e\u003c/summary\u003e\n\n```json\n{\n  \"message\": \"\",\n  \"errors\": [],\n  \"return_code\": \"Done\",\n  \"result\": {\n    \"hostid\": \"10648\",\n    \"host\": \"foo.example.com\",\n    \"description\": \"\",\n    \"groups\": [\n      {\n        \"groupid\": \"22\",\n        \"name\": \"All-hosts\",\n        \"hosts\": [],\n        \"flags\": 0,\n        \"internal\": null,\n        \"templates\": []\n      },\n      {\n        \"groupid\": \"46\",\n        \"name\": \"Source-foosource\",\n        \"hosts\": [],\n        \"flags\": 0,\n        \"internal\": null,\n        \"templates\": []\n      },\n      {\n        \"groupid\": \"47\",\n        \"name\": \"Hostgroup-bob-hosts\",\n        \"hosts\": [],\n        \"flags\": 0,\n        \"internal\": null,\n        \"templates\": []\n      },\n      {\n        \"groupid\": \"48\",\n        \"name\": \"Importance-X\",\n        \"hosts\": [],\n        \"flags\": 0,\n        \"internal\": null,\n        \"templates\": []\n      },\n      {\n        \"groupid\": \"49\",\n        \"name\": \"Hostgroup-alice-hosts\",\n        \"hosts\": [],\n        \"flags\": 0,\n        \"internal\": null,\n        \"templates\": []\n      }\n    ],\n    \"templates\": [],\n    \"inventory\": {},\n    \"monitored_by\": \"proxy\",\n    \"proxyid\": \"2\",\n    \"proxy_groupid\": \"0\",\n    \"maintenance_status\": \"0\",\n    \"active_available\": \"0\",\n    \"status\": \"0\",\n    \"macros\": [],\n    \"interfaces\": [\n      {\n        \"type\": 1,\n        \"ip\": \"\",\n        \"dns\": \"foo.example.com\",\n        \"port\": \"10050\",\n        \"useip\": 0,\n        \"main\": 1,\n        \"interfaceid\": \"49\",\n        \"available\": 0,\n        \"hostid\": \"10648\",\n        \"bulk\": null,\n        \"connection_mode\": \"Dns\",\n        \"type_str\": \"Agent\"\n      }\n    ],\n    \"proxy\": {\n      \"proxyid\": \"2\",\n      \"name\": \"proxy-prod02.example.com\",\n      \"hosts\": [],\n      \"status\": null,\n      \"operating_mode\": 0,\n      \"address\": \"127.0.0.1\",\n      \"proxy_groupid\": \"1\",\n      \"compatibility\": 0,\n      \"version\": 0,\n      \"local_address\": \"192.168.0.1\",\n      \"local_port\": \"10051\",\n      \"mode\": \"Active\",\n      \"compatibility_str\": \"Undefined\"\n    },\n    \"zabbix_agent\": \"Unknown\"\n  }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ccode\u003eshow_hosts foo.*\u003c/code\u003e\u003c/summary\u003e\n\n```json\n{\n  \"message\": \"\",\n  \"errors\": [],\n  \"return_code\": \"Done\",\n  \"result\": [\n    {\n      \"hostid\": \"10648\",\n      \"host\": \"foo.example.com\",\n      \"description\": \"\",\n      \"groups\": [\n        {\n          \"groupid\": \"22\",\n          \"name\": \"All-hosts\",\n          \"hosts\": [],\n          \"flags\": 0,\n          \"internal\": null,\n          \"templates\": []\n        },\n        {\n          \"groupid\": \"46\",\n          \"name\": \"Source-foosource\",\n          \"hosts\": [],\n          \"flags\": 0,\n          \"internal\": null,\n          \"templates\": []\n        },\n        {\n          \"groupid\": \"47\",\n          \"name\": \"Hostgroup-bob-hosts\",\n          \"hosts\": [],\n          \"flags\": 0,\n          \"internal\": null,\n          \"templates\": []\n        },\n        {\n          \"groupid\": \"48\",\n          \"name\": \"Importance-X\",\n          \"hosts\": [],\n          \"flags\": 0,\n          \"internal\": null,\n          \"templates\": []\n        },\n        {\n          \"groupid\": \"49\",\n          \"name\": \"Hostgroup-alice-hosts\",\n          \"hosts\": [],\n          \"flags\": 0,\n          \"internal\": null,\n          \"templates\": []\n        }\n      ],\n      \"templates\": [],\n      \"inventory\": {},\n      \"monitored_by\": \"proxy\",\n      \"proxyid\": \"2\",\n      \"proxy_groupid\": \"0\",\n      \"maintenance_status\": \"0\",\n      \"active_available\": \"0\",\n      \"status\": \"0\",\n      \"macros\": [],\n      \"interfaces\": [],\n      \"proxy\": {\n        \"proxyid\": \"2\",\n        \"name\": \"proxy-prod02.example.com\",\n        \"hosts\": [],\n        \"status\": null,\n        \"operating_mode\": 0,\n        \"address\": \"127.0.0.1\",\n        \"proxy_groupid\": \"1\",\n        \"compatibility\": 0,\n        \"version\": 0,\n        \"local_address\": \"192.168.0.1\",\n        \"local_port\": \"10051\",\n        \"mode\": \"Active\",\n        \"compatibility_str\": \"Undefined\"\n      },\n      \"zabbix_agent\": \"Unknown\"\n    }\n  ]\n}\n```\n\n\u003c/details\u003e\n\n## Development\n\nZabbix-cli currently uses [uv](https://docs.astral.sh/uv/)  and [Hatch](https://hatch.pypa.io/latest/) for project management and packaging. To start off, clone the repository:\n\n```bash\ngit clone https://github.com/unioslo/zabbix-cli.git\n```\n\nThen make a virtual environment using uv:\n\n```bash\nuv venv\n```\n\nThis will create a new virtual environment, install the required dependencies and enter the environment.\n\n### Testing\n\nRun unit tests (without coverage):\n\n```bash\nhatch run test\n```\n\nGenerate coverage report:\n\n```bash\nhatch run cov\n```\n\n### Documentation\n\nTo serve the documentation locally:\n\n```bash\nhatch run docs:serve\n```\n\nThis will start a local web server on `http://localhost:8001` that is automatically refreshed when you make changes to the documentation. However, some hooks are only run on startup, such as the creation of pages for each command. Changes to command examples or docstrings will require a restart.\n","funding_links":[],"categories":["Python","Tools"],"sub_categories":["Terraform"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funioslo%2Fzabbix-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funioslo%2Fzabbix-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funioslo%2Fzabbix-cli/lists"}