Raspberry Pi 3 下配置zabbix (树莓派3B+基板)
1.下载相应系统并启动树莓派(略)
http://shumeipai.nxez.com/download#os (此次选择官方raspi最新版)
并装系统写入备好的sd系统卡中,树莓派通电做常规配置。
2.系统基础环境准备
扩展剩余sd空间:sudo /usr/local/bin/rootfs-expand
#rootfs-expand
安装vnc服务
sudo apt-get update
sudo apt-get install tightvncserver
控制台输入: vncserver 启动VNC服务
1. 更新Debian Jessie到最新版(OS版本 10 (Buster))
$ su
$ apt-get update
$ apt-get upgrade
$ apt-get dist-upgrade
$ su
$ apt-get update
$ apt-get upgrade
$ apt-get dist-upgrade
2. 将软件源改为Stretch安装源
$ su
$ sed -i 's/jessie/stretch/g' /etc/apt/sources.list
# 替换成国内镜像源(清华大学)
$ sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
$ sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn\/debian-security/g' /etc/apt/sources.list
$ su
$ sed -i 's/jessie/stretch/g' /etc/apt/sources.list
# 替换成国内镜像源(清华大学)
$ sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
$ sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn\/debian-security/g' /etc/apt/sources.list
3. 升级系统版本
$ su
$ apt-get update
$ apt-get dist-upgrade
$ su
$ apt-get update
$ apt-get dist-upgrade
4. 重启
$ su
$ reboot
$ su
$ reboot
5. 更新Debian Stretch到最新版
$ su
$ apt-get update
$ apt-get upgrade
$ apt-get dist-upgrade
$ apt-get autoremove
$ su
$ apt-get update
$ apt-get upgrade
$ apt-get dist-upgrade
$ apt-get autoremove
6. 将软件源改为Buster安装源
$ su
$ sed -i 's/stretch/buster/g' /etc/apt/sources.list
# 替换成国内镜像源(清华大学)
$ sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
$ sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn\/debian-security/g' /etc/apt/sources.list
$ su
$ sed -i 's/stretch/buster/g' /etc/apt/sources.list
# 替换成国内镜像源(清华大学)
$ sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
$ sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn\/debian-security/g' /etc/apt/sources.list
7. 升级系统版本
$ su
$ apt-get update
$ apt-get dist-upgrade
$ su
$ apt-get update
$ apt-get dist-upgrade
8. 重启
$ su
$ reboot
$ su
$ reboot
9. 清理安装包
$ sudo apt-get autoremove
$ sudo apt-get autoremove
3.部署zabbix
# wget https://repo.zabbix.com/zabbix/5.0/raspbian/pool/main/z/zabbix-release/zabbix-release_5.0-1+buster_all.deb
# dpkg -i zabbix-release_5.0-1+buster_all.deb
# apt update
# apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent
# mysql -uroot -p
password
注:此处可能需求重置root密码或重新安装mysql服务。根据实际选择。
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
mysql> quit;
#
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix //速度很慢
vi
/etc/zabbix/zabbix_server.conf
DBPassword=password
vi
/etc/zabbix/apache.conf
# php_value date.timezone
Asia/Shanghai
安装中文环境支持(非必要)
apt-get install ttf-wqy-zenhei
fc-cache
dpkg-reconfigure locales
进入语言配置界面
选择change_locale ---->然后,往下找(键盘-按下键),在较后面,找到 zh_CN.UTF-8 UTF-8
启动服务
# systemctl restart zabbix-server zabbix-agent apache2
# systemctl enable zabbix-server zabbix-agent apache2
http://server_ip_or_name/zabbix
用户名 Admin 以及密码 zabbix 以作为Zabbix超级用户登陆。
---------------------------------------------双网卡工作
ip route //查看路由
修改后的/etc/network/interfaces文件
auto lo
iface lo inet loopback
# ethernet
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.244
netmask 255.255.255.0
#gateway 192.168.1.254
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B
/etc/init.d/networking restart