Asynchronous Zabbix API Python interface
Project description
aiozabbix
aiozabbix is a Python package that provides an asynchronous interface to the Zabbix API, using aiohttp. It is based on PyZabbix.
Example usage
The interface mimics PyZabbix as closely as possible:
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:
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()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiozabbix-1.4.0.tar.gz.
File metadata
- Download URL: aiozabbix-1.4.0.tar.gz
- Upload date:
- Size: 33.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adedf811b5a26e0a237f2cf6d8d9435a91e1d4bda2e9ea759e851308d0e3c7ad
|
|
| MD5 |
1a563455877766c9f93faa446bdf3613
|
|
| BLAKE2b-256 |
06b86492c929038696a013e0ad7956f03dcd5fda61079f28d4ffd7c657f52bfa
|
File details
Details for the file aiozabbix-1.4.0-py3-none-any.whl.
File metadata
- Download URL: aiozabbix-1.4.0-py3-none-any.whl
- Upload date:
- Size: 27.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23ffc4edfe650c0464788a45b68ed2c7b527254adb091614619db753139098db
|
|
| MD5 |
a31fb30251994613c03b7d07ccb7f5bd
|
|
| BLAKE2b-256 |
b41e179f94554712062b24e16de26626b9bbcb3365a8ec1d0f86d0312e5a8479
|