Suse Linux 15 SP3 安装zabbix-agent 5.x

zabbix官方文档:https://www.zabbix.com/cn/download?zabbix=5.0&os_distribution=suse_linux_enterprise_server&os_version=15&components=agent&db=&ws=

1、安装zabbix repo

sdhqerpapp01:~ # rpm -Uvh --nosignature https://repo.zabbix.com/zabbix/5.0/sles/15/x86_64/zabbix-release-5.0-1.el15.noarch.rpm
Retrieving https://repo.zabbix.com/zabbix/5.0/sles/15/x86_64/zabbix-release-5.0-1.el15.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:zabbix-release-5.0-1.el15        ################################# [100%]

2、查看zabbix repo是否添加

sdhqerpapp01:~ # zypper ls
#  | Alias                              | Name                                    | Enabled | GPG Check | Refresh | Type
---+------------------------------------+-----------------------------------------+---------+-----------+---------+-------
1  | Basesystem-Module_15.3-0           | sle-module-basesystem                   | No      | ----      | ----    | rpm-md
2  | Desktop-Applications-Module_15.3-0 | sle-module-desktop-applications         | No      | ----      | ----    | rpm-md
3  | Development-Tools-Module_15.3-0    | sle-module-development-tools            | No      | ----      | ----    | rpm-md
4  | Legacy-Module_15.3-0               | sle-module-legacy                       | No      | ----      | ----    | rpm-md
5  | SAP-Applications-Module_15.3-0     | sle-module-sap-applications             | No      | ----      | ----    | rpm-md
6  | SLE-15-SP3-SAP-15.3-0              | SLE-15-SP3-SAP-15.3-0                   | No      | ----      | ----    | rpm-md
7  | SLEHA15-SP3_15.3-0                 | sle-ha                                  | No      | ----      | ----    | rpm-md
8  | Server-Applications-Module_15.3-0  | sle-module-server-applications          | No      | ----      | ----    | rpm-md
9  | server_monitoring                  | Server Monitoring Software (SLE_15_SP3) | Yes     | (r ) Yes  | No      | rpm-md
10 | zabbix                             | Zabbix Official Repository              | Yes     | ( p) Yes  | No      | NONE
11 | zabbix-debuginfo                   | Zabbix Official Repository debuginfo    | No      | ----      | ----    | NONE

3、添加gpg check key

sdhqerpapp01:~ # zypper --gpg-auto-import-keys refresh 'Zabbix Official Repository'
Retrieving repository 'Zabbix Official Repository' metadata --------------------------------------------------------------------------------------------------------------------------------------------------[|]

Automatically importing the following key:

  Repository:       Zabbix Official Repository
  Key Name:         Zabbix LLC <packager@zabbix.com>
  Key Fingerprint:  A1848F53 52D022B9 471D83D0 082AB56B A14FE591
  Key Created:      Fri Jul 15 13:39:09 2016
  Key Expires:      (does not expire)
  Subkey:           DF517F33E709712C 2016-07-15 [does not expire]
  Rpm Name:         gpg-pubkey-a14fe591-578876fd


Retrieving repository 'Zabbix Official Repository' metadata ...............................................................................................................................................[done]
Building repository 'Zabbix Official Repository' cache ....................................................................................................................................................[done]
Specified repositories have been refreshed.

sdhqerpapp01:~ # zypper info zabbix-agent  /查看zabbix-agent版本
Loading repository data...
Reading installed packages...


Information for package zabbix-agent:
-------------------------------------
Repository     : Zabbix Official Repository
Name           : zabbix-agent
Version        : 5.0.31-1.el15
Arch           : x86_64
Vendor         : 
Support Level  : unknown
Installed Size : 1.9 MiB
Installed      : No
Status         : not installed
Source package : zabbix-5.0.31-1.el15.src
Summary        : Zabbix agent
Description    : 
    Old implementation of zabbix agent.
    To be installed on monitored systems.

4、安装zabbix-agent 5.0.31

sdhqerpapp01:~ # zypper install zabbix-agent
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
  zabbix-agent

The following package has no support information from its vendor:
  zabbix-agent

1 new package to install.
Overall download size: 425.0 KiB. Already cached: 0 B. After the operation, additional 1.9 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package zabbix-agent-5.0.31-1.el15.x86_64                                                                                                                        (1/1), 425.0 KiB (  1.9 MiB unpacked)
Retrieving: zabbix-agent-5.0.31-1.el15.x86_64.rpm ............................................................................................................................................[done (32.7 KiB/s)]

Checking for file conflicts: ..............................................................................................................................................................................[done]
(1/1) Installing: zabbix-agent-5.0.31-1.el15.x86_64 .......................................................................................................................................................[done]
Executing %posttrans scripts ..............................................................................................................................................................................[done]

5、配置启动

sdhqerpapp01:~ # vim /etc/zabbix/zabbix_agentd.conf 
sdhqerpapp01:~ # systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
     Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; disabled; vendor preset: disabled)
     Active: inactive (dead)
sdhqerpapp01:~ # systemctl start zabbix-agent
sdhqerpapp01:~ # systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
     Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; disabled; vendor preset: disabled)
     Active: active (running) since Sat 2023-02-18 09:19:47 CST; 8s ago
    Process: 122361 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
   Main PID: 122363 (zabbix_agentd)
      Tasks: 6
     CGroup: /system.slice/zabbix-agent.service
             ├─122363 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
             ├─122364 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
             ├─122365 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
             ├─122366 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
             ├─122367 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
             └─122368 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]

Feb 18 09:19:47 sdhqerpapp01 systemd[1]: Starting Zabbix Agent...
Feb 18 09:19:47 sdhqerpapp01 systemd[1]: Started Zabbix Agent.
sdhqerpapp01:~ # netstat -tulnp |grep 10050
tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN      122363/zabbix_agent 
tcp6       0      0 :::10050                :::*                    LISTEN      122363/zabbix_agent 
sdhqerpapp01:~ # systemctl enable zabbix-agent
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-agent.service → /usr/lib/systemd/system/zabbix-agent.service.
posted @ 2023-02-18 09:29  烟雨浮华  阅读(399)  评论(0编辑  收藏  举报