# zabbix_onkey **Repository Path**: sofm7777/zabbix_onkey ## Basic Information - **Project Name**: zabbix_onkey - **Description**: zabbix5.x一键安装脚本 - **Primary Language**: Shell - **License**: GPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 2 - **Created**: 2021-11-24 - **Last Updated**: 2021-11-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # zabbix_onkey #### 介绍 zabbix5.x一键安装脚本 官方网站:https://www.zabbix.com/ #### 使用方法 ``` yum install -y wget ``` curl -O https://gitee.com/mybbsky_admin_admin/zabbix_onkey/raw/master/install_zabbix.sh && chmod +x install_zabbix.sh && bash install_zabbix.sh ``` 或 ``` wget -N --no-check-certificate https://gitee.com/mybbsky_admin_admin/zabbix_onkey/raw/master/install_zabbix.sh && chmod +x install_zabbix.sh && bash install_zabbix.sh ``` #### linux下安装agent yum install zabbix-agent -y vim /etc/zabbix/zabbix_agentd.conf #agent配置文件 PidFile=/var/run/zabbix/zabbix_agentd.pid #pid文件地址 LogFile=/var/log/zabbix/zabbix_agentd.log #log文件的地址 Server=192.168.8.19 #zabbix_server的IP地址 ListenIP=192.168.8.22 #zabbix_agent的监听地址 ServerActive=192.168.8.19 #agent主动汇报的一个地址(一般改为server的IP地址) Hostname=192.168.8.22 #agent的用户名(一般可修改为IP) Include=/etc/zabbix/zabbix_agentd.d/*.conf #引入有效配置文件 # UnsafeUserParameters=0 #自定义key systemctl start zabbix-agent #启动zabbix_agent ps -ef |grep zabbix_agent #查看zabbix_agent 可直接在zabbix-server端测试是否能连接zabbix-agent,如下: [root@localhost ~]# /usr/local/zabbix/bin/zabbix_get --help #查看zabbix_get命令 /usr/local/zabbix/bin/zabbix_get -s 192.168.8.22 -p 10050 -k "system.cpu.load[all,avg1]" /usr/local/zabbix/bin/zabbix_get -s 192.168.8.22 -p 10050 -k "system.hostname" 如有回值,则代表正在监听中 防火墙及selinux是需要关闭的。 #### 被控端下载 5.0 LTS windows版本: Zabbix agent v5.0.14 https://cdn.zabbix.com/zabbix/binaries/stable/5.0/5.0.14/zabbix_agent-5.0.14-windows-amd64-openssl.msi Zabbix agent 2 v5.0.14 https://cdn.zabbix.com/zabbix/binaries/stable/5.0/5.0.14/zabbix_agent2-5.0.14-windows-amd64-openssl.msi Linux版本: Zabbix agent v5.0.14 https://cdn.zabbix.com/zabbix/binaries/stable/5.4/5.4.3/zabbix_agent-5.4.3-linux-3.0-amd64-static.tar.gz 其他系统版本: https://www.zabbix.com/download #### 注意事项 初始化数据库那里最好是选N,以免后面出错 安装完毕后访问需要域名,如果没有域名可以 修改host表指定 或者修改/etc/opt/rh/rh-nginx116/nginx/conf.d/nginx.conf root /opt/rh/rh-nginx116/root/usr/share/nginx/html默认的路径 为 root /usr/share/zabbix