在 CentOS 7.x 上安裝 Nagios 4.x – Apache

參考網頁:
Install And Configure Nagios 4 On CentOS 7 | Unixmen
CentOS 7 : Nagios : Install : Server World
Configuring and Installing Nagios Core 4 on CentOS 6 – nuxref
Nagios Core 4.x Setup for CentOS 7.x – nuxref
Configuring and Installing NRPE and NSCA into Nagios Core 4 on CentOS 6 – nuxref
Control Protocol: Nagios issues, duh.

1. 安裝所需套件
# yum install nagios nagios-plugins-all php http

2. 設定開機時啟動服務
# systemctl enable httpd.service
# systemctl enable nagios.service
Created symlink from /etc/systemd/system/multi-user.target.wants/nagios.service to /usr/lib/systemd/system/nagios.service.
# systemctl start httpd.service
# systemctl start nagios.service[@more@]
3. 設定登入帳號及密碼
# /usr/bin/htpasswd -c /etc/nagios/passwd nagiosadmin
New password:
Re-type new password:
Adding password for user nagiosadmin

4. 檢查設定是否正確
# /usr/sbin/nagios -v /etc/nagios/nagios.cfg
Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data…
   Read main config file okay…
   Read object config files okay…

Running pre-flight check on configuration data…

Checking objects…
        Checked 8 services.
        Checked 1 hosts.
        Checked 1 host groups.
        Checked 0 service groups.
        Checked 1 contacts.
        Checked 1 contact groups.
        Checked 24 commands.
        Checked 5 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths…
        Checked 1 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 5 timeperiods
Checking global event handlers…
Checking obsessive compulsive processor commands…
Checking misc settings…

Total Warnings: 0
Total Errors:   0

Things look okay – No serious problems were detected during the pre-flight check

5. 開啟瀏覽器 http://Server’IP/nagios
輸入設定的帳號及密碼

6. 登入後畫面