zabbix-agent ubuntu install




작성자 기준 테스트 환경 : Ubuntu-18.04.4(LTS)  - 최소 설치 (minimal) 기준

Linux yunli 4.15.0-76-generic #86-Ubuntu SMP Fri Jan 17 17:24:28 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux





  1. network configuration

$ vi /etc/netplan/50-cloud-init.yaml

.. ...

# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:

# network: {config: disabled}

network:

    ethernets: {}

    version: 2

    renderer:   networkd

    ethernets:

            eth0:

                    addresses:

                               - 192.168.137.61/24

                    gateway4:   192.168.137.1

                    nameservers:

                            addresses:

                               [168.126.63.1,168.126.63.2]

 

$ netplan apply















  1. agent install 

reference URL

 

https://www.zabbix.com/documentation/3.0/manual/installation/upgrade_packages/debian_ubuntu

 

https://www.zabbix.com/download_agents?version=4.0+LTS&release=4.0.0&os=Ubuntu&os_version=18&hardware=i386&encryption=GnuTLS&packaging=Archive



ubuntu 버전에 맞는 zabbix-server 3.0 dpkg 다운로드 받은 후에 아래 작업




$ dpkg -i zabbix-release_3.0-2+bionic_all.deb

Selecting previously unselected package zabbix-release.

(Reading database ... 66964 files and directories currently installed.)

Preparing to unpack zabbix-release_3.0-2+bionic_all.deb ...

Unpacking zabbix-release (3.0-2+bionic) ...

Setting up zabbix-release (3.0-2+bionic) …

 

$ apt-get update

Get:1 http://repo.zabbix.com/zabbix/3.0/ubuntu bionic InRelease [7,096 B]

Get:2 http://repo.zabbix.com/zabbix/3.0/ubuntu bionic/main Sources [1,196 B]

Get:3 http://repo.zabbix.com/zabbix/3.0/ubuntu bionic/main amd64 Packages [2,648 B]

Hit:4 http://archive.ubuntu.com/ubuntu bionic InRelease

Get:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]

Get:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]

Get:7 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]

Fetched 263 kB in 3s (82.0 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 26 not upgraded.

Need to get 160 kB of archives.

After this operation, 630 kB of additional disk space will be used.

Get:1 http://repo.zabbix.com/zabbix/3.0/ubuntu bionic/main amd64 zabbix-agent amd64 1:3.0.30-1+bionic [160 kB]

Fetched 160 kB in 1s (141 kB/s)

Selecting previously unselected package zabbix-agent.

(Reading database ... 66970 files and directories currently installed.)

Preparing to unpack .../zabbix-agent_1%3a3.0.30-1+bionic_amd64.deb ...

Unpacking zabbix-agent (1:3.0.30-1+bionic) ...

Setting up zabbix-agent (1:3.0.30-1+bionic) ...

Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

Processing triggers for ureadahead (0.100.0-21) ...

Processing triggers for systemd (237-3ubuntu10.33) …

 

root@yunli:/usr/local/src# /etc/init.d/zabbix-agent start

 

// 설치 확인

$ netstat -nlpt

$ ps -ef | grep -i zabbix



  1. zabbix configuration (환경설정 - zabbix-server 환경설정에 맞추어서 작업 진행 해야합니다. )

  • 환경 설정 작업 전에는 항상 conf 파일 백업 해두는 것이 좋습니다.

 

$ vi /etc/zabbix/zabbix_agentd.conf

 

## 수정 start ##

95 Server=127.0.0.1

→  95 Server=192.168.137.43

 

136 ServerActive=127.0.0.1

→  136 ServerActive=192.168.137.43

 

147 Hostname=Zabbix server

→ 147 Hostname=zabbix.masangsoft.kr

 

## 수정 End ##

 

247 # AllowRoot=0

248 AllowRoot=1   ## 추가 




  1. 기타 (서버 설정마다 다름)

방화벽 설정이 되어있다면 해당 방화벽 설정에 맞게 추가 해줘야합니다.

10050 port 추가 

서버 설정에 맞게 자동 재시작 등록 해줘야 합니다.





  1. 확인

 

root@yunli:/usr/local/src# /etc/init.d/zabbix-agent start

[ ok ] Starting zabbix-agent (via systemctl): zabbix-agent.service.

root@yunli:/usr/local/src# netstat -nlpt

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

tcp            0 0.0.0.0:10050           0.0.0.0:*               LISTEN      3553/zabbix_agentd

tcp            0 127.0.0.53:53           0.0.0.0:*               LISTEN      864/systemd-resolve

tcp            0 0.0.0.0:22              0.0.0.0:*               LISTEN      1376/sshd

tcp6           0 :::10050                :::*                    LISTEN      3553/zabbix_agentd

tcp6           0 :::22                   :::*                    LISTEN      1376/sshd

root@yunli:/usr/local/src# ps -ef | grep -i zabbix

zabbix    3553     1  0 05:14 ?        00:00:00 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf

zabbix    3554  3553 0 05:14 ?        00:00:00 /usr/sbin/zabbix_agentd: collector [idle 1 sec]

zabbix    3555  3553 0 05:14 ?        00:00:00 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]

