Nagios(나기오스)란?

  • Open Source 기반의 IT Infra Structure Monitoring 툴



설치하기

필요한 패키지 선행 설치

  • httpd

  • gcc

  • gd

  • gd-devel

  • glibc

  • glibc-common

  • make

  • net-snmp

  • openssl

  • openssl-dev

  • php

  • unzip

  • xinted

$ yum update -y
$ yum install -y httpd gcc gd gd-devel glibc glibc-common make net-snmp openssl openssl-devel php unzip xinted
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.kakao.com
 * extras: mirror.kakao.com
 * updates: mirror.kakao.com
Package glibc-2.17-292.el7.x86_64 already installed and latest version
Package glibc-common-2.17-292.el7.x86_64 already installed and latest version
Package 1:make-3.82-24.el7.x86_64 already installed and latest version
Package 1:openssl-1.0.2k-19.el7.x86_64 already installed and latest version
No package xinted available.
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.8.5-39.el7 will be installed
--> Processing Dependency: cpp = 4.8.5-39.el7 for package: gcc-4.8.5-39.el7.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-39.el7.x86_64
--> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-39.el7.x86_64
--> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-39.el7.x86_64
---> Package gd.x86_64 0:2.0.35-26.el7 will be installed
--> Processing Dependency: libjpeg.so.62(LIBJPEG_6.2)(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libjpeg.so.62()(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libfontconfig.so.1()(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libXpm.so.4()(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: gd-2.0.35-26.el7.x86_64
---> Package gd-devel.x86_64 0:2.0.35-26.el7 will be installed
--> Processing Dependency: zlib-devel for package: gd-devel-2.0.35-26.el7.x86_64
--> Processing Dependency: libpng-devel for package: gd-devel-2.0.35-26.el7.x86_64
--> Processing Dependency: libjpeg-devel for package: gd-devel-2.0.35-26.el7.x86_64
--> Processing Dependency: libXpm-devel for package: gd-devel-2.0.35-26.el7.x86_64
--> Processing Dependency: libX11-devel for package: gd-devel-2.0.35-26.el7.x86_64
--> Processing Dependency: freetype-devel for package: gd-devel-2.0.35-26.el7.x86_64
--> Processing Dependency: fontconfig-devel for package: gd-devel-2.0.35-26.el7.x86_64
---> Package httpd.x86_64 0:2.4.6-90.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-90.el7.centos for package: httpd-2.4.6-90.el7.centos.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-90.el7.centos.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-90.el7.centos.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-90.el7.centos.x86_64
---> Package net-snmp.x86_64 1:5.7.2-43.el7 will be installed
--> Processing Dependency: net-snmp-libs = 1:5.7.2-43.el7 for package: 1:net-snmp-5.7.2-43.el7.x86_64
--> Processing Dependency: net-snmp-agent-libs = 1:5.7.2-43.el7 for package: 1:net-snmp-5.7.2-43.el7.x86_64
--> Processing Dependency: perl(Data::Dumper) for package: 1:net-snmp-5.7.2-43.el7.x86_64
--> Processing Dependency: libsensors.so.4()(64bit) for package: 1:net-snmp-5.7.2-43.el7.x86_64
--> Processing Dependency: libnetsnmptrapd.so.31()(64bit) for package: 1:net-snmp-5.7.2-43.el7.x86_64
--> Processing Dependency: libnetsnmpmibs.so.31()(64bit) for package: 1:net-snmp-5.7.2-43.el7.x86_64
--> Processing Dependency: libnetsnmpagent.so.31()(64bit) for package: 1:net-snmp-5.7.2-43.el7.x86_64
--> Processing Dependency: libnetsnmp.so.31()(64bit) for package: 1:net-snmp-5.7.2-43.el7.x86_64
---> Package openssl-devel.x86_64 1:1.0.2k-19.el7 will be installed
--> Processing Dependency: krb5-devel(x86-64) for package: 1:openssl-devel-1.0.2k-19.el7.x86_64
---> Package php.x86_64 0:5.4.16-46.el7 will be installed
--> Processing Dependency: php-common(x86-64) = 5.4.16-46.el7 for package: php-5.4.16-46.el7.x86_64
--> Processing Dependency: php-cli(x86-64) = 5.4.16-46.el7 for package: php-5.4.16-46.el7.x86_64
---> Package unzip.x86_64 0:6.0-20.el7 will be installed
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-5.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
---> Package cpp.x86_64 0:4.8.5-39.el7 will be installed
---> Package fontconfig.x86_64 0:2.13.0-4.3.el7 will be installed
--> Processing Dependency: fontpackages-filesystem for package: fontconfig-2.13.0-4.3.el7.x86_64
--> Processing Dependency: dejavu-sans-fonts for package: fontconfig-2.13.0-4.3.el7.x86_64
---> Package fontconfig-devel.x86_64 0:2.13.0-4.3.el7 will be installed
--> Processing Dependency: pkgconfig(uuid) for package: fontconfig-devel-2.13.0-4.3.el7.x86_64
--> Processing Dependency: pkgconfig(expat) for package: fontconfig-devel-2.13.0-4.3.el7.x86_64
---> Package freetype-devel.x86_64 0:2.8-14.el7 will be installed
---> Package glibc-devel.x86_64 0:2.17-292.el7 will be installed
--> Processing Dependency: glibc-headers = 2.17-292.el7 for package: glibc-devel-2.17-292.el7.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-292.el7.x86_64
---> Package httpd-tools.x86_64 0:2.4.6-90.el7.centos will be installed
---> Package krb5-devel.x86_64 0:1.15.1-37.el7_7.2 will be installed
--> Processing Dependency: libkadm5(x86-64) = 1.15.1-37.el7_7.2 for package: krb5-devel-1.15.1-37.el7_7.2.x86_64
--> Processing Dependency: libverto-devel for package: krb5-devel-1.15.1-37.el7_7.2.x86_64
--> Processing Dependency: libselinux-devel for package: krb5-devel-1.15.1-37.el7_7.2.x86_64
--> Processing Dependency: libcom_err-devel for package: krb5-devel-1.15.1-37.el7_7.2.x86_64
--> Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.15.1-37.el7_7.2.x86_64
---> Package libX11.x86_64 0:1.6.7-2.el7 will be installed
--> Processing Dependency: libX11-common >= 1.6.7-2.el7 for package: libX11-1.6.7-2.el7.x86_64
--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.6.7-2.el7.x86_64
---> Package libX11-devel.x86_64 0:1.6.7-2.el7 will be installed
--> Processing Dependency: pkgconfig(xcb) >= 1.11.1 for package: libX11-devel-1.6.7-2.el7.x86_64
--> Processing Dependency: pkgconfig(xproto) for package: libX11-devel-1.6.7-2.el7.x86_64
--> Processing Dependency: pkgconfig(xcb) for package: libX11-devel-1.6.7-2.el7.x86_64
--> Processing Dependency: pkgconfig(kbproto) for package: libX11-devel-1.6.7-2.el7.x86_64
---> Package libXpm.x86_64 0:3.5.12-1.el7 will be installed
---> Package libXpm-devel.x86_64 0:3.5.12-1.el7 will be installed
--> Processing Dependency: libXt.so.6()(64bit) for package: libXpm-devel-3.5.12-1.el7.x86_64
--> Processing Dependency: libXext.so.6()(64bit) for package: libXpm-devel-3.5.12-1.el7.x86_64
---> Package libjpeg-turbo.x86_64 0:1.2.90-8.el7 will be installed
---> Package libjpeg-turbo-devel.x86_64 0:1.2.90-8.el7 will be installed
---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
---> Package libpng-devel.x86_64 2:1.5.13-7.el7_2 will be installed
---> Package lm_sensors-libs.x86_64 0:3.4.0-8.20160601gitf9185e5.el7 will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
---> Package net-snmp-agent-libs.x86_64 1:5.7.2-43.el7 will be installed
---> Package net-snmp-libs.x86_64 1:5.7.2-43.el7 will be installed
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
---> Package php-cli.x86_64 0:5.4.16-46.el7 will be installed
---> Package php-common.x86_64 0:5.4.16-46.el7 will be installed
--> Processing Dependency: libzip.so.2()(64bit) for package: php-common-5.4.16-46.el7.x86_64
---> Package zlib-devel.x86_64 0:1.2.7-18.el7 will be installed
--> Running transaction check
---> Package dejavu-sans-fonts.noarch 0:2.33-6.el7 will be installed
--> Processing Dependency: dejavu-fonts-common = 2.33-6.el7 for package: dejavu-sans-fonts-2.33-6.el7.noarch
---> Package expat-devel.x86_64 0:2.1.0-10.el7_3 will be installed
---> Package fontpackages-filesystem.noarch 0:1.44-8.el7 will be installed
---> Package glibc-headers.x86_64 0:2.17-292.el7 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-292.el7.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-292.el7.x86_64
---> Package keyutils-libs-devel.x86_64 0:1.5.8-3.el7 will be installed
---> Package libX11-common.noarch 0:1.6.7-2.el7 will be installed
---> Package libXext.x86_64 0:1.3.3-3.el7 will be installed
---> Package libXt.x86_64 0:1.1.5-3.el7 will be installed
--> Processing Dependency: libSM.so.6()(64bit) for package: libXt-1.1.5-3.el7.x86_64
--> Processing Dependency: libICE.so.6()(64bit) for package: libXt-1.1.5-3.el7.x86_64
---> Package libcom_err-devel.x86_64 0:1.42.9-16.el7 will be installed
---> Package libkadm5.x86_64 0:1.15.1-37.el7_7.2 will be installed
---> Package libselinux-devel.x86_64 0:2.5-14.1.el7 will be installed
--> Processing Dependency: libsepol-devel(x86-64) >= 2.5-10 for package: libselinux-devel-2.5-14.1.el7.x86_64
--> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.5-14.1.el7.x86_64
--> Processing Dependency: pkgconfig(libpcre) for package: libselinux-devel-2.5-14.1.el7.x86_64
---> Package libuuid-devel.x86_64 0:2.23.2-61.el7 will be installed
---> Package libverto-devel.x86_64 0:0.2.5-4.el7 will be installed
---> Package libxcb.x86_64 0:1.13-1.el7 will be installed
--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.13-1.el7.x86_64
---> Package libxcb-devel.x86_64 0:1.13-1.el7 will be installed
--> Processing Dependency: pkgconfig(xau) >= 0.99.2 for package: libxcb-devel-1.13-1.el7.x86_64
---> Package libzip.x86_64 0:0.10.1-8.el7 will be installed
---> Package xorg-x11-proto-devel.noarch 0:2018.4-1.el7 will be installed
--> Running transaction check
---> Package dejavu-fonts-common.noarch 0:2.33-6.el7 will be installed
---> Package kernel-headers.x86_64 0:3.10.0-1062.4.1.el7 will be installed
---> Package libICE.x86_64 0:1.0.9-9.el7 will be installed
---> Package libSM.x86_64 0:1.2.2-2.el7 will be installed
---> Package libXau.x86_64 0:1.0.8-2.1.el7 will be installed
---> Package libXau-devel.x86_64 0:1.0.8-2.1.el7 will be installed
---> Package libsepol-devel.x86_64 0:2.5-10.el7 will be installed
---> Package pcre-devel.x86_64 0:8.32-17.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================
 Package                                   Arch                     Version                                           Repository                 Size
======================================================================================================================================================
Installing:
 gcc                                       x86_64                   4.8.5-39.el7                                      base                       16 M
 gd                                        x86_64                   2.0.35-26.el7                                     base                      146 k
 gd-devel                                  x86_64                   2.0.35-26.el7                                     base                       79 k
 httpd                                     x86_64                   2.4.6-90.el7.centos                               base                      2.7 M
 net-snmp                                  x86_64                   1:5.7.2-43.el7                                    base                      331 k
 openssl-devel                             x86_64                   1:1.0.2k-19.el7                                   base                      1.5 M
 php                                       x86_64                   5.4.16-46.el7                                     base                      1.4 M
 unzip                                     x86_64                   6.0-20.el7                                        base                      170 k
Installing for dependencies:
 apr                                       x86_64                   1.4.8-5.el7                                       base                      103 k
 apr-util                                  x86_64                   1.5.2-6.el7                                       base                       92 k
 cpp                                       x86_64                   4.8.5-39.el7                                      base                      5.9 M
 dejavu-fonts-common                       noarch                   2.33-6.el7                                        base                       64 k
 dejavu-sans-fonts                         noarch                   2.33-6.el7                                        base                      1.4 M
 expat-devel                               x86_64                   2.1.0-10.el7_3                                    base                       57 k
 fontconfig                                x86_64                   2.13.0-4.3.el7                                    base                      254 k
 fontconfig-devel                          x86_64                   2.13.0-4.3.el7                                    base                      138 k
 fontpackages-filesystem                   noarch                   1.44-8.el7                                        base                      9.9 k
 freetype-devel                            x86_64                   2.8-14.el7                                        base                      447 k
 glibc-devel                               x86_64                   2.17-292.el7                                      base                      1.1 M
 glibc-headers                             x86_64                   2.17-292.el7                                      base                      687 k
 httpd-tools                               x86_64                   2.4.6-90.el7.centos                               base                       91 k
 kernel-headers                            x86_64                   3.10.0-1062.4.1.el7                               updates                   8.7 M
 keyutils-libs-devel                       x86_64                   1.5.8-3.el7                                       base                       37 k
 krb5-devel                                x86_64                   1.15.1-37.el7_7.2                                 updates                   272 k
 libICE                                    x86_64                   1.0.9-9.el7                                       base                       66 k
 libSM                                     x86_64                   1.2.2-2.el7                                       base                       39 k
 libX11                                    x86_64                   1.6.7-2.el7                                       base                      607 k
 libX11-common                             noarch                   1.6.7-2.el7                                       base                      164 k
 libX11-devel                              x86_64                   1.6.7-2.el7                                       base                      981 k
 libXau                                    x86_64                   1.0.8-2.1.el7                                     base                       29 k
 libXau-devel                              x86_64                   1.0.8-2.1.el7                                     base                       14 k
 libXext                                   x86_64                   1.3.3-3.el7                                       base                       39 k
 libXpm                                    x86_64                   3.5.12-1.el7                                      base                       55 k
 libXpm-devel                              x86_64                   3.5.12-1.el7                                      base                       36 k
 libXt                                     x86_64                   1.1.5-3.el7                                       base                      173 k
 libcom_err-devel                          x86_64                   1.42.9-16.el7                                     base                       32 k
 libjpeg-turbo                             x86_64                   1.2.90-8.el7                                      base                      135 k
 libjpeg-turbo-devel                       x86_64                   1.2.90-8.el7                                      base                       99 k
 libkadm5                                  x86_64                   1.15.1-37.el7_7.2                                 updates                   178 k
 libmpc                                    x86_64                   1.0.1-3.el7                                       base                       51 k
 libpng-devel                              x86_64                   2:1.5.13-7.el7_2                                  base                      122 k
 libselinux-devel                          x86_64                   2.5-14.1.el7                                      base                      187 k
 libsepol-devel                            x86_64                   2.5-10.el7                                        base                       77 k
 libuuid-devel                             x86_64                   2.23.2-61.el7                                     base                       92 k
 libverto-devel                            x86_64                   0.2.5-4.el7                                       base                       12 k
 libxcb                                    x86_64                   1.13-1.el7                                        base                      214 k
 libxcb-devel                              x86_64                   1.13-1.el7                                        base                      1.1 M
 libzip                                    x86_64                   0.10.1-8.el7                                      base                       48 k
 lm_sensors-libs                           x86_64                   3.4.0-8.20160601gitf9185e5.el7                    base                       42 k
 mailcap                                   noarch                   2.1.41-2.el7                                      base                       31 k
 mpfr                                      x86_64                   3.1.1-4.el7                                       base                      203 k
 net-snmp-agent-libs                       x86_64                   1:5.7.2-43.el7                                    base                      706 k
 net-snmp-libs                             x86_64                   1:5.7.2-43.el7                                    base                      750 k
 pcre-devel                                x86_64                   8.32-17.el7                                       base                      480 k
 perl-Data-Dumper                          x86_64                   2.145-3.el7                                       base                       47 k
 php-cli                                   x86_64                   5.4.16-46.el7                                     base                      2.7 M
 php-common                                x86_64                   5.4.16-46.el7                                     base                      565 k
 xorg-x11-proto-devel                      noarch                   2018.4-1.el7                                      base                      280 k
 zlib-devel                                x86_64                   1.2.7-18.el7                                      base                       50 k

Transaction Summary
======================================================================================================================================================
Install  8 Packages (+51 Dependent packages)

Total download size: 52 M
Installed size: 120 M
Downloading packages:
(1/59): apr-1.4.8-5.el7.x86_64.rpm                                                                                             | 103 kB  00:00:00
(2/59): apr-util-1.5.2-6.el7.x86_64.rpm                                                                                        |  92 kB  00:00:00
(3/59): dejavu-fonts-common-2.33-6.el7.noarch.rpm                                                                              |  64 kB  00:00:00
(4/59): expat-devel-2.1.0-10.el7_3.x86_64.rpm                                                                                  |  57 kB  00:00:00
(5/59): fontconfig-2.13.0-4.3.el7.x86_64.rpm                                                                                   | 254 kB  00:00:00
(6/59): fontconfig-devel-2.13.0-4.3.el7.x86_64.rpm                                                                             | 138 kB  00:00:00
(7/59): fontpackages-filesystem-1.44-8.el7.noarch.rpm                                                                          | 9.9 kB  00:00:00
(8/59): dejavu-sans-fonts-2.33-6.el7.noarch.rpm                                                                                | 1.4 MB  00:00:00
(9/59): freetype-devel-2.8-14.el7.x86_64.rpm                                                                                   | 447 kB  00:00:00
(10/59): gd-2.0.35-26.el7.x86_64.rpm                                                                                           | 146 kB  00:00:00
(11/59): gd-devel-2.0.35-26.el7.x86_64.rpm                                                                                     |  79 kB  00:00:00
(12/59): glibc-devel-2.17-292.el7.x86_64.rpm                                                                                   | 1.1 MB  00:00:00
(13/59): glibc-headers-2.17-292.el7.x86_64.rpm                                                                                 | 687 kB  00:00:00
(14/59): httpd-2.4.6-90.el7.centos.x86_64.rpm                                                                                  | 2.7 MB  00:00:00
(15/59): httpd-tools-2.4.6-90.el7.centos.x86_64.rpm                                                                            |  91 kB  00:00:00
(16/59): keyutils-libs-devel-1.5.8-3.el7.x86_64.rpm                                                                            |  37 kB  00:00:00
(17/59): krb5-devel-1.15.1-37.el7_7.2.x86_64.rpm                                                                               | 272 kB  00:00:00
(18/59): libICE-1.0.9-9.el7.x86_64.rpm                                                                                         |  66 kB  00:00:00
(19/59): libSM-1.2.2-2.el7.x86_64.rpm                                                                                          |  39 kB  00:00:00
(20/59): libX11-1.6.7-2.el7.x86_64.rpm                                                                                         | 607 kB  00:00:00
(21/59): libX11-common-1.6.7-2.el7.noarch.rpm                                                                                  | 164 kB  00:00:00
(22/59): libX11-devel-1.6.7-2.el7.x86_64.rpm                                                                                   | 981 kB  00:00:00
(23/59): libXau-1.0.8-2.1.el7.x86_64.rpm                                                                                       |  29 kB  00:00:00
(24/59): libXau-devel-1.0.8-2.1.el7.x86_64.rpm                                                                                 |  14 kB  00:00:00
(25/59): libXext-1.3.3-3.el7.x86_64.rpm                                                                                        |  39 kB  00:00:00
(26/59): libXpm-3.5.12-1.el7.x86_64.rpm                                                                                        |  55 kB  00:00:00
(27/59): libXpm-devel-3.5.12-1.el7.x86_64.rpm                                                                                  |  36 kB  00:00:00
(28/59): libXt-1.1.5-3.el7.x86_64.rpm                                                                                          | 173 kB  00:00:00
(29/59): libcom_err-devel-1.42.9-16.el7.x86_64.rpm                                                                             |  32 kB  00:00:00
(30/59): libjpeg-turbo-1.2.90-8.el7.x86_64.rpm                                                                                 | 135 kB  00:00:00
(31/59): libjpeg-turbo-devel-1.2.90-8.el7.x86_64.rpm                                                                           |  99 kB  00:00:00
(32/59): libmpc-1.0.1-3.el7.x86_64.rpm                                                                                         |  51 kB  00:00:00
(33/59): libpng-devel-1.5.13-7.el7_2.x86_64.rpm                                                                                | 122 kB  00:00:00
(34/59): libkadm5-1.15.1-37.el7_7.2.x86_64.rpm                                                                                 | 178 kB  00:00:00
(35/59): libselinux-devel-2.5-14.1.el7.x86_64.rpm                                                                              | 187 kB  00:00:00
(36/59): libsepol-devel-2.5-10.el7.x86_64.rpm                                                                                  |  77 kB  00:00:00
(37/59): libuuid-devel-2.23.2-61.el7.x86_64.rpm                                                                                |  92 kB  00:00:00
(38/59): libverto-devel-0.2.5-4.el7.x86_64.rpm                                                                                 |  12 kB  00:00:00
(39/59): libxcb-1.13-1.el7.x86_64.rpm                                                                                          | 214 kB  00:00:00
(40/59): libxcb-devel-1.13-1.el7.x86_64.rpm                                                                                    | 1.1 MB  00:00:00
(41/59): libzip-0.10.1-8.el7.x86_64.rpm                                                                                        |  48 kB  00:00:00
(42/59): lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_64.rpm                                                             |  42 kB  00:00:00
(43/59): mailcap-2.1.41-2.el7.noarch.rpm                                                                                       |  31 kB  00:00:00
(44/59): mpfr-3.1.1-4.el7.x86_64.rpm                                                                                           | 203 kB  00:00:00
(45/59): net-snmp-5.7.2-43.el7.x86_64.rpm                                                                                      | 331 kB  00:00:00
(46/59): gcc-4.8.5-39.el7.x86_64.rpm                                                                                           |  16 MB  00:00:03
(47/59): cpp-4.8.5-39.el7.x86_64.rpm                                                                                           | 5.9 MB  00:00:04
(48/59): net-snmp-libs-5.7.2-43.el7.x86_64.rpm                                                                                 | 750 kB  00:00:00
(49/59): pcre-devel-8.32-17.el7.x86_64.rpm                                                                                     | 480 kB  00:00:00
(50/59): kernel-headers-3.10.0-1062.4.1.el7.x86_64.rpm                                                                         | 8.7 MB  00:00:02
(51/59): net-snmp-agent-libs-5.7.2-43.el7.x86_64.rpm                                                                           | 706 kB  00:00:00
(52/59): perl-Data-Dumper-2.145-3.el7.x86_64.rpm                                                                               |  47 kB  00:00:00
(53/59): openssl-devel-1.0.2k-19.el7.x86_64.rpm                                                                                | 1.5 MB  00:00:00
(54/59): php-common-5.4.16-46.el7.x86_64.rpm                                                                                   | 565 kB  00:00:00
(55/59): unzip-6.0-20.el7.x86_64.rpm                                                                                           | 170 kB  00:00:00
(56/59): xorg-x11-proto-devel-2018.4-1.el7.noarch.rpm                                                                          | 280 kB  00:00:00
(57/59): zlib-devel-1.2.7-18.el7.x86_64.rpm                                                                                    |  50 kB  00:00:00
(58/59): php-cli-5.4.16-46.el7.x86_64.rpm                                                                                      | 2.7 MB  00:00:00
(59/59): php-5.4.16-46.el7.x86_64.rpm                                                                                          | 1.4 MB  00:00:00
------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                 9.9 MB/s |  52 MB  00:00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : zlib-devel-1.2.7-18.el7.x86_64                                                                                                    1/59
  Installing : mpfr-3.1.1-4.el7.x86_64                                                                                                           2/59
  Installing : apr-1.4.8-5.el7.x86_64                                                                                                            3/59
  Installing : apr-util-1.5.2-6.el7.x86_64                                                                                                       4/59
  Installing : libmpc-1.0.1-3.el7.x86_64                                                                                                         5/59
  Installing : 2:libpng-devel-1.5.13-7.el7_2.x86_64                                                                                              6/59
  Installing : freetype-devel-2.8-14.el7.x86_64                                                                                                  7/59
  Installing : libICE-1.0.9-9.el7.x86_64                                                                                                         8/59
  Installing : libXau-1.0.8-2.1.el7.x86_64                                                                                                       9/59
  Installing : libxcb-1.13-1.el7.x86_64                                                                                                         10/59
  Installing : libjpeg-turbo-1.2.90-8.el7.x86_64                                                                                                11/59
  Installing : lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_64                                                                            12/59
  Installing : 1:net-snmp-libs-5.7.2-43.el7.x86_64                                                                                              13/59
  Installing : xorg-x11-proto-devel-2018.4-1.el7.noarch                                                                                         14/59
  Installing : fontpackages-filesystem-1.44-8.el7.noarch                                                                                        15/59
  Installing : dejavu-fonts-common-2.33-6.el7.noarch                                                                                            16/59
  Installing : dejavu-sans-fonts-2.33-6.el7.noarch                                                                                              17/59
  Installing : fontconfig-2.13.0-4.3.el7.x86_64                                                                                                 18/59
  Installing : libXau-devel-1.0.8-2.1.el7.x86_64                                                                                                19/59
  Installing : libxcb-devel-1.13-1.el7.x86_64                                                                                                   20/59
  Installing : 1:net-snmp-agent-libs-5.7.2-43.el7.x86_64                                                                                        21/59
  Installing : libjpeg-turbo-devel-1.2.90-8.el7.x86_64                                                                                          22/59
  Installing : libSM-1.2.2-2.el7.x86_64                                                                                                         23/59
  Installing : cpp-4.8.5-39.el7.x86_64                                                                                                          24/59
  Installing : httpd-tools-2.4.6-90.el7.centos.x86_64                                                                                           25/59
  Installing : libzip-0.10.1-8.el7.x86_64                                                                                                       26/59
  Installing : php-common-5.4.16-46.el7.x86_64                                                                                                  27/59
  Installing : php-cli-5.4.16-46.el7.x86_64                                                                                                     28/59
  Installing : pcre-devel-8.32-17.el7.x86_64                                                                                                    29/59
  Installing : libsepol-devel-2.5-10.el7.x86_64                                                                                                 30/59
  Installing : libselinux-devel-2.5-14.1.el7.x86_64                                                                                             31/59
  Installing : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                              32/59
  Installing : kernel-headers-3.10.0-1062.4.1.el7.x86_64                                                                                        33/59
  Installing : glibc-headers-2.17-292.el7.x86_64                                                                                                34/59
  Installing : glibc-devel-2.17-292.el7.x86_64                                                                                                  35/59
  Installing : libX11-common-1.6.7-2.el7.noarch                                                                                                 36/59
  Installing : libX11-1.6.7-2.el7.x86_64                                                                                                        37/59
  Installing : libXpm-3.5.12-1.el7.x86_64                                                                                                       38/59
  Installing : libX11-devel-1.6.7-2.el7.x86_64                                                                                                  39/59
  Installing : gd-2.0.35-26.el7.x86_64                                                                                                          40/59
  Installing : libXext-1.3.3-3.el7.x86_64                                                                                                       41/59
  Installing : libXt-1.1.5-3.el7.x86_64                                                                                                         42/59
  Installing : libXpm-devel-3.5.12-1.el7.x86_64                                                                                                 43/59
  Installing : libverto-devel-0.2.5-4.el7.x86_64                                                                                                44/59
  Installing : libkadm5-1.15.1-37.el7_7.2.x86_64                                                                                                45/59
  Installing : expat-devel-2.1.0-10.el7_3.x86_64                                                                                                46/59
  Installing : libuuid-devel-2.23.2-61.el7.x86_64                                                                                               47/59
  Installing : fontconfig-devel-2.13.0-4.3.el7.x86_64                                                                                           48/59
  Installing : libcom_err-devel-1.42.9-16.el7.x86_64                                                                                            49/59
  Installing : mailcap-2.1.41-2.el7.noarch                                                                                                      50/59
  Installing : httpd-2.4.6-90.el7.centos.x86_64                                                                                                 51/59
  Installing : keyutils-libs-devel-1.5.8-3.el7.x86_64                                                                                           52/59
  Installing : krb5-devel-1.15.1-37.el7_7.2.x86_64                                                                                              53/59
  Installing : 1:openssl-devel-1.0.2k-19.el7.x86_64                                                                                             54/59
  Installing : php-5.4.16-46.el7.x86_64                                                                                                         55/59
  Installing : gd-devel-2.0.35-26.el7.x86_64                                                                                                    56/59
  Installing : gcc-4.8.5-39.el7.x86_64                                                                                                          57/59
  Installing : 1:net-snmp-5.7.2-43.el7.x86_64                                                                                                   58/59
  Installing : unzip-6.0-20.el7.x86_64                                                                                                          59/59
  Verifying  : libXext-1.3.3-3.el7.x86_64                                                                                                        1/59
  Verifying  : fontconfig-2.13.0-4.3.el7.x86_64                                                                                                  2/59
  Verifying  : keyutils-libs-devel-1.5.8-3.el7.x86_64                                                                                            3/59
  Verifying  : krb5-devel-1.15.1-37.el7_7.2.x86_64                                                                                               4/59
  Verifying  : 2:libpng-devel-1.5.13-7.el7_2.x86_64                                                                                              5/59
  Verifying  : mailcap-2.1.41-2.el7.noarch                                                                                                       6/59
  Verifying  : httpd-tools-2.4.6-90.el7.centos.x86_64                                                                                            7/59
  Verifying  : libcom_err-devel-1.42.9-16.el7.x86_64                                                                                             8/59
  Verifying  : libjpeg-turbo-devel-1.2.90-8.el7.x86_64                                                                                           9/59
  Verifying  : httpd-2.4.6-90.el7.centos.x86_64                                                                                                 10/59
  Verifying  : libXt-1.1.5-3.el7.x86_64                                                                                                         11/59
  Verifying  : apr-1.4.8-5.el7.x86_64                                                                                                           12/59
  Verifying  : libuuid-devel-2.23.2-61.el7.x86_64                                                                                               13/59
  Verifying  : gcc-4.8.5-39.el7.x86_64                                                                                                          14/59
  Verifying  : unzip-6.0-20.el7.x86_64                                                                                                          15/59
  Verifying  : 1:net-snmp-5.7.2-43.el7.x86_64                                                                                                   16/59
  Verifying  : dejavu-fonts-common-2.33-6.el7.noarch                                                                                            17/59
  Verifying  : fontpackages-filesystem-1.44-8.el7.noarch                                                                                        18/59
  Verifying  : expat-devel-2.1.0-10.el7_3.x86_64                                                                                                19/59
  Verifying  : libkadm5-1.15.1-37.el7_7.2.x86_64                                                                                                20/59
  Verifying  : fontconfig-devel-2.13.0-4.3.el7.x86_64                                                                                           21/59
  Verifying  : libverto-devel-0.2.5-4.el7.x86_64                                                                                                22/59
  Verifying  : zlib-devel-1.2.7-18.el7.x86_64                                                                                                   23/59
  Verifying  : xorg-x11-proto-devel-2018.4-1.el7.noarch                                                                                         24/59
  Verifying  : 1:net-snmp-libs-5.7.2-43.el7.x86_64                                                                                              25/59
  Verifying  : libXpm-devel-3.5.12-1.el7.x86_64                                                                                                 26/59
  Verifying  : libselinux-devel-2.5-14.1.el7.x86_64                                                                                             27/59
  Verifying  : libX11-1.6.7-2.el7.x86_64                                                                                                        28/59
  Verifying  : libX11-common-1.6.7-2.el7.noarch                                                                                                 29/59
  Verifying  : libxcb-1.13-1.el7.x86_64                                                                                                         30/59
  Verifying  : kernel-headers-3.10.0-1062.4.1.el7.x86_64                                                                                        31/59
  Verifying  : freetype-devel-2.8-14.el7.x86_64                                                                                                 32/59
  Verifying  : lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_64                                                                            33/59
  Verifying  : libXpm-3.5.12-1.el7.x86_64                                                                                                       34/59
  Verifying  : libjpeg-turbo-1.2.90-8.el7.x86_64                                                                                                35/59
  Verifying  : gd-devel-2.0.35-26.el7.x86_64                                                                                                    36/59
  Verifying  : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                              37/59
  Verifying  : apr-util-1.5.2-6.el7.x86_64                                                                                                      38/59
  Verifying  : dejavu-sans-fonts-2.33-6.el7.noarch                                                                                              39/59
  Verifying  : 1:openssl-devel-1.0.2k-19.el7.x86_64                                                                                             40/59
  Verifying  : gd-2.0.35-26.el7.x86_64                                                                                                          41/59
  Verifying  : libmpc-1.0.1-3.el7.x86_64                                                                                                        42/59
  Verifying  : libsepol-devel-2.5-10.el7.x86_64                                                                                                 43/59
  Verifying  : glibc-devel-2.17-292.el7.x86_64                                                                                                  44/59
  Verifying  : libxcb-devel-1.13-1.el7.x86_64                                                                                                   45/59
  Verifying  : pcre-devel-8.32-17.el7.x86_64                                                                                                    46/59
  Verifying  : libXau-1.0.8-2.1.el7.x86_64                                                                                                      47/59
  Verifying  : libSM-1.2.2-2.el7.x86_64                                                                                                         48/59
  Verifying  : libX11-devel-1.6.7-2.el7.x86_64                                                                                                  49/59
  Verifying  : mpfr-3.1.1-4.el7.x86_64                                                                                                          50/59
  Verifying  : 1:net-snmp-agent-libs-5.7.2-43.el7.x86_64                                                                                        51/59
  Verifying  : php-cli-5.4.16-46.el7.x86_64                                                                                                     52/59
  Verifying  : libzip-0.10.1-8.el7.x86_64                                                                                                       53/59
  Verifying  : libICE-1.0.9-9.el7.x86_64                                                                                                        54/59
  Verifying  : php-5.4.16-46.el7.x86_64                                                                                                         55/59
  Verifying  : cpp-4.8.5-39.el7.x86_64                                                                                                          56/59
  Verifying  : php-common-5.4.16-46.el7.x86_64                                                                                                  57/59
  Verifying  : glibc-headers-2.17-292.el7.x86_64                                                                                                58/59
  Verifying  : libXau-devel-1.0.8-2.1.el7.x86_64                                                                                                59/59

Installed:
  gcc.x86_64 0:4.8.5-39.el7         gd.x86_64 0:2.0.35-26.el7               gd-devel.x86_64 0:2.0.35-26.el7    httpd.x86_64 0:2.4.6-90.el7.centos
  net-snmp.x86_64 1:5.7.2-43.el7    openssl-devel.x86_64 1:1.0.2k-19.el7    php.x86_64 0:5.4.16-46.el7         unzip.x86_64 0:6.0-20.el7

Dependency Installed:
  apr.x86_64 0:1.4.8-5.el7                   apr-util.x86_64 0:1.5.2-6.el7                             cpp.x86_64 0:4.8.5-39.el7
  dejavu-fonts-common.noarch 0:2.33-6.el7    dejavu-sans-fonts.noarch 0:2.33-6.el7                     expat-devel.x86_64 0:2.1.0-10.el7_3
  fontconfig.x86_64 0:2.13.0-4.3.el7         fontconfig-devel.x86_64 0:2.13.0-4.3.el7                  fontpackages-filesystem.noarch 0:1.44-8.el7
  freetype-devel.x86_64 0:2.8-14.el7         glibc-devel.x86_64 0:2.17-292.el7                         glibc-headers.x86_64 0:2.17-292.el7
  httpd-tools.x86_64 0:2.4.6-90.el7.centos   kernel-headers.x86_64 0:3.10.0-1062.4.1.el7               keyutils-libs-devel.x86_64 0:1.5.8-3.el7
  krb5-devel.x86_64 0:1.15.1-37.el7_7.2      libICE.x86_64 0:1.0.9-9.el7                               libSM.x86_64 0:1.2.2-2.el7
  libX11.x86_64 0:1.6.7-2.el7                libX11-common.noarch 0:1.6.7-2.el7                        libX11-devel.x86_64 0:1.6.7-2.el7
  libXau.x86_64 0:1.0.8-2.1.el7              libXau-devel.x86_64 0:1.0.8-2.1.el7                       libXext.x86_64 0:1.3.3-3.el7
  libXpm.x86_64 0:3.5.12-1.el7               libXpm-devel.x86_64 0:3.5.12-1.el7                        libXt.x86_64 0:1.1.5-3.el7
  libcom_err-devel.x86_64 0:1.42.9-16.el7    libjpeg-turbo.x86_64 0:1.2.90-8.el7                       libjpeg-turbo-devel.x86_64 0:1.2.90-8.el7
  libkadm5.x86_64 0:1.15.1-37.el7_7.2        libmpc.x86_64 0:1.0.1-3.el7                               libpng-devel.x86_64 2:1.5.13-7.el7_2
  libselinux-devel.x86_64 0:2.5-14.1.el7     libsepol-devel.x86_64 0:2.5-10.el7                        libuuid-devel.x86_64 0:2.23.2-61.el7
  libverto-devel.x86_64 0:0.2.5-4.el7        libxcb.x86_64 0:1.13-1.el7                                libxcb-devel.x86_64 0:1.13-1.el7
  libzip.x86_64 0:0.10.1-8.el7               lm_sensors-libs.x86_64 0:3.4.0-8.20160601gitf9185e5.el7   mailcap.noarch 0:2.1.41-2.el7
  mpfr.x86_64 0:3.1.1-4.el7                  net-snmp-agent-libs.x86_64 1:5.7.2-43.el7                 net-snmp-libs.x86_64 1:5.7.2-43.el7
  pcre-devel.x86_64 0:8.32-17.el7            perl-Data-Dumper.x86_64 0:2.145-3.el7                     php-cli.x86_64 0:5.4.16-46.el7
  php-common.x86_64 0:5.4.16-46.el7          xorg-x11-proto-devel.noarch 0:2018.4-1.el7                zlib-devel.x86_64 0:1.2.7-18.el7

Complete!


httpd(apache) 실행 및 데몬 설정

$ systemctl start httpd
$ systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
$ systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since 목 2019-10-17 18:42:01 KST; 22s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 28373 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─28373 /usr/sbin/httpd -DFOREGROUND
           ├─28374 /usr/sbin/httpd -DFOREGROUND
           ├─28375 /usr/sbin/httpd -DFOREGROUND
           ├─28376 /usr/sbin/httpd -DFOREGROUND
           ├─28377 /usr/sbin/httpd -DFOREGROUND
           └─28378 /usr/sbin/httpd -DFOREGROUND

10월 17 18:42:01 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
10월 17 18:42:01 localhost.localdomain httpd[28373]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name,...message
10월 17 18:42:01 localhost.localdomain systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.


Nagios에 필요한 플러그인과 Nagios Core 패키지 설치

  • epel-release에 nagios 패키지가 들어있음

  • nagios : Nagios Core

  • nagios-plugin-all : Nagios Plugin

$ yum install -y epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

 * base: mirror.kakao.com
 * extras: mirror.kakao.com
 * updates: mirror.kakao.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================
 Package                                 Arch                              Version                            Repository                         Size
======================================================================================================================================================
Installing:
 epel-release                            noarch                            7-11                               extras                             15 k

Transaction Summary
======================================================================================================================================================
Install  1 Package

Total download size: 15 k
Installed size: 24 k
Downloading packages:
epel-release-7-11.noarch.rpm                                                                                                   |  15 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                                                                                           1/1
  Verifying  : epel-release-7-11.noarch                                                                                                           1/1

Installed:
  epel-release.noarch 0:7-11

Complete!
$ yum install -y nagios nagios-plugin-all
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                                           | 7.0 kB  00:00:00
 * base: mirror.kakao.com
 * epel: ftp.riken.jp
 * extras: mirror.kakao.com
 * updates: mirror.kakao.com
epel                                                                                                                           | 5.3 kB  00:00:00
(1/3): epel/x86_64/group_gz                                                                                                    |  90 kB  00:00:00
(2/3): epel/x86_64/updateinfo                                                                                                  | 1.0 MB  00:00:09
(3/3): epel/x86_64/primary_db                                                                                                  | 6.9 MB  00:00:30
No package nagios-plugin-all available.
Resolving Dependencies
--> Running transaction check
---> Package nagios.x86_64 0:4.4.3-1.el7 will be installed
--> Processing Dependency: group(nagios) for package: nagios-4.4.3-1.el7.x86_64
--> Processing Dependency: group(nagios) for package: nagios-4.4.3-1.el7.x86_64
--> Processing Dependency: mailx for package: nagios-4.4.3-1.el7.x86_64
--> Processing Dependency: nagios-common for package: nagios-4.4.3-1.el7.x86_64
--> Processing Dependency: user(nagios) for package: nagios-4.4.3-1.el7.x86_64
--> Processing Dependency: user(nagios) for package: nagios-4.4.3-1.el7.x86_64
--> Running transaction check
---> Package mailx.x86_64 0:12.5-19.el7 will be installed
---> Package nagios-common.x86_64 0:4.4.3-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================
 Package                                 Arch                             Version                                Repository                      Size
======================================================================================================================================================
Installing:
 nagios                                  x86_64                           4.4.3-1.el7                            epel                           2.0 M
Installing for dependencies:
 mailx                                   x86_64                           12.5-19.el7                            base                           245 k
 nagios-common                           x86_64                           4.4.3-1.el7                            epel                            26 k

Transaction Summary
======================================================================================================================================================
Install  1 Package (+2 Dependent packages)

Total download size: 2.2 M
Installed size: 10 M

Downloading packages:
(1/3): mailx-12.5-19.el7.x86_64.rpm                                                                                            | 245 kB  00:00:00
warning: /var/cache/yum/x86_64/7/epel/packages/nagios-common-4.4.3-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY:--:-- ETA
Public key for nagios-common-4.4.3-1.el7.x86_64.rpm is not installed
(2/3): nagios-common-4.4.3-1.el7.x86_64.rpm                                                                                    |  26 kB  00:00:00
(3/3): nagios-4.4.3-1.el7.x86_64.rpm                                                                                           | 2.0 MB  00:00:07
------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                 294 kB/s | 2.2 MB  00:00:07
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
 Userid     : "Fedora EPEL (7) <epel@fedoraproject.org>"
 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
 Package    : epel-release-7-11.noarch (@extras)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
 
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : nagios-common-4.4.3-1.el7.x86_64                                                                                                   1/3
  Installing : mailx-12.5-19.el7.x86_64                                                                                                           2/3
  Installing : nagios-4.4.3-1.el7.x86_64                                                                                                          3/3
  Verifying  : nagios-4.4.3-1.el7.x86_64                                                                                                          1/3
  Verifying  : mailx-12.5-19.el7.x86_64                                                                                                           2/3
  Verifying  : nagios-common-4.4.3-1.el7.x86_64                                                                                                   3/3

Installed:
  nagios.x86_64 0:4.4.3-1.el7

Dependency Installed:
  mailx.x86_64 0:12.5-19.el7                                            nagios-common.x86_64 0:4.4.3-1.el7

Complete!


Nagios 서버 관리자 계정 생성 및 정보 저장(/etc/nagios/passwd)

  • 서버 관리자 계정 생성

    • Nagios 모니터링 페이지 Web으로 접속시 필요
  • htpasswd : http-tools에 있음 (위에서 httpd-tools.x86_64 0:2.4.6-90.el7.centos 디펜던시 설치 확인됨)

$ htpasswd /etc/nagios/passwd sun
New password:
Re-type new password:
Adding password for user sun
  • 생성 확인

    • ID

    • Password : 해시함수 MD5로 암호화

$ cat /etc/nagios/passwd
nagiosadmin:RbdO4ou4PNyMg

sun:$apr1$kmjPBMeq$yCG4ObD5DqUpEs9K1f923.


Nagios 접근 설정, 알림 계정 설정 확인 (딱히 작업은 X)

  • 접근 설정 : /etc/httpd/conf.d/nagios.conf

  • 알림 계정 설정 : /etc/nagios/objects/contacts.cfg

$ vi /etc/httpd/conf.d/nagios.conf
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file.  Customize the paths, etc. as
# needed to fit your system.

ScriptAlias /nagios/cgi-bin "/usr/lib64/nagios/cgi-bin/"

<Directory "/usr/lib64/nagios/cgi-bin/">
#  SSLRequireSSL
   Options ExecCGI
   AllowOverride None
   <IfVersion >= 2.3>
      <RequireAll>
         Require all granted
#        Require host 127.0.0.1 # 지정시 WhiteList로 웹 접근 허용

         AuthName "Nagios Access"
         AuthType Basic
         AuthUserFile /etc/nagios/passwd # 저장된 정보 경로(default)
         Require valid-user # 저장된 정보를 이용해 인증을 허용한다는 의미
      </RequireAll>
   </IfVersion>
   <IfVersion < 2.3>
      Order allow,deny
      Allow from all
#     Order deny,allow
#     Deny from all
#     Allow from 127.0.0.1

      AuthName "Nagios Access"
      AuthType Basic
      AuthUserFile /etc/nagios/passwd
      Require valid-user
   </IfVersion>
</Directory>

Alias /nagios "/usr/share/nagios/html"

<Directory "/usr/share/nagios/html">
#  SSLRequireSSL
   Options None
   AllowOverride None
   <IfVersion >= 2.3>
      <RequireAll>
         Require all granted
#        Require host 127.0.0.1

         AuthName "Nagios Access"
         AuthType Basic
         AuthUserFile /etc/nagios/passwd
         Require valid-user
      </RequireAll>
   </IfVersion>
   <IfVersion < 2.3>
      Order allow,deny
      Allow from all
#     Order deny,allow
#     Deny from all
#     Allow from 127.0.0.1

      AuthName "Nagios Access"
      AuthType Basic
      AuthUserFile /etc/nagios/passwd
      Require valid-user
   </IfVersion>
</Directory>
$ vi /etc/nagios/objects/contacts.cfg
###############################################################################
# CONTACTS.CFG - SAMPLE CONTACT/CONTACTGROUP DEFINITIONS
#
#
# NOTES: This config file provides you with some example contact and contact
#        group definitions that you can reference in host and service
#        definitions.
#
#        You don't need to keep these definitions in a separate file from your
#        other object definitions.  This has been done just to make things
#        easier to understand.
#
###############################################################################



###############################################################################
#
# CONTACTS
#
###############################################################################

# Just one contact defined by default - the Nagios admin (that's you)
# This contact definition inherits a lot of default values from the
# 'generic-contact' template which is defined elsewhere.

define contact {
# Nagios 알림시 관리자 이름 및 메일 주소 지정
    contact_name            nagiosadmin             ; Short name of user
    use                     generic-contact         ; Inherit default values from generic-contact template (defined above)
    alias                   Nagios Admin            ; Full name of user
    email                   nagios@localhost ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}



###############################################################################
#
# CONTACT GROUPS
#
###############################################################################

# We only have one contact in this simple configuration file, so there is
# no need to create more than one contact group.

define contactgroup {
# Nagios 그룹 알림시 알림받을 멤버 지정
    contactgroup_name       admins
    alias                   Nagios Administrators
    members                 nagiosadmin
}


Apache(httpd) 재시작 및 프로세스 확인

$ systemctl restart httpd
$ ps -ef | grep httpd
root     28595     1  0 19:07 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   28596 28595  0 19:07 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   28597 28595  0 19:07 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   28598 28595  0 19:07 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   28599 28595  0 19:07 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   28600 28595  0 19:07 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
root     28602 23783  0 19:08 pts/1    00:00:00 grep --color=auto httpd

Nagios 서버 실행 및 데몬 설정 및 프로세스 확인

$ systemctl start nagios
$ systemctl enable nagios
Created symlink from /etc/systemd/system/multi-user.target.wants/nagios.service to /usr/lib/systemd/system/nagios.service.
$ systemctl status nagios
● nagios.service - Nagios Core 4.4.3
   Loaded: loaded (/usr/lib/systemd/system/nagios.service; enabled; vendor preset: disabled)
   Active: active (running) since 목 2019-10-17 19:08:32 KST; 26s ago
     Docs: https://www.nagios.org/documentation
 Main PID: 28614 (nagios)
   CGroup: /system.slice/nagios.service
           ├─28614 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
           ├─28616 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
           ├─28617 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
           ├─28618 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
           ├─28619 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
           └─28621 /usr/sbin/nagios -d /etc/nagios/nagios.cfg

10월 17 19:08:32 localhost.localdomain nagios[28614]: qh: core query handler registered
10월 17 19:08:32 localhost.localdomain nagios[28614]: qh: echo service query handler registered
10월 17 19:08:32 localhost.localdomain nagios[28614]: qh: help for the query handler registered
10월 17 19:08:32 localhost.localdomain nagios[28614]: wproc: Successfully registered manager as @wproc with query handler
10월 17 19:08:32 localhost.localdomain nagios[28614]: wproc: Registry request: name=Core Worker 28617;pid=28617
10월 17 19:08:32 localhost.localdomain nagios[28614]: wproc: Registry request: name=Core Worker 28618;pid=28618
10월 17 19:08:32 localhost.localdomain nagios[28614]: wproc: Registry request: name=Core Worker 28619;pid=28619
10월 17 19:08:32 localhost.localdomain nagios[28614]: wproc: Registry request: name=Core Worker 28616;pid=28616
10월 17 19:08:33 localhost.localdomain nagios[28614]: Successfully launched command file worker with pid 28621
10월 17 19:08:33 localhost.localdomain nagios[28614]: HOST ALERT: localhost;DOWN;SOFT;1;(No output on stdout) stderr: execvp(/usr/lib64/nag...rectory
Hint: Some lines were ellipsized, use -l to show in full.
$ ps -ef | grep nagios
nagios   28614     1  0 19:08 ?        00:00:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios   28616 28614  0 19:08 ?        00:00:00 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
nagios   28617 28614  0 19:08 ?        00:00:00 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
nagios   28618 28614  0 19:08 ?        00:00:00 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
nagios   28619 28614  0 19:08 ?        00:00:00 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
nagios   28621 28614  0 19:08 ?        00:00:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
root     28647 23783  0 19:09 pts/1    00:00:00 grep --color=auto nagios


Nagios 설정 파일 선행 검사

  • nagios -v를 통해 설정 파일에 문제가 있는지 검사

    • 에러가 있을 경우 에러 출력
  • 설정파일 : /etc/nagios/nagios.cfg

$ nagios -v /etc/nagios/nagios.cfg

Nagios Core 4.4.3
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2019-01-15
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


Nagios 서버 로그 파일 확인

  • ls를 이용해 로그 파일 생겼는지 확인

  • 로그 파일 : /var/log/nagios/nagios.log

$ ls -l /var/log/nagios
합계 4
drwxr-x---. 2 nagios nagios    6  1월 17  2019 archives
-rw-r--r--. 1 nagios nagios 3003 10월 17 19:12 nagios.log



Nagios Web 브라우저에서 확인하기

  • http://서버IP/nagios

여기서 모래시계가 돌면서 실행이 되지 않는다면 방화벽이슈일 수 있음

방화벽 이슈 : systemctl stop firewalld로 방화벽 OFF

재부팅시에도 OFF 하려면 systemctl disable firewalld

  • 로그인 창 나오고, 처음에 생성한 계정으로 로그인

image

image