1.安装数据库
# wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-2+xenial_all.deb
# dpkg -i zabbix-release_4.0-2+xenial_all.deb
# apt update
2.安装Zabbix server,Web前端,agent
# apt -y install zabbix-server-mysql zabbix-frontend-php zabbix-agent
# mysql -uroot -p
password //passwor自己配置
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password'; ////passwor自己配置
mysql> quit;
4.导入初始架构和数据,系统将提示您输入新创建的密码。
# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
5.为Zabbix server配置数据库
编辑配置文件 /etc/zabbix/zabbix_server.conf
DBPassword=password //passwor自己配置
6.为Zabbix前端配置PHP
编辑配置文件 /etc/zabbix/apache.conf, uncomment and set the right timezone for you.
# php_value date.timezone Europe/Riga // php_value date.timezone Asia/Shanghai
7.启动Zabbix server和agent进程
启动Zabbix server和agent进程,并为它们设置开机自启:
# systemctl restart zabbix-server zabbix-agent apache2
# systemctl enable zabbix-server zabbix-agent apache2
配置Zabbix前端
连接到新安装的Zabbix前端: http://server_ip_or_name/zabbix
1.安装数据库
# wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-2+xenial_all.deb
# dpkg -i zabbix-release_4.0-2+xenial_all.deb
# apt update
2.安装Zabbix server,Web前端,agent
# apt -y install zabbix-agent
3.配置文件
# vim /etc/zabbix/zabbix_agentd.conf
Server=127.0.0.1 #Server端的IP地址。
ServerActive=127.0.0.1 # zabbix server 端口10051可以默认。
Hostname=ZabbixServer #必须与zabbix server端创建主机时候输入的zabbix agent端的host name一致。
Server和ServerActive都要根据实际情况指定zabbix server的IP地址。Server是用来允许zabbix server的这个IP来主动取数据,ServerActive 是客户端主动提交数据给zabbix server端。
4.重启
# service zabbix-agent restar
1.测试zabbix-server服务端和zabbix-agent客户端是否连通
# telnet ZABBIX_AGENT_IP 10050
2.zabbix-server 的默认端口是10051, zabbix-agent的默认端口是10050
# vim /etc/zabbix/apache.conf
“# php_value date.timezone Europe/Riga " 改成
“php_value date.timezone Asia/Shanghai”
# vim /usr/share/zabbix/include/locales.inc.php
You are not able to choose some of the languages, because locales for them are not installed on the web server.
解决方法:安装中文语音包
apt-get install -y language-pack-kde-zh-hans
sudo service apache2 restart
打开VMware,虚拟机–设置–(硬件)网路适配器–网络连接选择桥接模式