每 10 秒启动 Zabbix Agent 失败
Failed to start Zabbix Agent for every 10 seconds
我用的是centos 7.
我是怎么查看日志的
journalctl -xe
我从日志中得到了什么。(我每 10 秒看到相同的日志。)
Oct 02 10:19:51 lp01.localdomain systemd[1]: zabbix-agent.service holdoff time over, scheduling restart.
Oct 02 10:19:51 lp01.localdomain systemd[1]: Starting Zabbix Agent...
-- Subject: Unit zabbix-agent.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit zabbix-agent.service has begun starting up.
Oct 02 10:19:51 lp01.localdomain zabbix_agentd[8985]: zabbix_agentd [8987]: cannot open "/var/log/zabbix/zabbix_agentd.log": [13] Permission denied
Oct 02 10:19:51 lp01.localdomain systemd[1]: PID file /run/zabbix/zabbix_agentd.pid not readable (yet?) after start.
Oct 02 10:19:51 lp01.localdomain systemd[1]: zabbix-agent.service never wrote its PID file. Failing.
Oct 02 10:19:51 lp01.localdomain systemd[1]: Failed to start Zabbix Agent.
-- Subject: Unit zabbix-agent.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit zabbix-agent.service has failed.
--
-- The result is failed.
Oct 02 10:19:51 lp01.localdomain systemd[1]: Unit zabbix-agent.service entered failed state.
Oct 02 10:19:51 lp01.localdomain systemd[1]: zabbix-agent.service failed.
所以我先检查了“/var/log/zabbix/zabbix_agentd.log”文件。
ll /var/log/zabbix/zabbix_agentd.log
但是它说没有那个文件或目录。
ls: cannot access /var/log/zabbix/zabbix_agentd.log: No such file or directory
然后我检查了“/run/zabbix/zabbix_agentd.pid”文件。
ll /run/zabbix/zabbix_agentd.pid
它还说没有那个文件或目录。
ls: cannot access /run/zabbix/zabbix_agentd.pid: No such file or directory
You have new mail in /var/spool/mail/root
我检查了 Selinux 是否 运行。
getenforce
它说 Selinux 被禁用..
我的问题是
- 如何启动zabbix?
- 如果我不能启动zabbix,我可以阻止zabbix每10秒启动失败吗?
谢谢。
给目录添加权限 - /var/log/zabbix/ & /var/log/zabbix-agent/
chmod 707 /var/log/zabbix/
chmod 707 /var/log/zabbix-agent/
或
更改目录的所有者?
chown zabbix:zabbix /var/log/zabbix/
chown zabbix:zabbix /var/log/zabbix-agent/
然后,会停止服务zabbix吗?
systemctl stop zabbix-agent
我用的是centos 7.
我是怎么查看日志的
journalctl -xe
我从日志中得到了什么。(我每 10 秒看到相同的日志。)
Oct 02 10:19:51 lp01.localdomain systemd[1]: zabbix-agent.service holdoff time over, scheduling restart.
Oct 02 10:19:51 lp01.localdomain systemd[1]: Starting Zabbix Agent...
-- Subject: Unit zabbix-agent.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit zabbix-agent.service has begun starting up.
Oct 02 10:19:51 lp01.localdomain zabbix_agentd[8985]: zabbix_agentd [8987]: cannot open "/var/log/zabbix/zabbix_agentd.log": [13] Permission denied
Oct 02 10:19:51 lp01.localdomain systemd[1]: PID file /run/zabbix/zabbix_agentd.pid not readable (yet?) after start.
Oct 02 10:19:51 lp01.localdomain systemd[1]: zabbix-agent.service never wrote its PID file. Failing.
Oct 02 10:19:51 lp01.localdomain systemd[1]: Failed to start Zabbix Agent.
-- Subject: Unit zabbix-agent.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit zabbix-agent.service has failed.
--
-- The result is failed.
Oct 02 10:19:51 lp01.localdomain systemd[1]: Unit zabbix-agent.service entered failed state.
Oct 02 10:19:51 lp01.localdomain systemd[1]: zabbix-agent.service failed.
所以我先检查了“/var/log/zabbix/zabbix_agentd.log”文件。
ll /var/log/zabbix/zabbix_agentd.log
但是它说没有那个文件或目录。
ls: cannot access /var/log/zabbix/zabbix_agentd.log: No such file or directory
然后我检查了“/run/zabbix/zabbix_agentd.pid”文件。
ll /run/zabbix/zabbix_agentd.pid
它还说没有那个文件或目录。
ls: cannot access /run/zabbix/zabbix_agentd.pid: No such file or directory
You have new mail in /var/spool/mail/root
我检查了 Selinux 是否 运行。
getenforce
它说 Selinux 被禁用..
我的问题是
- 如何启动zabbix?
- 如果我不能启动zabbix,我可以阻止zabbix每10秒启动失败吗?
谢谢。
给目录添加权限 - /var/log/zabbix/ & /var/log/zabbix-agent/
chmod 707 /var/log/zabbix/
chmod 707 /var/log/zabbix-agent/
或
更改目录的所有者?
chown zabbix:zabbix /var/log/zabbix/
chown zabbix:zabbix /var/log/zabbix-agent/
然后,会停止服务zabbix吗?
systemctl stop zabbix-agent