{"id":37072579,"url":"https://github.com/mattykay/pybix","last_synced_at":"2026-01-14T08:31:28.093Z","repository":{"id":62578988,"uuid":"197900514","full_name":"mattykay/pybix","owner":"mattykay","description":"Python based Zabbix API utility with helper functions","archived":false,"fork":false,"pushed_at":"2022-01-06T04:10:40.000Z","size":59,"stargazers_count":9,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-27T05:58:33.425Z","etag":null,"topics":["python","zabbix","zabbix-api","zabbix-cli"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattykay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-20T08:13:31.000Z","updated_at":"2023-09-18T18:55:19.000Z","dependencies_parsed_at":"2022-11-03T21:00:52.301Z","dependency_job_id":null,"html_url":"https://github.com/mattykay/pybix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mattykay/pybix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattykay%2Fpybix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattykay%2Fpybix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattykay%2Fpybix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattykay%2Fpybix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattykay","download_url":"https://codeload.github.com/mattykay/pybix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattykay%2Fpybix/sbom","scorecard":{"id":628201,"data":{"date":"2025-08-11","repo":{"name":"github.com/mattykay/pybix","commit":"1f523c3203175415be429e5ae5e57eff46b6362e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 1/9 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pythonpackage.yaml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/mattykay/pybix/pythonpackage.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pythonpackage.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/mattykay/pybix/pythonpackage.yaml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yaml:22","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yaml:23","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yaml:26","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yaml:33","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/pythonpackage.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T07:06:51.920Z","repository_id":62578988,"created_at":"2025-08-21T07:06:51.920Z","updated_at":"2025-08-21T07:06:51.920Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:16:59.381Z","status":"ssl_error","status_checked_at":"2026-01-14T08:13:45.490Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-14T08:31:27.241Z","updated_at":"2026-01-14T08:31:28.066Z","avatar_url":"https://github.com/mattykay.png","language":"Python","readme":"# pybix\n\n**NOTE: This module has not been completed but is functional. Use at own risk.**\n\n## Description\n\nPython based Zabbix API utility containing helper functions and CLI capabilities.\n\nTakes inspiration from existing Python-Zabbix API modules like [lukecyca/pyzabbix](https://github.com/lukecyca/pyzabbix) and [adubkov/py-zabbix](https://github.com/adubkov/py-zabbix).\n\nWhile this module can be used in a similar way, the aim is to add a few out of the box helper functions and CLI handling for a more \"batteries included\" module. For example GraphImage as described in usage which enables saving Zabbix graphs which is not possible via the API at this time.\n\n## Install\n\n### Pip\n\n```\npip install pybix\n```\n\n### Docker\n\nTODO - not yet available.\n\n## Requirements\n\n* Python 3.6 or greater\n* Zabbix 2.0 or greater\n  * Only tested on \u003e4.0\n\n## Usage\n\n### Zabbix API\n\nRefer to [Zabbix Offical API object](https://www.zabbix.com/documentation/4.2/manual/api/reference) references for objects that can be queried and their parameters.\n\nAPI structure all uses format like `ZAPI.\u003cobject\u003e.\u003caction\u003e(\u003cparameters\u003e)` e.g. `ZAPI.host.get(output='extend')`.\n\n#### Import as Python module\n\n##### Directly\n\n```python\nfrom pybix import ZabbixAPI\nZAPI = ZabbixAPI(url=\"http://localhost/zabbix\")\nZAPI.login(user=\"Admin\", password=\"zabbix\")\n\n# Print all monitored hosts\nfor host in ZAPI.host.get(output=\"extend\",monitored_hosts=1):\n    print(host['host'])\n\nZAPI.logout() # Explicitly logout to clear Zabbix session\n```\n\n##### With context manager to handle logout\n\nNote: Login still must be done manually (as in the future we may allow passing existing session, hence might not need to login everytime).\n\n```python\nfrom pybix import ZabbixAPI\n\nwith ZabbixAPI() as ZAPI: # using defaults for server\n    ZAPI.login() # using defaults for user, password\n\n    # Print all monitored hosts\n    for host in ZAPI.host.get(output=\"extend\",monitored_hosts=1):\n        print(host['host'])\n```\n\n#### Zabbix API CLI\n\n##### Zabbix API CLI Usage\n\n```bash\nUsage:\n    pybix.py \u003cmethod\u003e [--zabbix-server=ZABBIX_SERVER] [--zabbix-user=ZABBIX_USER]\n            [--zabbix-password=ZABBIX_PASSWORD] [--ssl-verify] [(-v | --verbose)] [\u003cargs\u003e ...]\n    pybix.py (-h | --help)\n    pybix.py --version\n\nArguments:\n  method        either Zabbix API reference as '\u003cobject\u003e.\u003caction\u003e' or GraphImage API as 'graphimage.\u003csearch_type\u003e' (e.g. 'host.get' or 'graphimage.graph_id')\n  args          what arguments to pass to API call\n\nOptions:\n  -h, --help\n  --version\n  -v, --verbose                      Whether to use verbose logging [default: False]\n  --output-path=PATH                 Where to save graphs to default: cwd\n  --zabbix-server=ZABBIX_SERVER      [default: https://localhost/zabbix]\n  --zabbix-user=ZABBIX_USER          [default: Admin]\n  --zabbix-password=ZABBIX_PASSWORD  [default: zabbix]\n  --ssl-verify                       Whether to use SSL verification for API [default: True]\n```\n\n##### Zabbix API CLI Example\n\n```bash\npython -m pybix host.get filter=\"{host:server1}\" # Get host server1\npython -m pybix host.get filter=\"{host:[server1,server2]}\" # Get host server1 and server2\npython -m pybix user.get # Get all Users\n```\n\n### Graph Image Export\n\nZabbix does not let you export graphs via API (only the configuration for them). Instead of using `ZabbixAPI` class, use included `GraphImage`.\n\n#### GraphImage Python Example\n\n```python\nfrom pybix import GraphImageAPI\ngraph = GraphImageAPI(url=\"http://localhost/zabbix\",\n                      user=\"Admin\",\n                      password=\"zabbix\")\ngraph.get_by_graph_id(\"4038\") # will save to png file in current working directory\ngraph.get_by_graphname(\"CPU\") # will save any \"CPU\" graph png images to file in current working directory\n```\n\n#### GraphImage CLI\n\n##### GraphImage CLI Usage\n\nRefer to [ZabbixAPI usage](#####zabbix-api-cli-usage).\n\n`search_types` include `graph_id, graph_name, item_names, item_keys, item_ids`\n\n##### GraphImage CLI Examples\n\n```bash\npython -m pybix graphimage.graph_name graph_name=CPU host_names=server1\npython -m pybix graphimage.graph_name graph_name=CPU host_names=[server1,server2]\npython -m pybix graphimage.item_names item_names=CPU host_names=server1\npython -m pybix graphimage.item_keys item_keys=availability.agent.available host_names=server1\n\n# Not as useful, but is what above methods call after calculating id\npython -m pybix graphimage.graph_id graph_id=4038 host_names=server1\npython -m pybix graphimage.item_ids item_ids=138780,138781 host_names=server1\n```\n\n## Known Issues\n\n### SSL Verification\n\n* If server using a self signed cert or serving on HTTPS, will need to use `ssl_verify` overide\n\n### User configuration\n\n* Zabbix user used during API calls must have viewing rights to queried Zabbix object\n  * i.e. appropriate hostgroup read rights to user/usergroup OR super admin\n  * If it does not, it will simply return empty results without warning\n\n### Graph Items Usage\n\n* User used to login must have frontend access (i.e. in Zabbix user group, set frontend access to true)\n* No error messages or warnings if graph is invalid (i.e. wrong values used to call it)\n\n## Contributing\n\nFeel free to raise any feature requests/problems/improvements as issue or pull request via [GitHub](https://github.com/mattykay/pybix).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattykay%2Fpybix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattykay%2Fpybix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattykay%2Fpybix/lists"}