กลุ่มชุมชนแลกเปลี่ยนความรู้แบ่งปั่น และช่วยเหลือ ต่อการใช้งาน OpenSource Zabbix เพราะการแบ่งปัน นั้นยิ่งใหญ่กว่า.

วิธีทำให้ zabbix server สามารถใช้งานได้โดยไม่ต้องปิด selinux (How to add policy to selinux?)

สำหรับเพื่อนๆชาว zabbix in thailand
คงจะมีหลายคนเจอปัญหาว่า ถ้าเปิด selinux จะทำให้ไม่สามารถใช้งาน zabbix server ได้

อาการ (Symptom):
1. ไม่สามารถ start zabbix server ได้
2. เข้าหน้า web แล้วจะพบตัวเตือนว่า zabbix server อาจจะไม่ได้รันอยู่







ลองทำตามขั้นตอนนะครับ

สร้างไฟล์ ชื่อ zabbix_server.te ก่อนครับ

module zabbix_server 1.0;

require {
type fs_t;
type zabbix_t;
type zabbix_port_t;
type gssproxy_t;
type zabbix_var_run_t;
type httpd_t;
class sock_file { create unlink };
class tcp_socket name_connect;
class unix_stream_socket connectto;
class process setrlimit;
class filesystem getattr;
}

#============= gssproxy_t ==============

#!!!! This avc is allowed in the current policy
allow gssproxy_t fs_t:filesystem getattr;

#============= httpd_t ==============

#!!!! This avc can be allowed using one of the these booleans:
#     httpd_can_network_connect, httpd_can_connect_zabbix
allow httpd_t zabbix_port_t:tcp_socket name_connect;

#============= zabbix_t ==============

#!!!! This avc is allowed in the current policy
allow zabbix_t self:process setrlimit;

#!!!! This avc is allowed in the current policy
allow zabbix_t self:unix_stream_socket connectto;

#!!!! This avc is allowed in the current policy


allow zabbix_t zabbix_var_run_t:sock_file { create unlink };





แล้วรัน command ตามนี้ต่อครับ

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

semodule_package -o zabbix_server.pp -m zabbix_server.mod

semodule -i zabbix_server.pp


แล้วลอง start service ครับ
ทีนี้เราจะสามารถรัน zabbix server ได้แล้วครับ

หากท่านใด เข้าใจ linux ดีแล้วก็จะเข้าใจ config นี้ครับ ส่วนวิธีการเตรียม config ไว้ติดตามใน course advance จากทางทีมงานครับ

Natthakrit Pongkanaputinad

Share:

ไม่มีความคิดเห็น:

แสดงความคิดเห็น

 
Zabbix in Thailand
Facebook Group · 701 members
Join Group
กลุ่มนี้จัดตั้งขึ้นเพื่อแลกเปลี่ยนความรู้ของ zabbix ใครมีคู่มือ เทคนิค หรือ ปัญหา มาร่วมมือกันแก้ไขกันสำหรับชาวไทย -----------------------------------...
 

Popular

ค้นหาบล็อกนี้

Labels

Comments

Labels

Recent Posts