Tips: (PRTG 04.02) Thiết lập Sensor Ping trên Nagios v4.1.1

By , 0 View

Mục tiêu thực hành:
- Định nghĩa các Hosts và Services cần giám sát trên Nagios v4.1.1. 
- Kiểm tra trạng thái Ping Status tới các Hosts tại giao diện Nagios WebPage.

Các bước triển khai:
Định nghĩa các Hosts và Services cần giám sát trên Nagios v4.1.1. 
- Khởi tạo thư mục hosts và services.
[root@localhost objects]# cd /usr/local/nagios/etc
[root@localhost etc]# mkdir hosts services
[root@localhost etc]# chown nagios:nagios hosts/ services/
[root@localhost etc]# ls -al
total 64
drwxrwxr-x. 5 nagios nagios   125 May 27 06:21 .
drwxr-xr-x. 9 root   root      94 May 26 22:17 ..
-rw-rw-r--. 1 nagios nagios 12267 May 26 22:13 cgi.cfg
drwxr-xr-x. 2 nagios nagios     6 May 27 06:21 hosts
-rw-r--r--. 1 root   root      50 May 26 22:15 htpasswd.users
-rw-rw-r--. 1 nagios nagios 44831 May 26 22:13 nagios.cfg
drwxrwxr-x. 2 nagios nagios   167 May 27 06:21 objects
-rw-rw----. 1 nagios nagios  1312 May 26 22:13 resource.cfg
drwxr-xr-x. 2 nagios nagios     6 May 27 06:21 services
[root@localhost etc]# 

[root@localhost etc]# yum install nano -y
[root@localhost etc]# nano -c /usr/local/nagios/etc/nagios.cfg

[root@localhost etc]# service nagios restart
Restarting nagios (via systemctl):                         [  OK  ]
[root@localhost etc]# service nagios status
nagios (pid 16179) is running...
[root@localhost etc]# 

- Định nghĩa host.
nano /usr/local/nagios/etc/hosts/host1.cfg

define host{
name linux-box
use generic-host
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 5
check_command check-host-alive
notification_interval 30
notification_period 24x7
notification_options d,r
contact_groups admins
register 0
}

define host{
        use                     linux-box
        host_name               MX84
        alias                   Gateway
        address                 192.168.100.254
        }

- Định nghĩa services.
nano /usr/local/nagios/etc/services/host1.cfg

define service{
        use                     generic-service
        host_name               MX84
        service_description     PING
        check_command           check-host-alive
        }

[root@localhost objects]# service nagios restart
Restarting nagios (via systemctl):                         [  OK  ]
[root@localhost objects]# service nagios status
nagios (pid 16351) is running...
[root@localhost objects]# 

Kiểm tra trạng thái Ping Status tới các Hosts tại giao diện Nagios WebPage.

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