Ubuntu 18 버전에서 zabbix agent 설치

기술문서/Ubuntu|2018.11.20 10:42
1. Zabbix repositories 추가 및 설치 하기 

# wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+bionic_all.deb

--2018-10-10 10:09:35--  http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+bionic_all.deb
Resolving repo.zabbix.com (repo.zabbix.com)... 162.243.159.138
Connecting to repo.zabbix.com (repo.zabbix.com)|162.243.159.138|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3952 (3.9K) [application/octet-stream]
Saving to: ‘zabbix-release_3.4-1+bionic_all.deb’

zabbix-release_3.4-1+bionic_all.deb          100%[===========================================================================================>]   3.86K  --.-KB/s    in 0s

2018-10-10 10:09:35 (239 MB/s) - ‘zabbix-release_3.4-1+bionic_all.deb’ saved [3952/3952]



그 외 버전
Zabbix agent 3.5-1 : http://repo.zabbix.com/zabbix/3.5/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.5-1%2Bbionic_all.deb
zabbix agent 4.0-2 : http://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-2%2Bbionic_all.deb


# dpkg -i zabbix-release_3.4-1+bionic_all.deb

Selecting previously unselected package zabbix-release.
(Reading database ... 108215 files and directories currently installed.)
Preparing to unpack zabbix-release_3.4-1+bionic_all.deb ...
Unpacking zabbix-release (3.4-1+bionic) ...
Setting up zabbix-release (3.4-1+bionic) ...
root@redmine:~/zabbix# sudo apt-get install zabbix-agent
Reading package lists... Done
Building dependency tree
Reading state information... Done


# apt-get update

Get:1 http://repo.zabbix.com/zabbix/3.4/ubuntu bionic InRelease [7,096 B]
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://repo.zabbix.com/zabbix/3.4/ubuntu bionic/main Sources [1,179 B]
Get:4 http://repo.zabbix.com/zabbix/3.4/ubuntu bionic/main amd64 Packages [2,682 B]
Get:5 http://archive.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [439 kB]
Fetched 622 kB in 4s (144 kB/s)
Reading package lists... Done


# apt-get install zabbix-agent

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  zabbix-agent
0 upgraded, 1 newly installed, 0 to remove and 24 not upgraded.
Need to get 167 kB of archives.
After this operation, 658 kB of additional disk space will be used.
Get:1 http://repo.zabbix.com/zabbix/3.4/ubuntu bionic/main amd64 zabbix-agent amd64 1:3.4.15-1+bionic [167 kB]
Fetched 167 kB in 1s (191 kB/s)
Selecting previously unselected package zabbix-agent.
(Reading database ... 108221 files and directories currently installed.)
Preparing to unpack .../zabbix-agent_1%3a3.4.15-1+bionic_amd64.deb ...
Unpacking zabbix-agent (1:3.4.15-1+bionic) ...
Processing triggers for ureadahead (0.100.0-20) ...
Setting up zabbix-agent (1:3.4.15-1+bionic) ...
Processing triggers for systemd (237-3ubuntu10.9) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-20) ...



2. Zabbix-agent 설정 하기 

vi /etc/zabbix/zabbix_agentd.conf

Server=192.168.100.100 -> Zabbix 서버 IP
ServerActive=192.168.100.100 -> Zabbix 서버 IP
Hostname=ubuntu1804 -> zabbix agent의 hostname


3. Zabbix-agent  서비스 재시작

# systemctl restart zabbix-agent


4. Zabbix-agent  서비스 상태 확인

# systemctl status zabbix-agent

● zabbix-agent.service - Zabbix Agent
   Loaded: loaded (/lib/systemd/system/zabbix-agent.service; disabled; vendor preset: enabled)
   Active: active (running) since Tue 2018-10-10 10:14:07 KST; 33s ago
  Process: 482 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
  Process: 483 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 492 (zabbix_agentd)
    Tasks: 6 (limit: 4915)
   CGroup: /system.slice/zabbix-agent.service
           ├─492 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
           ├─493 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
           ├─494 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
           ├─495 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
           ├─496 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
           └─498 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]

Nov 10 10:14:07 redmine systemd[1]: Starting Zabbix Agent...
Nov 10 10:14:07 redmine systemd[1]: zabbix-agent.service: Supervising process 492 which is not our child. We'll most likely not notice when it exits.
Nov 10 10:14:07 redmine systemd[1]: Started Zabbix Agent.



*옵션 : 방화벽을 사용하는 경우 10050번 포트 오픈

# ufw allow 10050/tcp


댓글(0)