Tips: (PRTG 04.01) Hướng dẫn cài đặt Nagios v4.1.1 trên CentOSv7

By , 0 View

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.service
systemctl 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/selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

systemctl disable firewalld
systemctl stop firewalld 

Tạo user để tiến trình Nagios chạy.
useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache

Cài đặt Nagios Core trên CentOSv7.
cd /tmp
wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.1.1.tar.gz
tar zxf nagios-4.1.1.tar.gz
cd nagios-4.1.1
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf

Tạo user để truy cập Nagios WebSite.
[root@localhost nagios-4.1.1]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password: 
Re-type new password: 
Adding password for user nagiosadmin
[root@localhost nagios-4.1.1]# 

Cài đặt Nagios Plugins.
cd /tmp
wget http://www.nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz
tar zxf nagios-plugins-2.1.1.tar.gz
cd /tmp/nagios-plugins-2.1.1
./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl
make all
make install

Khởi động dịch vụ nagios và httpd.
service httpd start
service 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.

You Might Also Like

0 comments