[Monitoring] 09. Zabbix (CentOS Stream 8 기준) - 모니터링 대상 추가(CentOS)

Date:     Updated:

카테고리:

태그:


09. 모니터링 대상 추가(CentOS)



■ 모니터링 대상으로 추가하려는 서버에 Zabbix Agent를 설치 및 설정

{
    dnf -y install https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-1.el8.noarch.rpm
    dnf -y install zabbix-agent
}
vi /etc/zabbix/zabbix_agentd.conf

# line 117 : Zabbix 서버 지정
Server=192.168.219.134

# line 164 : Zabbix 서버 지정
ServerActive=192.168.219.134

# line 175 : 호스트 이름 또는 IP 주소로 변경
Hostname=node01.test.srv


systemctl enable --now zabbix-agent


■ SELinux가 활성화된 경우


setsebool -P domain_can_mmap_files on


vi zabbix_agent.te
# create new
module zabbix_agent 1.0;

require {
        type initctl_t;
        type zabbix_agent_t;
        type devlog_t;
        type proc_kcore_t;
        type rpm_exec_t;
        type rpm_var_lib_t;
        class fifo_file getattr;
        class sock_file getattr;
        class file { execute execute_no_trans map open getattr };
}

#============= zabbix_agent_t ==============
allow zabbix_agent_t devlog_t:sock_file getattr;
allow zabbix_agent_t initctl_t:fifo_file getattr;
allow zabbix_agent_t proc_kcore_t:file getattr;
allow zabbix_agent_t rpm_var_lib_t:file open;
allow zabbix_agent_t rpm_exec_t:file { execute execute_no_trans map };


checkmodule -m -M -o zabbix_agent.mod zabbix_agent.te

semodule_package --outfile zabbix_agent.pp --module zabbix_agent.mod

semodule -i zabbix_agent.pp


■ Firewalld이 활성화된 경우

firewall-cmd --add-port=10050/tcp

firewall-cmd --runtime-to-permanent


■ [Configuration]-[Hosts]에서 [Create Host] 버튼을 클릭

015


■ [Hostname]에 호스트 이름을 입력하고, [Interfaces]에 IP 주소와 DNS 이름을 입력한다.

016


■ [Templates] 필드에서 [Select] 버튼을 클릭

17-1


▶ [Templates/Operating systems] 선택

17-2


▶ [Template OS Linux by Zabbix agent] 선택

017-3


■ [Groups] 필드에서 [Select] 버튼을 클릭 후, [Linux Servers] 선택

18


■ 항목을 설정한 후 [Add] 버튼을 클릭

019


■ 새로운 모니터링 대상이 추가되고, 몇 분 후 모니터링 데이터는 다음과 같이 수집된다.

020

021

MONITORING 카테고리 내 다른 글 보러가기

댓글 남기기