aiozabbix
=========
**aiozabbix** is a Python package that provides an asynchronous
interface to the
[Zabbix API](https://www.zabbix.com/documentation/3.0/manual/api/reference),
using aiohttp. It is based on
[PyZabbix](https://github.com/lukecyca/pyzabbix).
Example usage
-------------
The interface mimics PyZabbix as closely as possible:
```python
import asyncio
from aiozabbix import ZabbixAPI
async def main():
zapi = ZabbixAPI('https://zabbixserver.example.com/zabbix')
await zapi.login('zabbix user')
hosts = await zapi.host.get(output=['host', 'hostid', 'name', 'status'])
print(hosts)
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
```
To customize the HTTP requests, for example to perform HTTP basic
authentication, you need to provide your own `aiohttp.ClientSession`:
```python
import asyncio
import aiohttp
from aiozabbix import ZabbixAPI
async def main():
auth = aiohttp.BasicAuth('zabbix user', password='zabbix password')
async with aiohttp.ClientSession(auth=auth) as session:
zapi = ZabbixAPI('https://zabbixserver.example.com/zabbix', client_session=session)
await zapi.login('zabbix user')
hosts = await zapi.host.get(output=['host', 'hostid', 'name', 'status'])
print(hosts)
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
```
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/ModioAB/aiozabbix",
"name": "aiozabbix",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "zabbix monitoring api",
"author": "Modio AB",
"author_email": "nili@modio.se",
"download_url": "https://files.pythonhosted.org/packages/5a/71/d28ec22b952ce2f03b03419b950f5e4ee1e0938fc24fa8ed2a06580d8ee2/aiozabbix-1.3.1.tar.gz",
"platform": null,
"description": "aiozabbix\n=========\n\n**aiozabbix** is a Python package that provides an asynchronous\ninterface to the\n[Zabbix API](https://www.zabbix.com/documentation/3.0/manual/api/reference),\nusing aiohttp. It is based on\n[PyZabbix](https://github.com/lukecyca/pyzabbix).\n\nExample usage\n-------------\n\nThe interface mimics PyZabbix as closely as possible:\n\n```python\nimport asyncio\n\nfrom aiozabbix import ZabbixAPI\n\n\nasync def main():\n zapi = ZabbixAPI('https://zabbixserver.example.com/zabbix')\n await zapi.login('zabbix user')\n hosts = await zapi.host.get(output=['host', 'hostid', 'name', 'status'])\n print(hosts)\n\n\nif __name__ == '__main__':\n loop = asyncio.get_event_loop()\n loop.run_until_complete(main())\n loop.close()\n```\n\nTo customize the HTTP requests, for example to perform HTTP basic\nauthentication, you need to provide your own `aiohttp.ClientSession`:\n\n```python\nimport asyncio\n\nimport aiohttp\nfrom aiozabbix import ZabbixAPI\n\n\nasync def main():\n auth = aiohttp.BasicAuth('zabbix user', password='zabbix password')\n async with aiohttp.ClientSession(auth=auth) as session:\n zapi = ZabbixAPI('https://zabbixserver.example.com/zabbix', client_session=session)\n await zapi.login('zabbix user')\n hosts = await zapi.host.get(output=['host', 'hostid', 'name', 'status'])\n print(hosts)\n\n\nif __name__ == '__main__':\n loop = asyncio.get_event_loop()\n loop.run_until_complete(main())\n loop.close()\n```\n",
"bugtrack_url": null,
"license": "LGPL",
"summary": "Asynchronous Zabbix API Python interface",
"version": "1.3.1",
"project_urls": {
"Homepage": "https://gitlab.com/ModioAB/aiozabbix"
},
"split_keywords": [
"zabbix",
"monitoring",
"api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "795698a8e03c5f87a543b14bf06bd91dc8da3026f158c5e1976344cc30724bd3",
"md5": "970d016cac33d7188007f264e66aaec3",
"sha256": "8f32546221464d54c36ed3f02884e62ce3a3a0f03e810d8584960296ce9ac0ef"
},
"downloads": -1,
"filename": "aiozabbix-1.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "970d016cac33d7188007f264e66aaec3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17099,
"upload_time": "2024-07-01T15:07:57",
"upload_time_iso_8601": "2024-07-01T15:07:57.525904Z",
"url": "https://files.pythonhosted.org/packages/79/56/98a8e03c5f87a543b14bf06bd91dc8da3026f158c5e1976344cc30724bd3/aiozabbix-1.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5a71d28ec22b952ce2f03b03419b950f5e4ee1e0938fc24fa8ed2a06580d8ee2",
"md5": "4d32ca39f8ca44547b58343c35a6e090",
"sha256": "a3ac8b39daab37d7db5bdce64159752805a4d0bad3cedd2526246574c5142cee"
},
"downloads": -1,
"filename": "aiozabbix-1.3.1.tar.gz",
"has_sig": false,
"md5_digest": "4d32ca39f8ca44547b58343c35a6e090",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16629,
"upload_time": "2024-07-01T15:08:03",
"upload_time_iso_8601": "2024-07-01T15:08:03.004682Z",
"url": "https://files.pythonhosted.org/packages/5a/71/d28ec22b952ce2f03b03419b950f5e4ee1e0938fc24fa8ed2a06580d8ee2/aiozabbix-1.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-01 15:08:03",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "ModioAB",
"gitlab_project": "aiozabbix",
"lcname": "aiozabbix"
}