{"id":16573556,"url":"https://github.com/v2e4lisp/zbx","last_synced_at":"2026-06-04T12:31:01.523Z","repository":{"id":146654485,"uuid":"12261315","full_name":"v2e4lisp/zbx","owner":"v2e4lisp","description":"zabbix api wrapper , cli, and a dsl.","archived":false,"fork":false,"pushed_at":"2013-08-28T16:42:24.000Z","size":304,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T15:24:26.519Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/v2e4lisp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-21T04:39:11.000Z","updated_at":"2013-09-17T15:45:55.000Z","dependencies_parsed_at":"2023-03-24T12:27:58.777Z","dependency_job_id":null,"html_url":"https://github.com/v2e4lisp/zbx","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/v2e4lisp/zbx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v2e4lisp%2Fzbx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v2e4lisp%2Fzbx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v2e4lisp%2Fzbx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v2e4lisp%2Fzbx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/v2e4lisp","download_url":"https://codeload.github.com/v2e4lisp/zbx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v2e4lisp%2Fzbx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33905358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"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":[],"created_at":"2024-10-11T21:42:30.326Z","updated_at":"2026-06-04T12:31:01.500Z","avatar_url":"https://github.com/v2e4lisp.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZBX\n\nA zabbix API wrapper, a dsl and command line tool.\n\nThis project is inspired by the following repos:\n\n- [zabbixapi](https://github.com/vadv/zabbixapi)\n- [pyzabbix](https://github.com/lukecyca/pyzabbix).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'zbx'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install zbx\n\n### Command Line Config\n```yaml\n# ~/.zbxconfig is the config file. It will be parsed by yaml\n# So you write something like this\nuser: wenjun.yan\npassword: yanwenjun\napi_url: https://zabbix-api-url\n```\n\n### Rails Config\nYou can overwirte these by passing new value to ZBX.client.\n\nPut the following lines into `./config/initializers/zbx.rb`\n```ruby\nZBX.config do |config|\n  config.api_url = 'https://zabbix-api-url'\n  config.user =  'wenjun.yan'\n  config.password = 'yan.wenjun'\nend\n```\n\n## Usage\n\n```ruby\nrequire 'zbx'\n\n# The following code are doing the same thing ,that is get a host whose id is 10160\n\n# You can pass an arg(`self`) to the block if you like.\n# If no arg is passed, the block will be eval in `self`\n\nZBX.client user, password, api_url do\n  host.get hostids: 10160\nend\n\nZBX.client user, password, api_url do\n  host do\n    get hostids: 10160\n  end\nend\n\nZBX.client do |client|\n  client.hostgroup do |group|\n    group.get(groupids: 10)\n  end\nend\n\n# Set `user`, `password`, `api_url`. if you don't set them or specified them when create.\n# The zabbix-client will use the default configuration stored in `ZBX.configuration`.\n\nZBX.client do\n  set user: user, password: password\n  set api_url: 'http://api_url'\n  host.get hostids: 10160\nend\n\nclient = ZBX.client(user, password, api_url)\nclient.host.get hostids: 10160\n\nhost_api = client.host\nhost_api.get hostids: 10160\n\n# When you want to create multiple user , use `ZBX.client!`,\n# since `ZBX.client` will always try to return the existing zabbix-client created by itself.\n# Instead `ZBX.client!` will always create a new instance everytime you call it.\nme = ZBX.client! user: 'wenjun.yan', password: 'yanwenjun'\nadmin = ZBX.client! do\n  set user: 'admin'\n  set passowrd: 'admin'\nend\n```\n\n```bash\n# CLI\n\n# get the name of a host whose id is 10160\n\u003e $ zbx send host.get '{\"hostids\": 10160, \"output\": [\"name\"]}'\n# output:\n# [{\"hostid\"=\u003e\"10160\", \"name\"=\u003e\"fnft12.rf\"}]\n\n# open api doc in browser\n\u003e $ zbx doc host.get -v 2.0\n\n# help\n\u003e $ zbx help\n# output:\n# Commands:\n#   zbx doc [method-name or entity-name]  # Open the api doc in browser, -d its short term\n#   zbx help [COMMAND]                    # Describe available commands or one specific command\n#   zbx send [method] [data]              # Send api request to zabbix server, -s is its short term\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Thanks\n- thanks *Alain Ganuchaud* \u003calain@coreit.fr\u003e for offering me a zabbix database erd.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv2e4lisp%2Fzbx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fv2e4lisp%2Fzbx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv2e4lisp%2Fzbx/lists"}