fix: права доступа для zabbix-agent на файлы данных
- atomic_write: chmod 644 на файлы (было 600 от mkstemp) - install.sh: chmod 755 на /var/lib/airflow-monitor - problems.count: grep вместо python3 (не везде доступен) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f3e1ad7df3
commit
07b07c9087
@ -53,6 +53,7 @@ class DataExporter:
|
|||||||
)
|
)
|
||||||
with os.fdopen(fd, "w", encoding="utf-8") as f:
|
with os.fdopen(fd, "w", encoding="utf-8") as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
|
os.chmod(tmp_path, 0o644)
|
||||||
os.replace(tmp_path, str(path))
|
os.replace(tmp_path, str(path))
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"File written: %s (%d bytes)",
|
"File written: %s (%d bytes)",
|
||||||
|
|||||||
2
build.sh
2
build.sh
@ -333,6 +333,8 @@ for dir in "$STATE_DIR" "$LOG_DIR"; do
|
|||||||
else
|
else
|
||||||
echo " Exists: $dir"
|
echo " Exists: $dir"
|
||||||
fi
|
fi
|
||||||
|
# Ensure zabbix agent can read data files
|
||||||
|
sudo chmod 755 "$dir"
|
||||||
done
|
done
|
||||||
|
|
||||||
# --- Step 6: Install systemd service ---
|
# --- Step 6: Install systemd service ---
|
||||||
|
|||||||
@ -17,7 +17,7 @@ UserParameter=airflow.dag.problems,cat /var/lib/airflow-monitor/problems.json 2>
|
|||||||
|
|
||||||
# Количество проблемных DAG-ов (для простых триггеров)
|
# Количество проблемных DAG-ов (для простых триггеров)
|
||||||
# Zabbix item: type=Zabbix agent, key=airflow.dag.problems.count, type of info=Numeric (unsigned)
|
# Zabbix item: type=Zabbix agent, key=airflow.dag.problems.count, type of info=Numeric (unsigned)
|
||||||
UserParameter=airflow.dag.problems.count,python3 -c "import json,sys; print(len(json.load(open('/var/lib/airflow-monitor/problems.json'))))" 2>/dev/null || echo 0
|
UserParameter=airflow.dag.problems.count,grep -o '"dag_id"' /var/lib/airflow-monitor/problems.json 2>/dev/null | wc -l
|
||||||
|
|
||||||
# Heartbeat — epoch timestamp последнего успешного цикла
|
# Heartbeat — epoch timestamp последнего успешного цикла
|
||||||
# Zabbix item: type=Zabbix agent, key=airflow.monitor.heartbeat, type of info=Numeric (unsigned)
|
# Zabbix item: type=Zabbix agent, key=airflow.monitor.heartbeat, type of info=Numeric (unsigned)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user