Skip to content

Instantly share code, notes, and snippets.

@vncloudsco
Forked from coder4web/zabbix_setup.sh
Created March 23, 2019 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vncloudsco/d236e5cad88a127d497b811f5ba0aa54 to your computer and use it in GitHub Desktop.
Save vncloudsco/d236e5cad88a127d497b811f5ba0aa54 to your computer and use it in GitHub Desktop.
Zabbix setup (CentOS. RHEL)
# ------------------------
# agent
# ------------------------
sudo rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
sudo yum list zabbix-agent
sudo yum install zabbix-agent
sudo firewall-cmd --zone=public --add-port=10050/tcp
sudo firewall-cmd --zone=public --add-port=10050/tcp --permanent
sudo semanage permissive -a zabbix_agent_t
sudo systemctl enable zabbix-agent.service
tail /var/log/zabbix/zabbix_agentd.log
# ------------------------
# telnet to agent
# ------------------------
telnet HOST 10050
system.cpu.load[,avg1]
# ------------------------
# permanent tunnel to agent via PROXY_IP
# ------------------------
autossh -M 0 -f -N -L PROXY_IP:10150:localhost:10050 user@agent.server
sudo firewall-cmd --zone=public --add-port=10150/tcp
sudo firewall-cmd --zone=public --add-port=10150/tcp --permanent
# ------------------------
# UNSORTED!
# ------------------------
wget http://repo.zabbix.com/zabbix/3.4/debian/pool/main/z/zabbix-release/zabbix-release_3.4-1+stretch_all.deb
dpkg -i zabbix-release_3.4-1+stretch_all.deb
apt-get update
apt-get install zabbix-server-mysql zabbix-frontend-php
#mysql
#https://www.zabbix.com/documentation/3.4/manual/appendix/install/db_scripts
create database zabbix_s1 character set utf8 collate utf8_bin;
grant all privileges on zabbix_S1.* to zabbix@localhost identified by 'chaesh6aez2eeMai';
zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -p zabbix_s1
nano /etc/zabbix/zabbix_server.conf
DBName=
DBPassword=
#service zabbix-server start
systemctl enable zabbix-server.service
systemctl start zabbix-server.service
systemctl status zabbix-server.service
cp /usr/share/zabbix /srv/sites/php/
nano /etc/zabbix/zabbix_agentd.conf
Server=94.142.141.230
ServerActive=94.142.141.230
Hostname=example.com
sudo firewall-cmd --add-port=10050/tcp
sudo firewall-cmd --add-port=10050/tcp --permanent
systemctl enable zabbix-agent.service
systemctl start zabbix-agent.service
systemctl status zabbix-agent.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment