-
Type:
New Feature Request
-
Resolution: Unresolved
-
Priority:
Trivial
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Summary
Add protocol compression to active communications performed by the classic C agent (zabbix_agentd).
ZBXNEXT-5543 added compression to the Go agent/Agent2 (component Agent (G), label golang), but the classic agent still sends active check requests, buffered values and heartbeats without the ZBX_TCP_COMPRESS flag.
Motivation
The missing compression is particularly noticeable on OpenWrt routers and other devices using constrained or metered links. Current Zabbix servers and proxies already support receiving compressed protocol payloads.
Proposed implementation
- Add EnableCompression to zabbix_agentd, enabled by default.
- Compress all active communication paths: active check refresh requests, buffered value uploads and heartbeat messages.
- Allow EnableCompression=0 for compatibility with servers and proxies older than 4.0.
- Check for zlib in agent-only builds as well as server and proxy builds.
- Keep zabbix_sender behavior unchanged.
Validation
The implementation was built from current master with OpenSSL and zlib. Both EnableCompression=0 and EnableCompression=1 configurations validate, while values outside the 0-1 range are rejected.
A loopback wire test captured active-check heartbeats:
- disabled: protocol flags 0x01, 115-byte uncompressed payload;
- enabled: protocol flags 0x03, 98-byte zlib payload expanding to 115 bytes.
The resulting agent links against libz.so.1. The implementation was also cross-built and tested on MIPS OpenWrt 21 in active mode.
Implementation references
- Patch attached to this request.
- GitHub mirror PR: https://github.com/zabbix/zabbix/pull/180
- OpenWrt packaging PR: https://github.com/openwrt/packages/pull/29998