zabbix    3556  3553 0 05:14 ?        00:00:00 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]

zabbix    3557  3553 0 05:14 ?        00:00:00 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]

zabbix    3558  3553 0 05:14 ?        00:00:00 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]

root      3820  3021 0 05:36 pts/2    00:00:00 grep --color=auto -i zabbix



 

'01_install (강좌) > 12_Zabbix' 카테고리의 다른 글

zabbix-server_3.0(LTS) install #!!!  (0) 2020.03.12

zabbix-server install

작성자 기준 테스트 환경 : 

Linux localhost.localdomain 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

centos-release-7-4.1708.el7.centos.x86_64

 

minimal 로 설치 했기 때문에 ifconfig 명령어가 없어 net-tools 설치 해야 합니다.

 

 

ifconfig not found

 

net-tools install



작업 전에 firewalld 를 iptables 변경해 줍니다. 추후 geoip 모듈을 올릴 수도 있고, iptables가 자세한 룰셋 설정시 더 익숙한 이유 입니다.

selinux disabled 도 해주세요.

 

  1. zabbix-server agent mysql install

 

$ rpm -Uvh https://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

 

$ yum clean all 

 

$ yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent 

 

$ yum install mysql mariadb-server



## 설치된 패키지 확인 ##

zabbix-web-mysql-3.0.30-2.el7.noarch

zabbix-server-mysql-3.0.30-2.el7.x86_64

zabbix-release-3.0-1.el7.noarch

zabbix-web-3.0.30-2.el7.noarch

zabbix-agent-3.0.30-2.el7.x86_64

 

php-5.4.16-46.1.el7_7.x86_64

mariadb-5.5.64-1.el7.x86_64

httpd-2.4.6-90.el7.centos.x86_64



$ php -i | grep -i Configuration

Loaded Configuration File => /etc/php.ini

 

$ vi /etc/php.ini

;date.timezone =

date.timezone = Asia/Seoul ## added



$ systemctl start mariadb ; systemctl enable mariadb

 

$ mysql_secure_installation

패스워드 입력하고 yyyyyy 

 

$ mysql -uroot -p

password

mysql> use mysql;

mysql> create database zabbix character set utf8 collate utf8_bin;

mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'eoqkraktkdthvmxm)#)@';

mysql> use zabbix; show tables;

mysql> quit; 



$ zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix 

 

$ mysql -u root -p

mysql> use zabbix; show tables;

## rows 113 confirm



$ vi /etc/zabbix/zabbix_server.conf

DBPassword=password 



$ php_value date.timezone Europe/Riga 

 

$ systemctl restart zabbix-server zabbix-agent httpd

 

$ netstat -nlpt

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

tcp            0 0.0.0.0:22              0.0.0.0:*               LISTEN      739/sshd

tcp            0 0.0.0.0:10050           0.0.0.0:*               LISTEN      1610/zabbix_agentd

tcp            0 0.0.0.0:10051           0.0.0.0:*               LISTEN      1617/zabbix_server

tcp            0 0.0.0.0:3306            0.0.0.0:*               LISTEN      1457/mysqld

 

$ systemctl enable zabbix-server zabbix-agent httpd mariadb

$ systemctl status zabbix-server zabbix-agent httpd mariadb

 

## 설정 완료 되었습니다. init 6 리부팅 테스트를 해보세요 ##



  1. zabbix-server configuration

 

$ php -i | grep -i Configuration

Loaded Configuration File => /etc/php.ini

 

$ vi /etc/php.ini

;date.timezone =

date.timezone = Asia/Seoul ## added

 

'01_install (강좌) > 12_Zabbix' 카테고리의 다른 글

zabbix-agent ubuntu install #!!!  (0) 2020.03.12

+ Recent posts