If the script runs, prints nothing, and exits before Zabbix can read the output, the pipe breaks.
Fix: Ensure the script writes a valid value to stdout, even if it’s just an error message:
#!/bin/bash
# Example: always output something
value=$(some_command 2>/dev/null)
if [ -n "$value" ]; then
echo "$value"
else
echo "ZBX_NOTSUPPORTED"
fi
The broken pipe often results from the History Syncer or Configuration Syncer failing due to cache exhaustion.
Edit /etc/zabbix/zabbix_server.conf:
# Increase history cache size (default is 16M)
HistoryCacheSize=64M
If the error persists and you are certain configs are correct, manually clear stale IPC resources.
WARNING: Stop Zabbix server first.
systemctl stop zabbix-server
# Find all IPC objects owned by zabbix user
ipcs -m | grep zabbix | awk 'print $2' | xargs -n1 ipcrm -m
ipcs -s | grep zabbix | awk 'print $2' | xargs -n1 ipcrm -s
ipcs -q | grep zabbix | awk 'print $2' | xargs -n1 ipcrm -q
# Restart
systemctl start zabbix-server
This forces Zabbix to recreate all shared memory segments and message queues from scratch. zabbix cannot write to ipc socket broken pipe upd
The Timeout parameter controls how long Zabbix waits for internal operations.
Timeout=30
If your database is slow or your network is congested, increase to Timeout=30 or even Timeout=60 (seconds). Be cautious—very high timeouts can hide underlying issues.
ipcs -a
Look for unused message queues. Check if any Zabbix-related semaphores or shared memory segments are accumulating. If the script runs, prints nothing, and exits
After changes:
sudo systemctl restart zabbix-agent
sudo systemctl status zabbix-agent # verify no startup errors
Then run a manual test:
zabbix_get -s 127.0.0.1 -k your.custom.key
If you still see the “broken pipe” message, it’s time to review your script’s stability under real‑world conditions – concurrency, slow execution, and unexpected inputs are the usual suspects. The broken pipe often results from the History
Got any other weird Zabbix errors? Share them below! 👇