Python Zabbix Proto
Module supporting all Zabbix specific communication protocols. At the moment Proxy (active) and sender protocols are supported.
Zabbix server supported versions
| Zabbix Proto | Zabbix |
|---|---|
| <=0.0.9 | <=3.2 |
| >=1.0.0, <2.0.0 | 5.0-6.x |
| >=2.1.0 | 5.0-7.x |
Installation
pip install zabbixproto
Proxy
By default the library uses Zabbix 7.x protocol. To communicate with older servers, pass protocol_version:
from datetime import datetime
from zabbixproto import Proxy, ProxyDataPacket
## Zabbix 7.x (default)
proxy = Proxy('testproxy', '127.0.0.1', 10051)
## Zabbix 5.x/6.x
proxy = Proxy('testproxy', '127.0.0.1', 10051, protocol_version="5.4.0")
## Sending heartbeat to the Zabbix server
## (version-aware: Zabbix 7.x sends an empty "proxy data" keepalive since the
## "proxy heartbeat" request was removed in 7.0; 5.x/6.x send "proxy heartbeat")
proxy.send_heartbeat()
## Getting "proxy configuration". Includes all hosts, items etc.
resp = proxy.get_config()
print(resp)
data = ProxyDataPacket('testproxy', session=proxy.session,
protocol_version=proxy.protocol_version)
## Sending auto-registration packets
data.add_autoregistration(
host="testhost",
host_metadata="registerThisTestHost"
)
## Sending metrics
data.add_history_data(
itemid=12345,
value=100,
clock=int(datetime.now().timestamp())
)
## UNSUPPORTED
data.add_history_data(
itemid=12345,
value="Unsupported because of this and that",
state=1,
clock=int(datetime.now().timestamp())
)
## Unavailable host (v7: interface availability, v5: host availability)
data.add_host_availability(
hostid=100,
available=2, # 0 - Unknown, 1 - Available, 2 - Unavailable
error='Web site is down!'
)
print(proxy.sendWithResponse(data))
Sender
from zabbixproto import Sender, SenderDataPacket
sender = Sender('127.0.0.1', 10051)
packet = SenderDataPacket()
packet.add("hostname", "key", "value")
sender.sendWithResponse(packet)
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 zabbixproto-2.2.1.tar.gz.
File metadata
- Download URL: zabbixproto-2.2.1.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c2851bfa5a34b8586684051192b99fad0b9bf2b7496a0247d3c8d025938facd
|
|
| MD5 |
47c22e809e7e3dac93447d08acbe4b2a
|
|
| BLAKE2b-256 |
76d281896b785a9a780562ffd17f0f4eef2c6b8639869a2a53f2485fcfa5bef7
|
Provenance
The following attestation bundles were made for zabbixproto-2.2.1.tar.gz:
Publisher:
ci.yml on akomic/python-zabbix-proto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zabbixproto-2.2.1.tar.gz -
Subject digest:
9c2851bfa5a34b8586684051192b99fad0b9bf2b7496a0247d3c8d025938facd - Sigstore transparency entry: 2339571655
- Sigstore integration time:
-
Permalink:
akomic/python-zabbix-proto@05b72f2b59fb1134b20605ad6ba25a67112c027a -
Branch / Tag:
refs/tags/v2.2.1 - Owner: https://github.com/akomic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@05b72f2b59fb1134b20605ad6ba25a67112c027a -
Trigger Event:
push
-
Statement type:
File details
Details for the file zabbixproto-2.2.1-py3-none-any.whl.
File metadata
- Download URL: zabbixproto-2.2.1-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
410af3120611cb60b9fdc6ab551b45a4371893c35cf2030ca8017baafb51a454
|
|
| MD5 |
8e0f07c1c62734273477f48136458276
|
|
| BLAKE2b-256 |
511ed85143241567cd76392a230d323f2869098b5413c32b153003aabc0835d0
|
Provenance
The following attestation bundles were made for zabbixproto-2.2.1-py3-none-any.whl:
Publisher:
ci.yml on akomic/python-zabbix-proto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zabbixproto-2.2.1-py3-none-any.whl -
Subject digest:
410af3120611cb60b9fdc6ab551b45a4371893c35cf2030ca8017baafb51a454 - Sigstore transparency entry: 2339571667
- Sigstore integration time:
-
Permalink:
akomic/python-zabbix-proto@05b72f2b59fb1134b20605ad6ba25a67112c027a -
Branch / Tag:
refs/tags/v2.2.1 - Owner: https://github.com/akomic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@05b72f2b59fb1134b20605ad6ba25a67112c027a -
Trigger Event:
push
-
Statement type: