Skip to main content

Python module to work with zabbix.

Project description

Build Status Coverage PyPi downloads PyPi version

Zabbix module for Python

Install

You can install Zabbix modules for Python with pip:

pip install py-zabbix

Official documentaion for py-zabbix

Examples

ZabbixAPI

from zabbix.api import ZabbixAPI

# Create ZabbixAPI class instance
zapi = ZabbixAPI(url='https://localhost/zabbix/', user='admin', password='zabbix')

# Get all monitored hosts
result1 = zapi.host.get(monitored_hosts=1, output='extend')

# Get all disabled hosts
result2 = zapi.do_request('host.get',
                          {
                              'filter': {'status': 1},
                              'output': 'extend'
                          })

# Filter results
hostnames1 = [host['host'] for host in result1]
hostnames2 = [host['host'] for host in result2['result']]

ZabbixSender

from pyzabbix import ZabbixMetric, ZabbixSender

# Send metrics to zabbix trapper
packet = [
  ZabbixMetric('hostname1', 'test[cpu_usage]', 2),
  ZabbixMetric('hostname1', 'test[system_status]', "OK"),
  ZabbixMetric('hostname1', 'test[disk_io]', '0.1'),
  ZabbixMetric('hostname1', 'test[cpu_usage]', 20, 1411598020),
]

result = ZabbixSender(use_config=True).send(packet)

ChangeLog

1.1.2 (2016-07-28)

  • Added parameter chunk_size for object ZabbixSender

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

py-zabbix-1.1.4a.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_zabbix-1.1.4-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file py-zabbix-1.1.4a.tar.gz.

File metadata

  • Download URL: py-zabbix-1.1.4a.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.3 setuptools/36.5.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.4

File hashes

Hashes for py-zabbix-1.1.4a.tar.gz
Algorithm Hash digest
SHA256 eaebb74b6605165079c151d84c3d8a354a3833eb315a0dc677cbee040dbb1533
MD5 0864f3bf8bd0e4587292e3a687d31ca5
BLAKE2b-256 c16e9f573d7e5e61e8dd830ae02e2436f64df90dc0f1aa0ee0edb921baa3ce18

See more details on using hashes here.

File details

Details for the file py_zabbix-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: py_zabbix-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.3 setuptools/36.5.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.4

File hashes

Hashes for py_zabbix-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b36c3f557d03d8615376de43c9e73a8ea777284b1adf25fae051b09f6d31ef1b
MD5 14116c1b22034df7f6c33d178fddd2a9
BLAKE2b-256 3925d8b634d935b6b10454188dd5d57613fc85776841fbd569ad3a748e5f2884

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page