centos7以yum方式安装zabbix-agent客户端服务
2021/7/3 7:25:13
本文主要是介绍centos7以yum方式安装zabbix-agent客户端服务,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
一、安装zabbix-agent3.2版本的yum源文件
[root@localhost home]# rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
二、修改zabbix的repo文件里的yum源地址为阿里云镜像地址
[root@localhost home]# vim /etc/yum.repos.d/zabbix.repo
[zabbix] name=Zabbix Official Repository - $basearch baseurl=http://mirrors.aliyun.com/zabbix/zabbix/3.2/rhel/7/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591 [zabbix-non-supported] name=Zabbix Official Repository non-supported - $basearch baseurl=http://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/ enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX gpgcheck=1
三、yum安装zabbix-agent
[root@localhost home]# yum install zabbix-agent
四、修改zabbix-agent的配置文件
[root@localhost zabbix]# vim /etc/zabbix/zabbix_agentd.conf
Server=172.28.18.75 ServerActive=172.28.18.75 Hostname=172.28.5.124
五、修改zabbix-agent服务配置为开机自启动
[root@localhost zabbix]# systemctl list-unit-files|grep zabbix zabbix-agent.service disabled [root@localhost zabbix]#
当前默认是禁止自启动的,我们修改为开机自启动
[root@localhost zabbix]# systemctl enable zabbix-agent.service Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.
再次查看
[root@localhost zabbix]# systemctl is-enabled zabbix-agent.service enabled
六、启动zabbix-agent服务
[root@localhost zabbix]# systemctl start zabbix-agent.service
查看
[root@localhost zabbix]# systemctl status zabbix-agent.service ● zabbix-agent.service - Zabbix Agent Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: disabled) Active: active (running) since 五 2021-07-02 17:20:36 CST; 7s ago Process: 14798 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS) Main PID: 14800 (zabbix_agentd) CGroup: /system.slice/zabbix-agent.service ├─14800 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf ├─14801 /usr/sbin/zabbix_agentd: collector [idle 1 sec] ├─14802 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection] ├─14803 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection] ├─14804 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection] └─14805 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec] 7月 02 17:20:36 localhost.localdomain systemd[1]: Starting Zabbix Agent... 7月 02 17:20:36 localhost.localdomain systemd[1]: Started Zabbix Agent. [root@localhost zabbix]#
启动成功,在zabbix server上执行
[root@zabbix_server home]# zabbix_get -s 172.28.5.124 -p 10050 -k 'system.uname' Linux localhost.localdomain 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 [root@zabbix_server home]#
成功获取服务器信息。
这篇关于centos7以yum方式安装zabbix-agent客户端服务的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-09-28pyqt 怎么打包整个项目-icode9专业技术文章分享
- 2024-09-28laravel Commands 创建带有参数的 Artisan 命令的步骤和示例-icode9专业技术文章分享
- 2024-09-28antd怎么实现渲染tiff图片-icode9专业技术文章分享
- 2024-09-28英文半角中划线和中文全角的中划线有什么区别-icode9专业技术文章分享
- 2024-09-28nvm npm 和node 他们之间有什么关系-icode9专业技术文章分享
- 2024-09-28Node Version Manager (nvm)使用教程-icode9专业技术文章分享
- 2024-09-28nvm命令太慢,是什么原因-icode9专业技术文章分享
- 2024-09-28Kotlin 如何增加、删除和修改 MutableStateFlow 中的值。-icode9专业技术文章分享
- 2024-09-28Kotlin的stateFlow.update 写法介绍-icode9专业技术文章分享
- 2024-09-28kotlin 怎么获取当前时间格式-icode9专业技术文章分享