useradd -r zabbix
mkdir /etc/zabbix/
repository zabbix http://repo.zabbix.com/zabbix/3.2/
RHEL7 : rpm -Uvh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm yum install zabbix-agent
scp root@vlbid41x.ft.grp:/usr/bin/zabbix* /usr/bin/
scp root@vlbid41x.ft.grp:/usr/sbin/zabbix* /usr/sbin/
scp root@vlbid41x.ft.grp:/etc/zabbix/zabbix_agentd.conf /etc/zabbix/
cd /exploit/scripts
scp admse_efougere@wctsrv0011.wabtec.com:/exploit/scripts/zab_*.sh .
vim /etc/zabbix/zabbix_agentd.conf
Hostname=WCTSRV00XX.wabtec.com PidFile=/run/zabbix/zabbix_agentd.pid ListenIP=10.129.32.XX UserParameter=zab_mem_free,/exploit/scripts/zab_mem_free.sh UserParameter=zab_proc_mem[*],/exploit/scripts/zab_proc_mem.sh $1 UserParameter=zab_proc_cpu[*],/exploit/scripts/zab_proc_cpu.sh $1 UserParameter=zab_test_port[*],/exploit/scripts/zab_test_port.sh $1 $2
ln -s "/etc/zabbix/zabbix_agentd.conf" "/usr/local/etc/zabbix_agentd.conf"
vim /lib/systemd/system/zabbix-agent.service
[Unit] Description=Zabbix Agent After=syslog.target After=network.target [Service] Environment="CONFFILE=/etc/zabbix/zabbix_agentd.conf" #EnvironmentFile=-/etc/sysconfig/zabbix-agent Type=forking Restart=on-failure PIDFile=/run/zabbix/zabbix_agentd.pid KillMode=control-group ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE ExecStop=/bin/kill -SIGTERM $MAINPID RestartSec=10s [Install] WantedBy=multi-user.target
rm /exploit/logs/zabbix_agentd.log
systemctl stop zabbix-agent.service
systemctl start zabbix-agent.service
systemctl status zabbix-agent.service
(éventuellement refaire un stop + start)
—– log dans :
cat /var/log/messages
Test the proper operation of the agent
Connect on vmoni with root account
cd /usr/local/bin
root@vmoni:~# zabbix_get -p 10050 -k agent.version -s servername