Metadata-Version: 2.1
Name: aiozabbix
Version: 1.3.0
Summary: Asynchronous Zabbix API Python interface
Home-page: https://gitlab.com/ModioAB/aiozabbix
Author: Modio AB
Author-email: nili@modio.se
License: LGPL
Keywords: zabbix monitoring api
Classifier: Framework :: AsyncIO
Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Description-Content-Type: text/markdown
License-File: LICENSE.txt

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()
```
