Answer the question
In order to leave comments, you need to log in
How to add zabbix-agentd to autoload?
Good afternoon, I collected the actions in a script,
as if trying to start the agent from precompiled files from the site
#!/bin/bash
echo "********"
echo "Runing....."
useradd zabbix
mkdir /var/log/zabbix
mkdir /etc/zabbix
mkdir /usr/src/zabbix
cd /usr/src/zabbix
cp /tmp/zabb* /usr/src/zabbix
tar zxvf zabb*
cp /usr/src/zabbix/sbin/zabbix_agentd /usr/local/bin
touch /usr/local/etc/zabbix_agentd.conf
echo "Server=192.168.1.1" >> /usr/local/etc/zabbix_agentd.conf
echo "ServerActive=192.168.1.1" >> /usr/local/etc/zabbix_agentd.conf
echo "Hostname=comp1" >> /usr/local/etc/zabbix_agentd.conf
echo "ListenPort=10050" >> /usr/local/etc/zabbix_agentd.conf
echo "LogFile=/var/log/zabbix/zabbix_agentd.log" >> /usr/local/etc/zabbix_agentd.conf
echo "LogFileSize=10" >> /usr/local/etc/zabbix_agentd.conf
echo "StartAgents=3" >> /usr/local/etc/zabbix_agentd.conf
chown -R zabbix:zabbix /var/log/zabbix
chown -R zabbix:zabbix /etc/zabbix
chown -R zabbix:zabbix /usr/local/etc/zabbix_agentd.conf
sudo -u zabbix /usr/local/bin/zabbix_agentd
echo "we must edit this file /usr/local/etc/zabbix_agentd.conf and restart service: sudo -u zabbix /usr/local/bin/zabbix_agentd restart"
Answer the question
In order to leave comments, you need to log in
Add
systemctl enable zabbix-agent to autoload.
Testing, as for me, is better locally
zabbix_agentd -t agent.version
, before rebooting the daemon, then from a remote host added to the SourceIP of the agent under test
1) Why not a package?
2) Autostart must be done through the initialization system adopted in the distribution, do not complicate your life.
3) Try testing via zabbix_get, it's much more convenient.
Put everything from the repo there are all the packages for the sixth centos and everything is installed in a minute and there are all the scripts for restart and autostart
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question