Mục tiêu thực hành:
- Cài đặt gói LAMP Stack (Apache, MariaDB, PHPv7) trên CentOSv7.
- Cài đặt các gói cần thiết Required Packages trên CentOSv7.
- Tắt Selinux và Firewall trên CentOSv7.
- Tạo user để tiến trình Nagios chạy.
- Cài đặt Nagios Core trên CentOSv7.
- Tạo user để truy cập Nagios WebSite.
- Cài đặt Nagios Plugins.
- Khởi động dịch vụ nagios và httpd.
- Truy cập vào giao diện Nagios WebPage.
Các bước triển khai:
Cài đặt gói LAMP Stack (Apache, MariaDB, PHPv7) trên CentOSv7.
yum install httpd mariadb-server php php-mysql php-cli
- Enable MariaDB and Apache to start on boot.
systemctl enable httpd.servicesystemctl enable mariadb.service
Cài đặt các gói cần thiết Required Packages trên CentOSv7.
- The following packages are also be required by the Nagios Core software.
yum install gcc glibc glibc-common wget gd gd-devel perl postfix net-snmp openssl-devel unzip -y
Tắt Selinux và Firewall trên CentOSv7.
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinuxsed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
systemctl disable firewalldsystemctl stop firewalld
Tạo user để tiến trình Nagios chạy.
useradd nagiosgroupadd nagcmdusermod -a -G nagcmd nagiosusermod -a -G nagcmd apache
Cài đặt Nagios Core trên CentOSv7.
cd /tmpwget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.1.1.tar.gztar zxf nagios-4.1.1.tar.gzcd nagios-4.1.1./configure --with-command-group=nagcmdmake allmake installmake install-initmake install-configmake install-commandmodemake install-webconf
Tạo user để truy cập Nagios WebSite.
[root@localhost nagios-4.1.1]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadminNew password:Re-type new password:Adding password for user nagiosadmin[root@localhost nagios-4.1.1]#
Cài đặt Nagios Plugins.
cd /tmpwget http://www.nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gztar zxf nagios-plugins-2.1.1.tar.gzcd /tmp/nagios-plugins-2.1.1./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-opensslmake allmake install
Khởi động dịch vụ nagios và httpd.
service httpd startservice nagios start
Truy cập vào giao diện Nagios WebPage.
- Link: http://192.168.100.248/nagios/
Mọi thông tin chi tiết, các bạn có thể liên hệ với mình thông qua kênh Zalo (Jade Bùi) 076.877.2021.
0 comments