易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 5275|回复: 0
收起左侧

install nagios环境

[复制链接]
发表于 2018-6-25 21:38:58 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
Installing Nagios Core From Source; q  M1 S0 Y: c  W2 E% @
This document describes how to install Nagios Core from source.
This guide is broken up into several sections and covers different operating system (OS) distributions. If your OS Distribution is not included in this guide then please contact us to see if we can get it added. Some distributions may be missing as we don't have access to a test environment that allows us to develop the documentation.
Nagios Core 4.4.0 and Nagios Plugins 2.2.1 is what this guide instructs you to install, however future versions should also work fine with these steps.
This documentation is broken up into two distinct sections:
  • Install Nagios Core$ Z, P# C. y7 O2 t
  • Install Nagios Plugins4 J2 a+ N/ }8 i7 W, A8 |# t
    / d9 D. g, V6 \% S# x) W- T
This separation is to make a clear distinction as to what prerequisite packages are required by the OS it is being installed on. For example the SNMP packages are installed as part of the Nagios Plugins section, as SNMP is not required by Nagios Core.

/ ^' I( q& {* f1 e6 N, W
Please select your OS:
6 a6 F8 G, I/ c) x

& k: ^& a) h" D, ?  W6 X* P" G# N+ ?/ S$ B6 H5 ?* T  S2 L8 [
CentOS | RHEL | Oracle Linux
Security-Enhanced Linux
This guide is based on SELinux being disabled or in permissive mode. Steps to do this are as follows.
sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config3 U1 v$ s' b1 Z& f
setenforce 0
' t1 Y) C' X) WPrerequisites
Perform these steps to install the pre-requisite packages.
yum install -y gcc glibc glibc-common wget unzip httpd php gd gd-devel perl postfix Downloading the Sourcecd /tmp
- ]4 q) \5 \8 e) swget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz& Q; I4 \3 V  j, C' _& E
tar xzf nagioscore.tar.gz
& B; t6 s- z& [Compilecd /tmp/nagioscore-nagios-4.4.0/
' s8 N9 q* ], n; ]" C' Y* |7 {/ I./configure
  n2 S/ e* u) P0 x8 U8 {+ Emake all. _' i/ j) _9 O+ v/ P, \% q
Create User And Group
This creates the nagios user and group. The apache user is also added to the nagios group.
make install-groups-users
9 p; M3 c4 a! s; f3 R% |usermod -a -G nagios apache
& W, Y! Z& _, u1 s7 TInstall Binaries
This step installs the binary files, CGIs, and HTML files.
make install" ~+ d# Y1 [4 u$ u3 h* F7 O9 H
Install Service / Daemon
This installs the service or daemon files and also configures them to start on boot. The Apache httpd service is also configured at this point.
===== CentOS 5.x / 6.x | RHEL 5.x / 6.x | Oracle Linux 5.x / 6.x =====
make install-init& Z- e) V9 p  z3 |
chkconfig --level 2345 httpd on- |2 K8 i0 w- h# D, v0 o
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x =====
make install-init# G0 h1 G: r* [- M8 Q
systemctl enable httpd.service; [, e; o/ X, }! b3 g
Information on starting and stopping services will be explained further on.
, J! o, f' W: I4 h
Install Command Mode
This installs and configures the external command file.
make install-commandmode& n  x  o2 {# l9 r9 k6 D
Install Configuration Files
This installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start.
make install-config
6 W/ {( h; B7 OInstall Apache Config Files
This installs the Apache web server configuration files. Also configure Apache settings if required.
make install-webconf
$ g6 L2 Z0 s" F* tConfigure Firewall
You need to allow port 80 inbound traffic on the local firewall so you can reach the Nagios Core web interface.
===== CentOS 5.x / 6.x | RHEL 5.x / 6.x | Oracle Linux 5.x / 6.x =====
iptables -I INPUT -p tcp --destination-port 80 -j ACCEPT9 I) W7 X' E, `6 e; M+ P: ]$ q
service iptables save$ S% p+ Q: ^, S" w( `1 Z
ip6tables -I INPUT -p tcp --destination-port 80 -j ACCEPT- u! e& g( O! \- ]: Q9 k- ]$ R+ n$ ^
service ip6tables save& I2 U7 Z, _# |" e, e+ N! Q. T
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x =====
firewall-cmd --zone=public --add-port=80/tcp
1 D$ C- P" e" q1 r" G, xfirewall-cmd --zone=public --add-port=80/tcp --permanent
* ]8 L6 i, X7 \  L( _: FCreate nagiosadmin User Account
You'll need to create an Apache user account to be able to log into Nagios.
The following command will create a user account called nagiosadmin and you will be prompted to provide a password for the account.
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
: f- R6 o2 ?% X" J6 j0 h
When adding additional users in the future, you need to remove -c from the above command otherwise it will replace the existing nagiosadmin user (and any other users you may have added).

' k0 J' I( h1 W4 o7 G# |5 _; h
) I8 O- ^, G! O4 {5 GStart Apache Web Server
===== CentOS 5.x / 6.x | RHEL 5.x / 6.x | Oracle Linux 5.x / 6.x =====
service httpd start' t% _1 _. {2 \: ~  z, R
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x =====
systemctl start httpd.service
$ F) c- o0 d# u2 o2 G3 m; vStart Service / Daemon
This command starts Nagios Core.
===== CentOS 5.x / 6.x | RHEL 5.x / 6.x | Oracle Linux 5.x / 6.x =====
service nagios start1 o6 `! b/ s; a
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x =====
systemctl start nagios.service
9 o4 N. @  r- h+ H% ^Test Nagios
Nagios is now running, to confirm this you need to log into the Nagios Web Interface.
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
You will be prompted for a username and password. The username is nagiosadmin (you created it in a previous step) and the password is what you provided earlier.
Once you have logged in you are presented with the Nagios interface. Congratulations you have installed Nagios Core.
BUT WAIT ...
Currently you have only installed the Nagios Core engine. You'll notice some errors under the hosts and services along the lines of:
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_load, ...) failed. errno is 2: No such file or directory
These errors will be resolved once you install the Nagios Plugins, which is covered in the next step.

( d$ ?6 ]1 a% }& j8 u' T% gInstalling The Nagios Plugins
Nagios Core needs plugins to operate properly. The following steps will walk you through installing Nagios Plugins.
These steps install nagios-plugins 2.2.1. Newer versions will become available in the future and you can use those in the following installation steps. Please see the releases page on GitHub for all available versions.
8 g5 W% n" {, U
Please note that the following steps install most of the plugins that come in the Nagios Plugins package. However there are some plugins that require other libraries which are not included in those instructions. Please refer to the following KB article for detailed installation instructions:
3 `4 }4 J6 k1 R& C9 E) j
Prerequisites
Make sure that you have the following packages installed.
===== CentOS 5.x =====
yum install -y gcc glibc glibc-common make gettext automake wget openssl-devel net-snmp net-snmp-utils epel-release
  z7 p2 o4 z! p& L5 Dyum install -y perl-Net-SNMP
% U4 H4 {/ |% r0 A  J8 _cd /tmp" w4 E" R* b( t( R9 p
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
8 W: ?5 E( `$ `1 ^$ j$ `tar xzf autoconf-2.60.tar.gz
3 O# R: r2 B. _$ ~; r" n) B' z% q0 f8 mcd /tmp/autoconf-2.60# A3 |+ n" M" ?4 y. s2 y( e7 C
./configure
3 J# F% C/ J8 l: f: Q* L+ r7 \' Imake
4 M5 v! b9 j0 p7 P% [make install
9 K3 b9 C, h. q) _2 n; B
===== CentOS 6.x / 7.x =====
yum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils epel-release0 t# d; ]* w' {4 Z2 L% |3 k' H4 M
yum install -y perl-Net-SNMP* f6 V3 o( v% [- ~
===== RHEL 5.x | Oracle Linux 5.x =====
cd /tmp
5 a' m1 X: h9 |) P* x7 dwget http://archives.fedoraproject.or ... latest-5.noarch.rpm1 |* m2 n/ |4 z% J3 o  y, Z0 Q6 C
rpm -ihv epel-release-latest-5.noarch.rpm7 Y3 `+ D1 H3 p; g* |
yum install -y gcc glibc glibc-common make gettext automake wget openssl-devel net-snmp net-snmp-utils4 c" Z* X, u; x
yum install -y perl-Net-SNMP
$ p9 @( P; ~" ^8 d& R2 P: pwget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz2 R- @/ p- w% Y
tar xzf autoconf-2.60.tar.gz , m: U. J2 n# {- W
cd /tmp/autoconf-2.60) m2 O; X5 h7 Y1 |- ?1 I8 A
./configure
+ C6 Q" }( C* ]8 F+ }make/ ~2 {* ~$ v3 O& t+ Q
make install1 h7 w) n! u$ m" K( K& L
===== RHEL 6.x | Oracle Linux 6.x =====
cd /tmp( l6 H5 _3 H. s- ?8 r
wget https://dl.fedoraproject.org/pub ... latest-6.noarch.rpm  l. q8 h" r) w4 V# X& L2 J0 C
rpm -ihv epel-release-latest-6.noarch.rpm3 v# x9 _+ O1 |# A+ P4 U: l  g
yum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils7 T; @$ M) V2 I$ ^
yum install -y perl-Net-SNMP- J, ?% `2 X2 Q4 q
===== RHEL 7.x =====
cd /tmp8 ^( c* H; S( p( O. D2 T3 o2 w2 v
wget https://dl.fedoraproject.org/pub ... latest-7.noarch.rpm7 K# H. {# }1 V9 e/ j% J8 m
rpm -ihv epel-release-latest-7.noarch.rpm1 b' R- ^! A1 ~: W4 w1 B8 b) M. e/ W
subscription-manager repos --enable=rhel-7-server-optional-rpms4 e" g9 Y0 s/ [( x7 M
yum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils3 Q1 W3 i8 n' M& `2 T. k
yum install -y perl-Net-SNMP
0 q7 c- F! o% j) o5 g# s" B
===== Oracle Linux 7.x =====
yum install -y yum-utils4 V* ]' k; ^0 C, P
yum-config-manager --enable ol7_optional_latest
% E3 ]7 F+ `/ k% [" e6 acd /tmp$ Y9 Y9 t1 h' D* {9 n
wget https://dl.fedoraproject.org/pub ... latest-7.noarch.rpm3 [& z: |" o9 @7 ^* H3 L0 I
rpm -ihv epel-release-latest-7.noarch.rpm" s) }- Z$ F6 _# B9 @
yum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils
  R# O! P+ P; L; d5 [$ }: n# X, a9 _" ]yum install -y perl-Net-SNMP. P$ J5 c; w$ x  V/ X# N- J
Downloading The Sourcecd /tmp, A  t! ]  L2 j# _8 S- m6 ?3 M; b
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz2 c  n# i: u7 S4 Z5 m1 P2 q
tar zxf nagios-plugins.tar.gz
" l" q; u$ ~: v5 j( F* g, Y" U; QCompile + Installcd /tmp/nagios-plugins-release-2.2.1/
3 ~# ?) Z3 W- t7 I: e- s, J6 c1 @./tools/setup/ Q  g/ J- J6 a+ c) \6 K. G
./configure
2 V4 ^$ L2 b' m& a. B2 m7 D: U. p' fmake/ h; K) \; R! [9 |9 i8 H9 d4 B& K
make install% {# U2 [, x- j* e
Test Plugins
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
Go to a host or service object and "Re-schedule the next check" under the Commands menu. The error you previously saw should now disappear and the correct output will be shown on the screen.
$ X8 Q& U% @( M% {# d
Service / Daemon Commands
Different Linux distributions have different methods of starting / stopping / restarting / status Nagios.
===== CentOS 5.x / 6.x | RHEL 5.x / 6.x | Oracle Linux 5.x / 6.x =====
service nagios start
+ F9 r- |$ E% Oservice nagios stop3 t1 `$ k0 e% k5 D3 ]
service nagios restart2 S0 s# s! N3 F$ ?# U) X
service nagios status
; G( j& S# e. w) o. H9 u5 g  q) E
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x =====
systemctl start nagios.service
& |# g* @/ v/ l- M9 s, ~& l  Ysystemctl stop nagios.service5 e+ _+ d' G" `
systemctl restart nagios.service
) q* B# e7 R  Y9 [( H2 _systemctl status nagios.service1 o% B; y! Z& y: i, j  M: Z6 L
& D5 Z. c" o* ?/ I

. K- [7 f/ N" `
Ubuntu
Security-Enhanced Linux
This guide is based on SELinux being disabled or in permissive mode. SELinux is not enabled by default on Ubuntu. If you would like to see if it is installed run the following command:
sudo dpkg -l selinux*
0 _9 c* W4 t% B4 ^# {Prerequisites
Perform these steps to install the pre-requisite packages.
===== Ubuntu 14.x / 15.x =====
sudo apt-get update
  k  Q1 `4 ~" e# ]& E% Ksudo apt-get install -y autoconf gcc libc6 make wget unzip apache2 apache2-utils php5 libgd2-xpm-dev
1 ~2 M+ P5 X4 f2 j1 S1 f
===== Ubuntu 16.x / 17.x =====
sudo apt-get update* P! f2 h# q* b0 S
sudo apt-get install -y autoconf gcc libc6 make wget unzip apache2 php libapache2-mod-php7.0 libgd2-xpm-dev
: [$ R7 J3 o1 f; Y5 A. @# a; z
===== Ubuntu 18.x =====
sudo apt-get update
: P6 @% e6 C& c. a' lsudo apt-get install -y autoconf gcc libc6 make wget unzip apache2 php libapache2-mod-php7.2 libgd-dev
' f- I) U* E1 @Downloading the Sourcecd /tmp( p. Z  o7 l3 E! p
wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz. n2 w7 _  \, b$ z$ w- U
tar xzf nagioscore.tar.gz3 `3 j; A( a* w, b
Compilecd /tmp/nagioscore-nagios-4.4.0/' E  Y1 v( @3 C+ T% [& \( E& n
sudo ./configure --with-httpd-conf=/etc/apache2/sites-enabled: @2 \! N. L& b# _; s4 {7 d
sudo make all
" u5 D' n' m' V( v! L8 C8 S* LCreate User And Group
This creates the nagios user and group. The www-data user is also added to the nagios group.
sudo make install-groups-users; F) j( A: X' B' h
sudo usermod -a -G nagios www-data2 _7 t1 n) Q! Y! y, B+ M
Install Binaries
This step installs the binary files, CGIs, and HTML files.
sudo make install0 [8 b( u6 S& \3 `4 e: ?) f
Install Service / Daemon
This installs the service or daemon files and also configures them to start on boot.
sudo make install-init
! R# `8 o) y0 W% G
Information on starting and stopping services will be explained further on.

  ?# p( E2 X: E. J7 z6 d9 h2 S! V& ?Install Command Mode
This installs and configures the external command file.
sudo make install-commandmode3 n8 o  T; e1 X
Install Configuration Files
This installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start.
sudo make install-config8 E5 @7 b  W; n  ~2 f  _, X+ }
Install Apache Config Files
This installs the Apache web server configuration files and configures Apache settings.
sudo make install-webconf
' {' B1 ?2 ?3 q; E9 qsudo a2enmod rewrite
- m  K3 v- `0 ]' vsudo a2enmod cgi* N( M$ c% f. q7 i
Configure Firewall
You need to allow port 80 inbound traffic on the local firewall so you can reach the Nagios Core web interface.
sudo ufw allow Apache
/ Q3 y) L1 l$ J. Jsudo ufw reload
3 q# Q1 I: l9 [$ D: ?) C8 H$ HCreate nagiosadmin User Account
You'll need to create an Apache user account to be able to log into Nagios.
The following command will create a user account called nagiosadmin and you will be prompted to provide a password for the account.
sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
  E) u4 e5 a. m9 N
When adding additional users in the future, you need to remove -c from the above command otherwise it will replace the existing nagiosadmin user (and any other users you may have added).
, ~' R  X9 Z! T$ T

# h! \; P9 e% `/ N$ uStart Apache Web Server
===== Ubuntu 14.x =====
Need to restart it because it is already running.
sudo service apache2 restart  c/ c0 q6 \' R# {9 L2 R& |% S
===== Ubuntu 15.x / 16.x / 17.x /18.x =====
Need to restart it because it is already running.
sudo systemctl restart apache2.service3 C$ P, ~( u& D# s7 M
Start Service / Daemon
This command starts Nagios Core.
===== Ubuntu 14.x =====
sudo start nagios
  U# \, x' v' c" S/ X/ d: k# A
===== Ubuntu 15.x / 16.x / 17.x / 18.x =====
sudo systemctl start nagios.service7 h) l$ d- y4 h* @  F2 n% j! L6 f
Test Nagios
Nagios is now running, to confirm this you need to log into the Nagios Web Interface.
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
You will be prompted for a username and password. The username is nagiosadmin (you created it in a previous step) and the password is what you provided earlier.
Once you have logged in you are presented with the Nagios interface. Congratulations you have installed Nagios Core.
BUT WAIT ...
Currently you have only installed the Nagios Core engine. You'll notice some errors under the hosts and services along the lines of:
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_load, ...) failed. errno is 2: No such file or directory
These errors will be resolved once you install the Nagios Plugins, which is covered in the next step.
6 \- q8 v  o) C4 |
Installing The Nagios Plugins
Nagios Core needs plugins to operate properly. The following steps will walk you through installing Nagios Plugins.
These steps install nagios-plugins 2.2.1. Newer versions will become available in the future and you can use those in the following installation steps. Please see the releases page on GitHub for all available versions.
# z+ i0 w# x2 P" S8 N
Please note that the following steps install most of the plugins that come in the Nagios Plugins package. However there are some plugins that require other libraries which are not included in those instructions. Please refer to the following KB article for detailed installation instructions:
' t* O( g9 Y4 |  A
Prerequisites
Make sure that you have the following packages installed.
sudo apt-get install -y autoconf gcc libc6 libmcrypt-dev make libssl-dev wget bc gawk dc build-essential snmp libnet-snmp-perl gettext
7 b. A. d& u7 ~7 p6 e& {Downloading The Sourcecd /tmp
- X8 H: o% N) ~" U% }3 Bwget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz1 `; x% ]# S3 m2 N' h6 |. ^
tar zxf nagios-plugins.tar.gz
3 E& k* X* q1 [Compile + Installcd /tmp/nagios-plugins-release-2.2.1/
) _3 E! s) G2 J1 R* @  jsudo ./tools/setup
/ [0 V/ K- `/ lsudo ./configure6 h/ f/ i; h. p
sudo make
2 b3 K: x( a, z& Y/ hsudo make install, o. i8 e# f9 A  I6 q% {
Test Plugins
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
Go to a host or service object and "Re-schedule the next check" under the Commands menu. The error you previously saw should now disappear and the correct output will be shown on the screen.

2 ^8 p' x" p# V: N. S: u7 o$ fService / Daemon Commands
Different Linux distributions have different methods of starting / stopping / restarting / status Nagios.
===== Ubuntu 14.x =====
sudo start nagios
3 B2 g2 H8 R; U. G2 D- zsudo stop nagios7 j: }# l; D0 O2 g2 c
sudo restart nagios; |/ U) A9 }; Q
sudo status nagios6 p4 G& l' m$ v5 P
===== Ubuntu 15.x / 16.x / 17.x / 18.x =====
sudo systemctl start nagios.service
% D$ U. m7 R- K3 E& T6 i" S  Zsudo systemctl stop nagios.service
4 t( u; H: \+ P0 v  }9 Z& dsudo systemctl restart nagios.service# K9 \' v. U% ?3 j  n; C" c
sudo systemctl status nagios.service5 l9 u6 o' t, w" K# L" |+ J

8 e6 Z1 o7 Y4 p8 ?
+ @* n5 c; J3 p
SUSE SLES | openSUSE Leap
Security-Enhanced Linux
This guide is based on SELinux being disabled or in permissive mode. SELinux is not enabled by default on SUSE. If you would like to see if it is enabled run the following command:
ls -la /etc/selinux/config
If the file does not exist, SELinux is not enabled.
9 x" n, P: U* e8 b) `" D
Prerequisites
Perform these steps to install the pre-requisite packages.
===== SUSE SLES 11.3 =====
cd /tmp
  y$ P( P4 k# D# R0 D6 ^wget 'https://nu.novell.com/repo/$RCE/SLE11-SDK-SP3-Pool/sle-11-x86_64/rpm/x86_64/sle-sdk-release-11.3-1.69.x86_64.rpm'
2 S! O; G  \& P: n) }wget 'https://nu.novell.com/repo/$RCE/SLE11-SDK-SP3-Pool/sle-11-x86_64/rpm/x86_64/sle-sdk-release-SDK-11.3-1.69.x86_64.rpm'
- N! b! A$ @. g8 s2 \) R& C) Msudo rpm -ivh sle-sdk-release-*8 k- G3 Q' ]3 u$ Y9 A1 Q
sudo suse_register: m6 A# n1 z% q" l7 G
sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php53 apache2-mod_php53 gd gd-devel& P* j  u2 P+ R$ k
===== SUSE SLES 11.4 =====
cd /tmp
% s; f+ x$ ^  {% p6 Cwget 'https://nu.novell.com/repo/$RCE/SLE11-SDK-SP4-Pool/sle-11-x86_64/rpm/x86_64/sle-sdk-release-11.4-1.55.x86_64.rpm'2 I$ L& m' G4 w. P( _6 [
wget 'https://nu.novell.com/repo/$RCE/SLE11-SDK-SP4-Pool/sle-11-x86_64/rpm/x86_64/sle-sdk-release-SDK-11.4-1.55.x86_64.rpm'
. c( l- w& S, O/ h. Z: ~' ?" M+ bsudo rpm -ivh sle-sdk-release-*
3 X4 _$ w7 g8 w: r# s# `sudo suse_register
; ^7 K5 ]- G1 q1 w3 a+ f8 C; esudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php53 apache2-mod_php53 gd gd-devel
6 N% X4 O2 j1 G. G. E: b
===== SUSE SLES 12 =====
sudo SUSEConnect -p sle-sdk/12/x86_642 y+ r, [, X* a8 Y9 o
sudo SUSEConnect -p sle-module-web-scripting/12/x86_64, M, D3 E$ r1 {1 q, k
sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php5 apache2-mod_php5 gd gd-devel
* j* `  L: x$ S. O) ^: j, ^& b+ P  E
===== SUSE SLES 12.1 =====
sudo SUSEConnect -p sle-sdk/12.1/x86_641 S# M* J+ G7 H9 c) D5 X! e! X% G
sudo SUSEConnect -p sle-module-web-scripting/12/x86_644 i+ @  C( h/ k- y4 q5 Y  L
sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php5 apache2-mod_php5 gd gd-devel3 p) t, y4 g5 a# a9 h
===== SUSE SLES 12.2 =====
sudo SUSEConnect -p sle-sdk/12.2/x86_647 I9 ~% p: `2 u) b; [# z5 a! `( b
sudo SUSEConnect -p sle-module-web-scripting/12/x86_64
* d  [  \) v+ j, u% \2 _$ d" ?sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php5 apache2-mod_php5 gd gd-devel
, A; M4 Y1 h6 w) Z: {6 e" u+ C: R
===== SUSE SLES 12.3 =====
sudo SUSEConnect -p sle-sdk/12.3/x86_64) F  ?2 f# X  z8 l
sudo SUSEConnect -p sle-module-web-scripting/12/x86_644 F2 V  U9 L2 U+ _, F
sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php5 apache2-mod_php5 gd gd-devel5 q) `  B9 ~4 `$ n+ r5 l
===== openSUSE Leap 42.x =====
sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php5 apache2-mod_php5 gd gd-devel
2 H" \) {" ^. W/ Z) w
===== openSUSE Leap 15.x =====
sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php7 apache2-mod_php7 gd gd-devel; Z% e; y$ c3 `% m- E

, }9 M9 H7 L+ u/ K: h- i5 sDownloading the Sourcecd /tmp; V5 p2 o+ {, t& W  {
wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz: v. O* ~. U) ?% T7 X
tar xzf nagioscore.tar.gz
' I! m. q1 n3 o/ A# b% j) f8 }Compilecd /tmp/nagioscore-nagios-4.4.0/
' V8 M/ N  _. C) s& M" dsudo ./configure --with-httpd-conf=/etc/apache2/vhosts.d/ a7 V2 [, ^) [8 ?) c* [* M
sudo make all  K7 l4 P2 a9 U- y  j7 n: [6 I
Create User And Group
This creates the nagios user and group. The apache user is also added to the nagios group.
===== SUSE SLES 11.x =====
sudo make install-groups-users+ `8 \5 l8 o# w: _2 c
sudo /usr/sbin/usermod -A nagios wwwrun! ?, ?& C2 U4 ]1 _
===== SUSE SLES 12.x | openSUSE Leap 42.x / 15.x =====
sudo make install-groups-users
$ l" [6 E8 }, @' v7 p& Msudo /usr/sbin/usermod -a -G nagios wwwrun
) _' Z. J5 V- MInstall Binaries
This step installs the binary files, CGIs, and HTML files.
sudo make install
( K* U7 C0 R% h9 HInstall Service / Daemon
This installs the service or daemon files and also configures them to start on boot.
sudo make install-init
0 k2 k  G* j5 _
Information on starting and stopping services will be explained further on.
  `) N/ d- g" E6 n
Install Command Mode
This installs and configures the external command file.
sudo make install-commandmode2 B1 l8 x( p$ q6 h3 }
Install Configuration Files
This installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start.
sudo make install-config
* S3 F6 U6 X+ A3 a/ @Install Apache Config Files
This installs the Apache web server configuration files. Also configure Apache settings if required.
===== SUSE SLES 11.x =====
sudo make install-webconf' }( p! f, w7 j7 E- a- ]
sudo /usr/sbin/a2enmod rewrite
- _4 [6 U" ?. J' a' ^2 Usudo /usr/sbin/a2enmod cgi
3 M/ X7 o% r7 w# f* y- Wsudo /usr/sbin/a2enmod version
1 L+ H4 C& V9 a9 |1 {sudo /usr/sbin/a2enmod php5
! l- h9 N; x! K1 N* j4 @5 qsudo /sbin/chkconfig --set apache2 on: d$ k" }# i( \
===== SUSE SLES 12.x | openSUSE Leap 42.x =====
sudo make install-webconf
- c0 x+ E  ]7 K  z) C+ m9 l4 esudo /usr/sbin/a2enmod rewrite
& [; B/ s  }7 G* Psudo /usr/sbin/a2enmod cgi( \8 H$ t  z& N/ f  d
sudo /usr/sbin/a2enmod version9 J% j- Y+ y6 m3 z
sudo /usr/sbin/a2enmod php5
) Q0 j3 \5 |0 `3 M4 k9 Wsudo systemctl enable apache2.service5 z6 G7 c2 }' {/ Q- o3 o* o; Q; p
===== openSUSE Leap 15.x =====
sudo make install-webconf  o/ C. J) g8 s9 t! L
sudo /usr/sbin/a2enmod rewrite; H1 z/ Z- e/ V7 U: B
sudo /usr/sbin/a2enmod cgi
/ J! u7 ]2 G4 z2 q# j4 [sudo /usr/sbin/a2enmod version2 i' O  [3 E! y/ Z6 p
sudo /usr/sbin/a2enmod php7
6 V' }8 r5 a; A1 Y9 ^sudo systemctl enable apache2.service
2 }$ v$ S0 x0 F" F& Q$ VConfigure Firewall
You need to allow port 80 inbound traffic on the local firewall so you can reach the Nagios Core web interface.
===== SUSE SLES 11.x =====
sudo sed -i '/FW_SERVICES_EXT_TCP=/s/\"$/\ 80\"/' /etc/sysconfig/SuSEfirewall29 p! ?/ `- O! g% E0 V4 s
sudo /sbin/service SuSEfirewall2_init restart( @0 i) s; p! Y. u8 x# O
sudo /sbin/service SuSEfirewall2_setup restart* O4 p% E0 J9 H1 `% |- N( j1 k
===== SUSE SLES 12.x =====
sudo /usr/sbin/SuSEfirewall2 open EXT TCP 80
% f) C( `; S7 b  B  Msudo systemctl restart SuSEfirewall2
$ e+ N3 ?$ L# q
===== openSUSE Leap 42.x =====
Port 80 is enabled when Apache is installed, nothing needs to be done.
4 D6 r* J4 ^$ b$ G
===== openSUSE Leap 15.x =====
sudo firewall-cmd --zone=public --add-port=80/tcp
. O9 V! Y3 D" m. }2 Ysudo firewall-cmd --zone=public --add-port=80/tcp --permanent
( E# t; h& P( n' g# j  H: Z% i; K9 {7 C: w  t, _4 }
Create nagiosadmin User Account
You'll need to create an Apache user account to be able to log into Nagios.
The following command will create a user account called nagiosadmin and you will be prompted to provide a password for the account.
sudo htpasswd2 -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
! ?7 a% z- f. O9 |  p9 l
When adding additional users in the future, you need to remove -c from the above command otherwise it will replace the existing nagiosadmin user (and any other users you may have added).

7 |* e( P! N' P  X# m" i( Q
  \( ~5 c7 n9 x* M% \4 ?Start Apache Web Server
===== SUSE SLES 11.x =====
sudo /sbin/service apache2 start
$ B; Z# i, z, @. U# R- w
===== SUSE SLES 12.x | openSUSE Leap 42.x / 15.x =====
sudo systemctl start apache2.service
! c' ^! {3 i4 cStart Service / Daemon
This command starts Nagios Core.
===== SUSE SLES 11.x =====
sudo /sbin/service nagios start+ V4 k% Z4 r5 |# F5 n8 |
===== SUSE SLES 12.x | openSUSE Leap 42.x / 15.x =====
sudo systemctl start nagios.service
0 C% R" ~4 x+ r! kTest Nagios
Nagios is now running, to confirm this you need to log into the Nagios Web Interface.
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
You will be prompted for a username and password. The username is nagiosadmin (you created it in a previous step) and the password is what you provided earlier.
Once you have logged in you are presented with the Nagios interface. Congratulations you have installed Nagios Core.
BUT WAIT ...
Currently you have only installed the Nagios Core engine. You'll notice some errors under the hosts and services along the lines of:
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_load, ...) failed. errno is 2: No such file or directory
These errors will be resolved once you install the Nagios Plugins, which is covered in the next step.

; Y; y+ g$ L2 L. V' S3 zInstalling The Nagios Plugins
Nagios Core needs plugins to operate properly. The following steps will walk you through installing Nagios Plugins.
These steps install nagios-plugins 2.2.1. Newer versions will become available in the future and you can use those in the following installation steps. Please see the releases page on GitHub for all available versions.

. C1 _4 l7 X- d5 R; X2 I  s$ v$ \
Please note that the following steps install most of the plugins that come in the Nagios Plugins package. However there are some plugins that require other libraries which are not included in those instructions. Please refer to the following KB article for detailed installation instructions:

; n1 F  \$ o5 w7 VPrerequisites
Make sure that you have the following packages installed.
===== SUSE SLES 11.x / 12.x | openSUSE Leap 42.x =====
sudo zypper --non-interactive install autoconf gcc glibc libmcrypt-devel make libopenssl-devel wget gettext gettext-runtime automake net-snmp perl-Net-SNMP
8 G. I2 E. |. y. c6 P0 c
===== openSUSE Leap 15.x =====
sudo zypper --non-interactive install autoconf gcc glibc libgcrypt-devel make libopenssl-devel wget gettext gettext-runtime automake net-snmp perl-Net-SNMP3 W* t" C; B0 o" e6 L4 H, E" C# k# m2 Z
Downloading The Sourcecd /tmp
, @& m" O5 P5 ~; X/ ~9 _; ?% ^' r* Lwget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz
4 x0 F' x* i( G% L9 Htar zxf nagios-plugins.tar.gz$ P2 e' P. C! K. L& t
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/
2 W. o% |! Q9 L! W2 G$ Asudo ./tools/setup
# C1 }: N# d$ Y) m' K' Xsudo ./configure" I7 L  z$ w) Y  U* p9 J' P% z# E/ A& G
sudo make
0 y! W1 W; g3 f7 D9 I; V6 a0 g4 Dsudo make install7 _# R. u5 u6 K" x; S% r/ \8 X
Test Plugins
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
Go to a host or service object and "Re-schedule the next check" under the Commands menu. The error you previously saw should now disappear and the correct output will be shown on the screen.
; i" ~+ _6 e8 X% q" y4 N' Y0 l
Service / Daemon Commands
Different Linux distributions have different methods of starting / stopping / restarting / status Nagios.
===== SUSE SLES 11.x =====
sudo /sbin/service nagios start
7 z" F7 m- C0 [( Msudo /sbin/service nagios stop
, ]3 n% `9 ]8 p! |# a: t( osudo /sbin/service nagios restart
  S( h. i6 ~( ssudo /sbin/service nagios status
===== SUSE SLES 12.x | openSUSE Leap 42.x / 15.x =====
sudo systemctl start nagios.service! F* Q4 r. ^/ q# s
sudo systemctl stop nagios.service& s5 X9 W4 S0 v  x1 X
sudo systemctl restart nagios.service
3 a0 x, i4 h$ E4 T  Jsudo systemctl status nagios.service
( b9 ?1 I' O/ S3 w; C
" M# k( v( n; O7 E& l8 x, C
# v  f+ t# P* M: N, j* E8 h3 b. e
Debian | Raspbian
All steps on Debian require to run as root. To become root simply run:
Debian:
su# m/ ]7 ^( G1 t$ @" E+ k
Raspbian:
sudo -i/ C2 D7 Z' }6 d
All commands from this point onwards will be as root.
; d+ V$ e% K6 R# n( n
Security-Enhanced Linux
This guide is based on SELinux being disabled or in permissive mode. SELinux is not enabled by default on Debian. If you would like to see if it is installed run the following command:
dpkg -l selinux*$ y1 b/ u' R* E+ W: Y5 K# z
Prerequisites
Perform these steps to install the pre-requisite packages.
===== 7.x / 8.x =====
apt-get update
5 X7 K9 a2 r" Rapt-get install -y autoconf gcc libc6 make wget unzip apache2 apache2-utils php5 libgd2-xpm-dev& c+ b( W! U1 [
===== 9.x =====
apt-get update
& P- S4 p' J- _- h9 J& iapt-get install -y autoconf gcc libc6 make wget unzip apache2 apache2-utils php libgd-dev0 l  {; l9 j# `5 ?9 Y% Q
Downloading the Sourcecd /tmp
% b9 ~( Z& I. e$ x& F. X) z& Wwget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz4 Y: l5 \- i7 q4 b$ h" U: P
tar xzf nagioscore.tar.gz# w- G+ G+ V3 s6 K7 g$ ?$ O
Compilecd /tmp/nagioscore-nagios-4.4.0/
8 Z+ i8 ^; P! o./configure --with-httpd-conf=/etc/apache2/sites-enabled
, g" F( O( |0 T. ]make all
  B3 f5 K3 Q' {5 ]3 qCreate User And Group
This creates the nagios user and group. The www-data user is also added to the nagios group.
make install-groups-users
6 k& c+ ?! K- h* ^% Kusermod -a -G nagios www-data! O/ b1 Q- J4 A* v3 y' V
Install Binaries
This step installs the binary files, CGIs, and HTML files.
make install1 [: g+ Q1 u1 l+ L2 r$ v3 c
Install Service / Daemon
This installs the service or daemon files and also configures them to start on boot.
make install-init
0 m% k6 n; |- R1 `! `* }* A# g/ c
Information on starting and stopping services will be explained further on.

3 F/ S' s" E  O0 \Install Command Mode
This installs and configures the external command file.
make install-commandmode/ K; g, C9 N) e( c7 u6 e9 S# ]1 j
Install Configuration Files
This installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start.
make install-config
* X# R' w" \" V8 l3 r0 CInstall Apache Config Files
This installs the Apache web server configuration files and configures the Apache settings.
make install-webconf
) F" Y' t7 A6 }1 M1 ]. i) ya2enmod rewrite$ t+ c) ]/ G9 D4 ?
a2enmod cgi6 p7 R5 h* i& n8 n
Configure Firewall
You need to allow port 80 inbound traffic on the local firewall so you can reach the Nagios Core web interface.
iptables -I INPUT -p tcp --destination-port 80 -j ACCEPT: Y# M% D2 q$ Z1 O) h4 c) D
apt-get install -y iptables-persistent
Answer yes to saving existing rules

- c+ Q; H0 b: ~3 {8 ]- c: T$ t" ]$ }Create nagiosadmin User Account
You'll need to create an Apache user account to be able to log into Nagios.
The following command will create a user account called nagiosadmin and you will be prompted to provide a password for the account.
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin! G4 t3 ?& s% K- i) d1 T4 z
When adding additional users in the future, you need to remove -c from the above command otherwise it will replace the existing nagiosadmin user (and any other users you may have added).
8 ?' a8 }- h# E6 \4 V& c

( X2 L, Q& d7 T2 o1 u% A  S6 F" Y* I" JStart Apache Web Server
===== 7.x =====
Need to restart it because it is already running.
service apache2 restart
! k2 q8 c8 w- @; N1 y: k8 Y
===== 8.x / 9.x =====
Need to restart it because it is already running.
systemctl restart apache2.service
8 S( U' e: v* t; AStart Service / Daemon
This command starts Nagios Core.
===== 7.x =====
service nagios start
% C. o2 K+ C1 M
===== 8.x / 9.x =====
systemctl start nagios.service; ?2 j5 ~5 S, n+ w
Test Nagios
Nagios is now running, to confirm this you need to log into the Nagios Web Interface.
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
You will be prompted for a username and password. The username is nagiosadmin (you created it in a previous step) and the password is what you provided earlier.
Once you have logged in you are presented with the Nagios interface. Congratulations you have installed Nagios Core.
BUT WAIT ...
Currently you have only installed the Nagios Core engine. You'll notice some errors under the hosts and services along the lines of:
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_load, ...) failed. errno is 2: No such file or directory
These errors will be resolved once you install the Nagios Plugins, which is covered in the next step.

7 z* y8 t  b& N( t# vInstalling The Nagios Plugins
Nagios Core needs plugins to operate properly. The following steps will walk you through installing Nagios Plugins.
These steps install nagios-plugins 2.2.1. Newer versions will become available in the future and you can use those in the following installation steps. Please see the releases page on GitHub for all available versions.
, h/ }. J/ {$ {1 A5 p- r: q
Please note that the following steps install most of the plugins that come in the Nagios Plugins package. However there are some plugins that require other libraries which are not included in those instructions. Please refer to the following KB article for detailed installation instructions:
' ]) G3 @* Y3 J% F, ?1 a
Prerequisites
Make sure that you have the following packages installed.
apt-get install -y autoconf gcc libc6 libmcrypt-dev make libssl-dev wget bc gawk dc build-essential snmp libnet-snmp-perl gettext
; _$ H  x3 l; q! J7 _: CDownloading The Sourcecd /tmp, p. ?1 b% n5 H
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz
  V! P1 r; Y3 Star zxf nagios-plugins.tar.gz
% z# J- s" p. r3 a( v5 k4 Q) RCompile + Installcd /tmp/nagios-plugins-release-2.2.1/
7 j7 i/ @) q- Y  q* e0 ?./tools/setup
& t9 N* M1 L3 ?! @  {5 T./configure9 K) c+ \! \& L2 g4 x0 w$ h
make4 {9 D7 Z! m( o- S  e& v: L) q! c' t
make install
" |2 x+ s8 }! b! F4 ?: JTest Plugins
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
Go to a host or service object and "Re-schedule the next check" under the Commands menu. The error you previously saw should now disappear and the correct output will be shown on the screen.
  @& Z; V+ r8 `4 h- I
Service / Daemon Commands
Different Linux distributions have different methods of starting / stopping / restarting / status Nagios.
===== 7.x =====
service nagios start
7 D9 ^' H0 q4 G+ Y7 y" _service nagios stop
- H4 m+ A! Z$ K% H& O+ Wservice nagios restart: n& ?+ u- b0 M& y
service nagios status9 S+ P2 M8 O2 b1 \: b4 z
===== 8.x / 9.x =====
systemctl start nagios.service. e/ w1 [; T1 q8 ]4 T
systemctl stop nagios.service
3 z: C3 }' K0 e$ A+ I$ bsystemctl restart nagios.service
+ d8 G1 A  [, i3 E' Z( Ysystemctl status nagios.service
( v1 U7 _% s. m" I" m, H- `, Q) U
8 i) o+ d( g! P# f5 D8 F- T
Fedora
Security-Enhanced Linux
This guide is based on SELinux being disabled or in permissive mode. Steps to do this are as follows.
sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
, k# |3 @; [4 E- F- k9 ~+ ~0 Msetenforce 0
, e7 a4 N$ z* u  GPrerequisites
Perform these steps to install the pre-requisite packages.
dnf install -y gcc glibc glibc-common perl httpd php wget gd gd-devel: H3 z" M1 {7 [
dnf update -y Downloading the Sourcecd /tmp$ T5 m; [6 V' S! W$ Q2 `
wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz$ Q  G3 ?( t7 M+ |
tar xzf nagioscore.tar.gz+ N4 ?( z% ~8 i4 X0 J( M2 e& u
Compilecd /tmp/nagioscore-nagios-4.4.0/7 p7 J2 \. w% K; H
./configure
) V, f% {; V$ G9 V" A/ xmake all
7 B& J1 f* v: H8 B. q4 V7 G* h, w! N6 W/ }Create User And Group
This creates the nagios user and group. The apache user is also added to the nagios group.
make install-groups-users3 Z9 R3 A; s4 J; v' }6 M3 Y$ k" b
usermod -a -G nagios apache+ P4 h8 M  [4 R: }1 P' {- @: p
Install Binaries
This step installs the binary files, CGIs, and HTML files.
make install
2 b/ @- L( G9 M+ q+ S1 i* }Install Service / Daemon
This installs the service or daemon files and also configures them to start on boot. The Apache httpd service is also configured at this point.
make install-init
0 x7 H: p, O8 g" y( E6 dsystemctl enable httpd.service" f. g8 A  |2 S% M: r
Information on starting and stopping services will be explained further on.

$ J* P. c3 g2 x& QInstall Command Mode
This installs and configures the external command file.
make install-commandmode
: _* r: v; p% n+ J+ G( gInstall Configuration Files
This installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start.
make install-config
0 }. C% h  @) SInstall Apache Config Files
This installs the Apache web server configuration files. Also configure Apache settings if required.
make install-webconf
5 D8 y$ ]8 w7 K) e6 W+ F3 lConfigure Firewall
You need to allow port 80 inbound traffic on the local firewall so you can reach the Nagios Core web interface.
firewall-cmd --zone=FedoraServer --add-port=80/tcp0 `: K) a9 o, S! }
firewall-cmd --zone=FedoraServer --add-port=80/tcp --permanent
/ k  ~# N- L* ?( c, Z& i2 MCreate nagiosadmin User Account
You'll need to create an Apache user account to be able to log into Nagios.
The following command will create a user account called nagiosadmin and you will be prompted to provide a password for the account.
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
1 ~  B9 S) c3 P
When adding additional users in the future, you need to remove -c from the above command otherwise it will replace the existing nagiosadmin user (and any other users you may have added).
. U% o2 H$ m8 [0 n  w9 F

8 a/ u+ \6 s! c+ e% Z4 Z& JStart Apache Web Serversystemctl start httpd.service" Z/ {" J! q' i# ^& h  b0 ~  u
Start Service / Daemon
This command starts Nagios Core.
systemctl start nagios.service4 ~. a# r$ O( u* s2 o
Test Nagios
Nagios is now running, to confirm this you need to log into the Nagios Web Interface.
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
You will be prompted for a username and password. The username is nagiosadmin (you created it in a previous step) and the password is what you provided earlier.
Once you have logged in you are presented with the Nagios interface. Congratulations you have installed Nagios Core.
BUT WAIT ...
Currently you have only installed the Nagios Core engine. You'll notice some errors under the hosts and services along the lines of:
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_load, ...) failed. errno is 2: No such file or directory
These errors will be resolved once you install the Nagios Plugins, which is covered in the next step.

+ P% }/ Z+ `. s4 n4 lInstalling The Nagios Plugins
Nagios Core needs plugins to operate properly. The following steps will walk you through installing Nagios Plugins.
These steps install nagios-plugins 2.2.1. Newer versions will become available in the future and you can use those in the following installation steps. Please see the releases page on GitHub for all available versions.
# y0 M1 S) e: q- s
Please note that the following steps install most of the plugins that come in the Nagios Plugins package. However there are some plugins that require other libraries which are not included in those instructions. Please refer to the following KB article for detailed installation instructions:

% R5 \+ X$ @1 T& k" \3 G. jPrerequisites
Make sure that you have the following packages installed.
dnf install -y gcc glibc glibc-common openssl-devel perl wget gettext make net-snmp net-snmp-utils perl-Net-SNMP automake autoconf8 \  }) J7 h# V
Downloading The Sourcecd /tmp- |' \1 _  K4 L* x) A' B
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz" j5 {# l# m0 k2 ?5 N
tar zxf nagios-plugins.tar.gz9 s( j1 z  e  T% r
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/9 }/ q+ V0 D" j& X4 R. u6 X$ @9 m+ c
./tools/setup
, F% D1 x. Y: t' w! T) n./configure& S/ M2 K) r  @& T. _
make
- G% g6 V: V  @make install! o& E  Z' K+ G7 g4 T; K$ s
Test Plugins
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
Go to a host or service object and "Re-schedule the next check" under the Commands menu. The error you previously saw should now disappear and the correct output will be shown on the screen.

' H0 U) g" @" `/ ~% g; |; vService / Daemon Commands
These commands are for starting / stopping / restarting / status Nagios.
systemctl start nagios.service  ~7 s% M. k+ h$ H
systemctl stop nagios.service
& V* h* ^4 Y7 ]systemctl restart nagios.service
$ ?% i) F2 V$ h+ l$ asystemctl status nagios.service/ {0 Z+ V' W3 Z6 r6 D# l
8 r7 s" h! _$ Y
Arch Linux
Security-Enhanced Linux
This guide is based on SELinux being disabled or in permissive mode. SELinux is not installed on a base build of Arch Linux. If you would like to see if it is enabled run the following command:
ls -la /etc/selinux/config
If the file does not exist, SELinux is not enabled.

3 D. d4 g1 S; vPrerequisites
Perform these steps to install the pre-requisite packages.
pacman --noconfirm -Syyu) B+ z. r% f2 _9 \2 a2 c
pacman --noconfirm -S gcc glibc make wget unzip apache php gd traceroute php-apache Downloading the Sourcecd /tmp
. Z$ ]7 A2 Q  S) p1 @- P* ]. F+ vwget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz
9 B# _0 S8 d( X! ptar xzf nagioscore.tar.gz; [& b8 o: u, n
Compilecd /tmp/nagioscore-nagios-4.4.0/
' O3 \- q7 t& R. F./configure --with-httpd-conf=/etc/httpd/conf/extra/ T* b4 {, n- k6 G6 h4 x  K$ [
make all
1 Y7 n5 C% E, D& FCreate User And Group
This creates the nagios user and group. The http user is also added to the nagios group.
make install-groups-users
8 {7 }) U8 s" X9 U  g/ f0 T- g# ]usermod -a -G nagios http
. I/ c8 y* u/ FInstall Binaries
This step installs the binary files, CGIs, and HTML files.
make install; l) h  e5 a4 q5 C* K
Install Service / Daemon
This installs the service or daemon files and also configures them to start on boot. The Apache httpd service is also configured at this point.
make install-init
5 y( E% @* Y# h: N) D  K* ]( f- csystemctl enable httpd.service1 R& u0 p! O7 E- E4 }
Install Command Mode
This installs and configures the external command file.
make install-commandmode" O6 U( B7 q# r+ X
Install Configuration Files
This installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start.
make install-config
# E8 C1 R! E) O8 ]Install Apache Config Files
This installs the Apache web server configuration files.
make install-webconf
' V1 e: h+ y  p# I
As well as installing the Apache web server configuration files, there are additional changes required to the Apache config file httpd.conf to enable modules.
Commands that do all of these changes are below, but first is a list of the changes being made.
Change this:
LoadModule mpm_event_module modules/mod_mpm_event.so
To this:
#LoadModule mpm_event_module modules/mod_mpm_event.so9 w/ w+ _3 P& L  a* f& Y/ k' f/ w
Change this:
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
To this:
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so6 V8 n, \$ f/ ?$ K$ y
Change this:
<IfModule !mpm_prefork_module>( k6 p  Z$ {$ P4 ~2 D
        #LoadModule cgid_module libexec/apache24/mod_cgid.so
' f9 ^) I; [, E8 N2 Q: Z</IfModule>  R, N) F' i( F/ o: R# W) H  D
<IfModule mpm_prefork_module>
4 t2 \) p8 H/ P& [7 b5 g! P        #LoadModule cgi_module libexec/apache24/mod_cgi.so
- E3 B% `3 \& h</IfModule>
To this:
<IfModule !mpm_prefork_module>' R4 |  [* s4 m) Q
        LoadModule cgid_module libexec/apache24/mod_cgid.so' d% `6 Z  ?/ i3 p" s
</IfModule>" {+ r$ P& L2 F# \" L  F
<IfModule mpm_prefork_module>
4 j- {: @! i, G% s1 D        LoadModule cgi_module libexec/apache24/mod_cgi.so. r1 [1 S# M. h+ |
</IfModule>
9 b6 |! e3 W, ~  E. F
Change this:
<IfModule dir_module>
2 R9 S  M, v. v0 @    DirectoryIndex index.html
6 R  w' ^( j1 D( j' x' E# H4 K</IfModule>
To this:
<IfModule dir_module>
8 X4 q. U2 L. L7 B0 Y! F    DirectoryIndex index.php index.html index.htm AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps2 {. [+ Y. U$ V7 v
</IfModule>
( C% K  Y3 Q6 W
Add these lines to the end of the file:
LoadModule php7_module modules/libphp7.so+ d9 X! p' n6 L, ?$ x" u& ?: k
Include "conf/extra/nagios.conf"
" ]) i, ]1 _. X3 u: dInclude "conf/extra/php7_module.conf"" s* ?$ R3 K; T3 Y6 Z, ~
<FilesMatch ".php$">! w8 o- F- M+ u8 N6 B. l% E; K
    SetHandler application/x-httpd-php" ?6 j$ q% ^! z+ c+ L+ S  C
</FilesMatch>* b% w0 Q2 f6 u3 E2 `
<FilesMatch ".phps$">+ y1 @2 E. d. c8 P8 N
    SetHandler application/x-httpd-php-source
4 f, b: w0 p' n+ M</FilesMatch>3 R$ T) t/ V6 O' I
Execute the following commands to make the changes described above:
sed -i 's/^LoadModule mpm_event_module modules\/mod_mpm_event\.so/#LoadModule mpm_event_module modules\/mod_mpm_event\.so/g' /etc/httpd/conf/httpd.conf
3 Y6 ]( r% X+ j5 nsed -i 's/^#LoadModule mpm_prefork_module modules\/mod_mpm_prefork\.so/LoadModule mpm_prefork_module modules\/mod_mpm_prefork\.so/g' /etc/httpd/conf/httpd.conf
; y3 D* V$ v- Psed -i 's/DirectoryIndex index.html/DirectoryIndex index.php index.html index.htm AddType application\/x-httpd-php .phpAddType application\/x-httpd-php-source .phps/g' /etc/httpd/conf/httpd.conf7 J9 D" @. D* }
sed -i 's/#LoadModule cgid_module/LoadModule cgid_module/g' /etc/httpd/conf/httpd.conf1 H8 V. r' j, G" Q
sed -i 's/#LoadModule cgi_module/LoadModule cgi_module/g' /etc/httpd/conf/httpd.conf
5 j. I! X1 v$ k0 z; Qecho 'LoadModule php7_module modules/libphp7.so' >> /etc/httpd/conf/httpd.conf
1 _9 `, K9 e$ \* Z3 I9 Lecho 'Include "conf/extra/nagios.conf"' >> /etc/httpd/conf/httpd.conf8 j' q+ u% \, Z3 L. {9 g. c8 i
echo 'Include "conf/extra/php7_module.conf"' >> /etc/httpd/conf/httpd.conf4 J! w2 F2 C, f* G
printf '\n<FilesMatch ".php$">\n' >> /etc/httpd/conf/httpd.conf
  N4 J5 V8 J6 _5 @. ^0 K" eprintf '\tSetHandler application/x-httpd-php\n' >> /etc/httpd/conf/httpd.conf5 c1 U* x* Y! @0 v4 {
printf '</FilesMatch>\n' >> /etc/httpd/conf/httpd.conf* G8 L  e. K0 `2 E
printf '<FilesMatch ".phps$">\n' >> /etc/httpd/conf/httpd.conf
/ x) N2 |- G. F4 O( l# s' W8 Aprintf '\tSetHandler application/x-httpd-php-source\n' >> /etc/httpd/conf/httpd.conf
9 m# h, I6 g( q* Q% _printf '</FilesMatch>\n' >> /etc/httpd/conf/httpd.conf
8 f- u0 P0 t- W6 OConfigure Firewall
Arch Linux does not have a firewall enabled in a fresh installation. Please refer to the Arch Linux documentation on allowing TCP port 80 inbound.
Create nagiosadmin User Account
You'll need to create an Apache user account to be able to log into Nagios.
The following command will create a user account called nagiosadmin and you will be prompted to provide a password for the account.
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin' Q- K0 k6 t, \( [( w+ t
When adding additional users in the future, you need to remove -c from the above command otherwise it will replace the existing nagiosadmin user (and any other users you may have added).
+ f1 D# \. {5 C, I4 q

- a! J% b6 f% m% I- O; mStart Apache Web Serversystemctl start httpd.service
( w* O& e% W, @8 }9 d' w3 PStart Service / Daemon
This command starts Nagios Core.
systemctl start nagios.service
7 G' i4 _1 E% Y3 s/ @, q' s7 ATest Nagios
Nagios is now running, to confirm this you need to log into the Nagios Web Interface.
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
You will be prompted for a username and password. The username is nagiosadmin (you created it in a previous step) and the password is what you provided earlier.
Once you have logged in you are presented with the Nagios interface. Congratulations you have installed Nagios Core.
BUT WAIT ...
Currently you have only installed the Nagios Core engine. You'll notice some errors under the hosts and services along the lines of:
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_load, ...) failed. errno is 2: No such file or directory
These errors will be resolved once you install the Nagios Plugins, which is covered in the next step.

0 n4 |% q9 h/ b% c! T. n2 Y) ]Installing The Nagios Plugins
Nagios Core needs plugins to operate properly. The following steps will walk you through installing Nagios Plugins.
These steps install nagios-plugins 2.2.1. Newer versions will become available in the future and you can use those in the following installation steps. Please see the releases page on GitHub for all available versions.
$ C5 b; Q" q+ y
Please note that the following steps install most of the plugins that come in the Nagios Plugins package. However there are some plugins that require other libraries which are not included in those instructions. Please refer to the following KB article for detailed installation instructions:
0 e& T: \$ u: d5 x
Prerequisites
Make sure that you have the following packages installed.
pacman --noconfirm -S autoconf gcc glibc make openssl wget perl gettext net-snmp perl-net-snmp automake autoconf
) T) Z& b3 H, D9 Q0 E$ A/ U4 I5 [7 ^: f& ZDownloading The Sourcecd /tmp) H1 w! K  c9 |0 w
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz, Q; q5 E. f8 ~* s5 n8 P9 L* `
tar zxf nagios-plugins.tar.gz
! Y4 |/ G1 s; |" H8 |Compile + Installcd /tmp/nagios-plugins-release-2.2.1/0 [# s: P  s) i& Y
./tools/setup
3 \% x+ d3 V/ H. }5 n' ?1 G$ Z./configure& o! \1 _, \$ W$ m; e$ |
make+ {; F) Q& K; W/ u) v
make install
( P2 g) L6 X( T) |/ N6 t8 JTest Plugins
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
Go to a host or service object and "Re-schedule the next check" under the Commands menu. The error you previously saw should now disappear and the correct output will be shown on the screen.

, w0 W( G/ E- s! ~& S1 [0 u  V' HService / Daemon Commands
Different Linux distributions have different methods of starting / stopping / restarting / status Nagios.
systemctl start nagios.service
5 M3 \  |$ s) ]1 X; osystemctl stop nagios.service
& K( z) e4 v3 H9 ysystemctl status nagios.service
  b4 a7 `8 m' m- h; m# H8 C4 _
4 o3 {* \2 i2 E3 c) H1 n, g8 g9 o- u8 x8 C% P2 d+ g
Gentoo
Security-Enhanced Linux
This guide is based on SELinux being disabled or in permissive mode. SELinux is not installed on a base build of Gentoo. If you would like to see if it is enabled run the following command:
ls -la /etc/selinux/config
If the file does not exist, SELinux is not enabled.
* P, S! A6 U! t1 i" E
Prerequisites
Perform these steps to install the pre-requisite packages.
emerge --sync
( d, a5 }3 f7 Z$ x% F/ vmkdir -p /etc/portage/package.use, z2 v2 r( E& R: y3 z9 E) c' B
echo "www-servers/apache dir cgi cgid event prefork apache2_modules_version" >> /etc/portage/package.use/apache& ?/ T7 o* y* L0 q9 J3 h
echo "dev-lang/php apache2" >> /etc/portage/package.use/php5 e- t% r& P+ I3 u
echo "app-eselect/eselect-php apache2" >> /etc/portage/package.use/eselect-php* S' n; {. j. {( K
echo "media-libs/gd gd png jpeg" >> /etc/portage/package.use/gd
9 ~8 w; @) b7 [1 t# A5 G1 xemerge --noreplace sys-devel/gcc sys-libs/glibc net-misc/wget app-arch/unzip www-servers/apache dev-lang/php media-libs/gd Downloading the Sourcecd /tmp8 g0 _6 W3 e( J+ \- o- x
wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz
: T( N% c* V5 r( ftar xzf nagioscore.tar.gz
3 M% _( k* ]. `( ~  l+ @7 rCompilecd /tmp/nagioscore-nagios-4.4.0/9 ], h; V) O8 W/ a
./configure --with-httpd-conf=/etc/apache2/vhosts.d --sysconfdir=/usr/local/nagios/etc
  a8 G' y& k- @" T. v" qmake all+ p0 n( p" |  d
Create User And Group
This creates the nagios user and group. The http user is also added to the nagios group.
make install-groups-users
$ [' [1 H( O8 @5 I7 Iusermod -a -G nagios apache8 v2 B; q6 w! ~+ D/ d& R
Install Binaries
This step installs the binary files, CGIs, and HTML files.
make install$ }7 A) R, F( t1 d% v7 L& [4 U
Install Service / Daemon
This installs the service or daemon files and also configures them to start on boot. The apache2 service also needs to be configured to start at boot.
===== openrc =====
make install-init
4 u$ H3 K$ w! H2 E( Y) i- jrc-update add apache2 default/ E* d1 T- G- x' R! h
===== systemd =====
make install-init' L" k4 l3 S8 u, I
systemctl enable apache2.service% |" c9 n4 O1 m; Z% r; U+ V
Install Command Mode
This installs and configures the external command file.
make install-commandmode( }- r) u" E, O* Z( F! Z+ E( o
Install Configuration Files
This installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start.
make install-config0 R- u2 s- ?1 [7 k9 L" J
Install Apache Config Files
This installs the Apache web server configuration files.
make install-webconf) G) ?6 f& Z9 N6 q- C  b8 t
As well as installing the Apache web server configuration files, there are additional changes required to the Apache config file apache2 to enable modules.
Commands that do all of these changes are below, but first is a list of the changes being made.
In the file /etc/conf.d/apache2 change this:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE"
To this:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP"/ N1 U  q- C$ V# v: K1 Z6 k' q
The /run/apache_ssl_mutex directory also needs to be created.

  B0 }6 H/ r# u2 X  }
Execute the following commands to make the change described above:
sed -i '/^APACHE2_OPTS=/s/\([^"]*\)"$/\1 '"-D PHP"'"/' /etc/conf.d/apache2$ G! i2 M. g6 O
mkdir -p /run/apache_ssl_mutex
) R  ]# H5 v, x  S. V/ Q' MConfigure Firewall
Gentoo does not have a firewall enabled in a fresh installation. Please refer to the Gentoo documentation on allowing TCP port 80 inbound.
Create nagiosadmin User Account
You'll need to create an Apache user account to be able to log into Nagios.
The following command will create a user account called nagiosadmin and you will be prompted to provide a password for the account.
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
4 q" Q- a! K5 D- b
When adding additional users in the future, you need to remove -c from the above command otherwise it will replace the existing nagiosadmin user (and any other users you may have added).

: k; q! O( K. h! I  G
! R  f7 T# b; @5 v* G2 i7 k$ gRetart Apache Web Server
===== openrc =====
rc-service apache2 restart
5 O! R$ C. O1 {7 R% S
===== systemd =====
systemctl restart apache2.service
. X$ t, L8 }+ h1 R! fStart Service / Daemon
This command starts Nagios Core.
===== openrc =====
rc-service nagios start; {2 ~" u! W# T9 I, f
===== systemd =====
systemctl start nagios.service
* Z  l: ?( R3 j" o! j2 ]Test Nagios
Nagios is now running, to confirm this you need to log into the Nagios Web Interface.
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
You will be prompted for a username and password. The username is nagiosadmin (you created it in a previous step) and the password is what you provided earlier.
Once you have logged in you are presented with the Nagios interface. Congratulations you have installed Nagios Core.
BUT WAIT ...
Currently you have only installed the Nagios Core engine. You'll notice some errors under the hosts and services along the lines of:
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_load, ...) failed. errno is 2: No such file or directory
These errors will be resolved once you install the Nagios Plugins, which is covered in the next step.
. x' k) ~8 k; g7 \
Installing The Nagios Plugins
Nagios Core needs plugins to operate properly. The following steps will walk you through installing Nagios Plugins.
These steps install nagios-plugins 2.2.1. Newer versions will become available in the future and you can use those in the following installation steps. Please see the releases page on GitHub for all available versions.
9 b7 e* p) G, X/ d9 X  G' i: r, o3 f
Please note that the following steps install most of the plugins that come in the Nagios Plugins package. However there are some plugins that require other libraries which are not included in those instructions. Please refer to the following KB article for detailed installation instructions:

: `9 X4 V6 U, W# C6 K# QPrerequisites
Make sure that you have the following packages installed.
emerge --noreplace sys-devel/gcc sys-libs/glibc net-misc/wget sys-devel/make sys-devel/gettext sys-devel/automake sys-devel/autoconf dev-libs/openssl net-analyzer/net-snmp dev-perl/Net-SNMP
9 f$ r! V1 Z4 Y* t6 MDownloading The Sourcecd /tmp
( g% }' E8 E; ~& L% I1 dwget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz+ a- S1 ~" I1 D$ V8 V6 b4 A
tar zxf nagios-plugins.tar.gz0 U) U  ?. z' f8 n- b7 m; P
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/; |6 f$ y/ E' w4 d" e2 T
./tools/setup
. q7 B8 \. G" Y0 X* w& S. v1 n./configure
: y& U7 r+ f% s' ?3 N2 emake' t1 _& R( G+ j9 g% a( w
make install/ q6 P% b8 |& a
chmod u+s /bin/ping) N/ M" E  o6 H, |: X
chmod u+s /bin/ping6
' o7 [; Z1 M6 s2 w9 @Test Plugins
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
Go to a host or service object and "Re-schedule the next check" under the Commands menu. The error you previously saw should now disappear and the correct output will be shown on the screen.

% v2 {, `0 ^0 _, C5 B( tService / Daemon Commands
The different init systems have different methods of starting / stopping / restarting / status Nagios.
===== openrc =====
rc-service nagios start
" V: W2 ^, \! Z6 ~  src-service nagios stop
. U2 v7 r, i$ C- u3 V0 t+ crc-service nagios status
( R/ \$ w# t6 a$ o8 V, }# X6 irc-service nagios restart ; u" [3 |4 b+ Q% a
===== systemd =====
systemctl start nagios.service * f& v) I1 l/ Z3 d
systemctl stop nagios.service
. g7 o" ?$ Q5 |; [8 w; [systemctl status nagios.service
0 Y7 n# A( `9 d: m8 r: \7 j# ssystemctl restart nagios.service1 v4 A" r( K! j3 c3 o' ]
: {2 l+ }. i8 q* ]# f% g

; h& E; r5 d# l& C
FreeBSD
Security-Enhanced Linux
This guide is based on SELinux being disabled or in permissive mode. SELinux is not enabled by default on FreeBSD. If you would like to see if it is enabled run the following command:
ls -la /etc/selinux/config
If the file does not exist, SELinux is not enabled.
% G: y" ~4 O; D( I4 ^( Y
Prerequisites
Perform these steps to install the pre-requisite packages.
pkg install -y wget autoconf automake gmake gettext gcc apache24 php70 php70-extensions mod_php70 libgd Downloading the Sourcecd /tmp
" Y" [: W; Z" F1 Dwget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz
+ E# V! U- v4 r! v, Itar xzf nagioscore.tar.gz
' q8 u5 Z3 P, `8 }9 L1 e( `5 sCompilecd /tmp/nagioscore-nagios-4.4.0/
7 W% Y  k" E3 c5 P5 M$ P% r./configure --with-httpd-conf=/usr/local/etc/apache24/Includes
% k. a# M7 V2 L( C2 c# Dgmake all6 y6 e; d* T4 a( ?
Create User And Group
This creates the nagios user and group. The www user is also added to the nagios group.
make install-groups-users
& Q8 v* o' s$ Q* G/ Ypw group mod nagios -m www
1 f# p) R* V% ~  J+ y1 i" VInstall Binaries
This step installs the binary files, CGIs, and HTML files.
gmake install
9 x# o) |2 ~  c0 k, s+ a' kchown nagios:nagios /usr/local/nagios/bin/*
8 n' Y/ O3 }% ]) c; F0 L( O, OInstall Service / Daemon
This installs the service or daemon files and also configures them to start on boot.
gmake install-init3 h& V0 W7 o" U7 |
echo '/usr/local/etc/rc.d/nagios start' >> /etc/rc.local
8 Z- m! z0 x1 k, }, k# u  z8 b
Information on starting and stopping services will be explained further on.

* {- x! {& `! H7 Y6 k# g3 n& }Install Command Mode
This installs and configures the external command file.
gmake install-commandmode( F( X& b" Z3 X, x
Install Configuration Files
This installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start.
gmake install-config
8 X- \. J. d; c! [* \. _Install Apache Config Files
This installs the Apache web server configuration files.
gmake install-webconf
+ M& l% x6 w3 v
As well as installing the Apache web server configuration files, there are additional changes required to the Apache config file httpd.conf to enable modules.
Commands that do all of these changes are below, but first is a list of the changes being made.
Change this:
<IfModule !mpm_prefork_module>
7 A: W* G* @4 R! s" b6 B* {        #LoadModule cgid_module libexec/apache24/mod_cgid.so  c0 p- ~, u  u
</IfModule>$ K, b3 Q5 [, e# R, i8 H
<IfModule mpm_prefork_module>
( Q! T1 P3 L8 _5 ^+ q! k( }+ M% I        #LoadModule cgi_module libexec/apache24/mod_cgi.so5 c. ?0 p/ u/ N1 K4 Z- g- S$ [
</IfModule>
To this:
<IfModule !mpm_prefork_module>
: X/ s' X0 L) H        LoadModule cgid_module libexec/apache24/mod_cgid.so
! w9 [' R3 X' w</IfModule>
% {- ]. }+ b& h, z+ t/ ]$ |<IfModule mpm_prefork_module>' p- v: P2 y7 x! C- n- {  Y
        LoadModule cgi_module libexec/apache24/mod_cgi.so
* Y, k. W* ^3 H</IfModule>  a5 \0 t7 m/ n1 L' ?7 Q, X6 Z
Change this:
<IfModule dir_module>
" b/ Q  r# i1 Q% d7 e& a    DirectoryIndex index.html
' s, ]. i* V7 o0 P</IfModule>
To this:
<IfModule dir_module>; J1 v# f7 [& \& E: S! [" I7 e8 d  u3 L; R
    DirectoryIndex index.php index.html index.htm AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps7 i% G4 U' R2 c$ k  F
</IfModule>
% J% O" Y) P$ Q5 ]' R# U
Add these lines to the end of the file:
<FilesMatch ".php$">
$ j' g3 q0 M: @2 P- n: }    SetHandler application/x-httpd-php
2 e& |9 n  c% C; Z& _</FilesMatch>7 P, o& v7 m* a1 x2 u4 [, \; k$ u8 B6 N( C
<FilesMatch ".phps$">
* \* y4 O- \1 c% |: \- C0 W) f    SetHandler application/x-httpd-php-source5 J3 |+ b% I, N0 m2 l& Z1 ~5 ?1 ~; n
</FilesMatch>1 U5 B& F* f' c' x
Execute the following commands to make the changes described above:
cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
9 s3 l* |1 r( P" c* S  i0 U0 ]echo 'apache24_enable="YES"' >> /etc/rc.conf& H- e3 `. @3 k) _3 A
sed -i '' 's/DirectoryIndex index.html/DirectoryIndex index.php index.html index.htm AddType application\/x-httpd-php .phpAddType application\/x-httpd-php-source .phps/g' /usr/local/etc/apache24/httpd.conf3 x# }- ?- _" f) T- h8 c
sed -i '' 's/#LoadModule cgid_module/LoadModule cgid_module/g' /usr/local/etc/apache24/httpd.conf5 K& u2 M6 Y$ q
sed -i '' 's/#LoadModule cgi_module/LoadModule cgi_module/g' /usr/local/etc/apache24/httpd.conf4 v9 |2 Z9 e* d+ B+ Q- m
printf '\n<FilesMatch ".php$">\n' >> /usr/local/etc/apache24/httpd.conf0 `: ^" W$ n" [) n4 T
printf '\tSetHandler application/x-httpd-php\n' >> /usr/local/etc/apache24/httpd.conf
( E9 T0 w' @" f2 \  Pprintf '</FilesMatch>\n' >> /usr/local/etc/apache24/httpd.conf; c' L, _! y3 v& l& T3 c% a
printf '<FilesMatch ".phps$">\n' >> /usr/local/etc/apache24/httpd.conf; n& F# o4 L: K
printf '\tSetHandler application/x-httpd-php-source\n' >> /usr/local/etc/apache24/httpd.conf3 R1 _# |. q' m' @1 o
printf '</FilesMatch>\n' >> /usr/local/etc/apache24/httpd.conf5 x# @  E+ j4 z2 W9 w. _& y# k+ p# M
Configure Firewall
Please refer to the FreeBSD documentation for information on how to enable or configure IP Filter to allow TCP port 80 inbound.

2 ]+ q0 O" w1 n. [) ?5 Y5 j, w( M$ H& ^" k) m
Create nagiosadmin User Account
You'll need to create an Apache user account to be able to log into Nagios.
The following command will create a user account called nagiosadmin and you will be prompted to provide a password for the account.
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin# U3 p, C' D. z5 f' E8 K
When adding additional users in the future, you need to remove -c from the above command otherwise it will replace the existing nagiosadmin user (and any other users you may have added).
! {! n  J7 G' e0 L# u! |; z1 a

3 V+ k; W  R1 m0 ]+ w& F: SStart Apache Web Serverservice apache24 start: B2 j0 L4 |. b# }% c! Y4 i" x
Start Service / Daemon
This command starts Nagios Core.
service nagios start! Y3 z4 _$ Z& D# \' l7 N
Test Nagios
Nagios is now running, to confirm this you need to log into the Nagios Web Interface.
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
You will be prompted for a username and password. The username is nagiosadmin (you created it in a previous step) and the password is what you provided earlier.
Once you have logged in you are presented with the Nagios interface. Congratulations you have installed Nagios Core.
BUT WAIT ...
Currently you have only installed the Nagios Core engine. You'll notice some errors under the hosts and services along the lines of:
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_load, ...) failed. errno is 2: No such file or directory
These errors will be resolved once you install the Nagios Plugins, which is covered in the next step.
% _8 ^- e  Q! c( ?5 m1 X1 q" w
Installing The Nagios Plugins
Nagios Core needs plugins to operate properly. The following steps will walk you through installing Nagios Plugins.
These steps install nagios-plugins 2.2.1. Newer versions will become available in the future and you can use those in the following installation steps. Please see the releases page on GitHub for all available versions.

# X6 {" g- m1 j9 o
Please note that the following steps install most of the plugins that come in the Nagios Plugins package. However there are some plugins that require other libraries which are not included in those instructions. Please refer to the following KB article for detailed installation instructions:
- P- |0 f* @( p6 X) u
Prerequisites
Make sure that you have the following packages installed. In the steps below, when installing FreeBSD packages you will be prompted with screens asking what you would like installed. You can just press Enter to accept the default selections.
pkg install -y wget autoconf automake gettext gcc openssl-devel net-snmp p5-Net-SNMP-Util
/ b* i* L0 X/ L  H# D0 X, UDownloading The Sourcecd /tmp5 M/ C+ o" s1 F" P2 w
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz
) Z2 {- U) g7 Z& n& u1 c) x$ y! s: Atar zxf nagios-plugins.tar.gz
2 b: A4 O6 `$ zCompile + Installcd /tmp/nagios-plugins-release-2.2.1/
" l7 o* i: H- E- _./tools/setup7 {7 h* i4 C' j) R8 ^  O
./configure
" M: N- X" ~; t. Mgmake* C! p7 w8 R& S
gmake install' r6 @* X" {- c
Test Plugins
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
Go to a host or service object and "Re-schedule the next check" under the Commands menu. The error you previously saw should now disappear and the correct output will be shown on the screen.

# f0 O: T) a1 s& d) _6 [Service / Daemon Commands
Different Linux distributions have different methods of starting / stopping / restarting / status Nagios.
service nagios start
2 G/ R1 j# n0 i' H* z# Pservice nagios stop4 g4 Q$ \3 t7 \( X
service nagios restart
, J) y. z4 {  ?service nagios status8 j8 [7 H( ^; P$ c/ c

8 `* r! B7 K) R7 G* J/ o3 |5 D: Q" \* Q4 V0 ?- G( V
Solaris
Tested with Solaris 11.

& K9 }/ J. _. j. kSecurity-Enhanced Linux
SELinux is not implemented in Solaris and hence is not an issue.
Prerequisites
Perform these steps to install the pre-requisite packages.
echo 'export PATH=$PATH:/opt/csw/bin:/usr/xpg4/bin:/usr/sfw/bin' >> ~/.profile2 y; y* J9 K9 Q/ K+ k( |5 E0 |
source ~/.profile
- z# U8 b! n2 o8 l$ hpkgadd -d http://get.opencsw.org/now0 t6 |* z8 n  S# ^
answer all
( b: D1 e  i; K1 i" O5 janswer y! c) N* P+ X; x
perl -ni.bak -le 'print; print "mirror=http://mirrors.ibiblio.org/opencsw/stable" if /mirror=/' /etc/opt/csw/pkgutil.conf9 g8 s) e. W! e: b; _
pkgutil -y -i autoconf automake unzip gd
: j0 b6 r0 N/ J8 Ypkg install gcc-45 web/php-53 apache-php53 gd Downloading the Sourcecd /tmp
  A6 H; L! u* J: b0 h6 ywget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz. u' Q9 a% V8 m  O2 w7 o
tar xzf nagioscore.tar.gz
/ k9 @( q! S- z7 e1 i0 uCompilecd /tmp/nagioscore-nagios-4.4.0/
4 g6 j3 ]+ j/ Z7 u./configure --with-httpd-conf=/etc/apache2/2.2/conf.d --with-gd-inc=/usr/include/gd2
" K8 U8 [4 f, s; g% \! Ngmake all
4 X  @, |  x) p: z. T+ j+ fCreate User And Group
This creates the nagios user and group. The webservd user is also added to the nagios group.
gmake install-groups-users- x, s7 W( r# w1 q7 i& v/ _
usermod -G nagios webservd
) i9 r/ J: t1 Y, `1 XInstall Binaries
This step installs the binary files, CGIs, and HTML files.
gmake install, u' g$ d" b! s( C
Install Service / Daemon
This installs the service or daemon files and also configures them to start on boot. The Apache httpd service is also configured at this point.
gmake install-init' P" E  R8 A8 S+ T) l) H: g2 W/ P
svcbundle -o /lib/svc/manifest/site/nagios.xml -s service-name=application/nagios -s rc-script=/etc/init.d/nagios:2 -s model=contract
3 ]8 Z5 j# U6 L! s% |+ n
Information on starting and stopping services will be explained further on.

4 `5 |  ?& g  PInstall Command Mode
This installs and configures the external command file.
gmake install-commandmode1 G4 |7 K8 x2 m# B
Install Configuration Files
This installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start.
gmake install-config
: F+ Y" N# {% }: ]6 G9 O3 lInstall Apache Config Files
This installs the Apache web server configuration files. Also configure Apache settings if required.
gmake install-webconf
$ @" o& p( Y; O8 A# Z# {4 dConfigure Firewall
On a manually networked system, IP Filter is not enabled by default. Please refer to the Solaris documentation for information on how to enable or configure IP Filter to allow TCP port 80 inbound.
) b( i' u1 I) y. T2 u" M. B) P8 m, `& @
Create nagiosadmin User Account
You'll need to create an Apache user account to be able to log into Nagios.
The following command will create a user account called nagiosadmin and you will be prompted to provide a password for the account.
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin8 Q9 P+ Y' C3 {
When adding additional users in the future, you need to remove -c from the above command otherwise it will replace the existing nagiosadmin user (and any other users you may have added).

6 S2 Q4 y9 `+ \7 {! Z- e% ?- o
8 F3 j- \8 M8 h3 XStart Apache Web Serversvcadm enable apache22
7 \3 y0 C# r. RStart Service / Daemon
This command starts Nagios Core.
svcadm restart manifest-import# u; f- [7 u" r$ o/ p
svcadm enable nagios
1 E- G: ?' ^  @' N. Z; HTest Nagios
Nagios is now running, to confirm this you need to log into the Nagios Web Interface.
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
You will be prompted for a username and password. The username is nagiosadmin (you created it in a previous step) and the password is what you provided earlier.
Once you have logged in you are presented with the Nagios interface. Congratulations you have installed Nagios Core.
BUT WAIT ...
Currently you have only installed the Nagios Core engine. You'll notice some errors under the hosts and services along the lines of:
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_load, ...) failed. errno is 2: No such file or directory
These errors will be resolved once you install the Nagios Plugins, which is covered in the next step.
2 J: o. ^5 ]0 z% n1 B
Installing The Nagios Plugins
Nagios Core needs plugins to operate properly. The following steps will walk you through installing Nagios Plugins.
These steps install nagios-plugins 2.2.1. Newer versions will become available in the future and you can use those in the following installation steps. Please see the releases page on GitHub for all available versions.
+ Z: |" A# x% j, r3 ^5 Z3 F
Please note that the following steps install most of the plugins that come in the Nagios Plugins package. However there are some plugins that require other libraries which are not included in those instructions. Please refer to the following KB article for detailed installation instructions:
: u3 S. K. j$ l+ ]5 a- H: A
Prerequisites
Already completed as part of the Nagios installation. Some of the plugins require the NET::SNMP perl module. Please refer to the following documentation:

  P; g: b8 Q+ _1 K7 O% S2 m/ @& RDownloading The Sourcecd /tmp" }# M" ?# H+ D: D- }6 l9 ~$ {
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz4 k! P0 \  |( j% }7 z7 N& {
tar zxf nagios-plugins.tar.gz6 h5 m2 P4 Y$ X  R5 M  [4 o
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/; P7 j* p& m4 I5 _" X) |9 {
./tools/setup
! n- P% e8 {; q7 ?./configure
2 q! [' F1 A! @: Y' p8 d3 Ugmake# v% t% z+ @* R9 U6 M
gmake install
. G* Z3 K. C* I. ~8 bTest Plugins
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
Go to a host or service object and "Re-schedule the next check" under the Commands menu. The error you previously saw should now disappear and the correct output will be shown on the screen.
# T6 U$ K* f  x- T# h1 i
Service / Daemon Commands
These commands are for starting / stopping / restarting / status Nagios.
svcadm enable nagios) G' S# j/ u/ u) J
svcadm disable nagios
) @# ?8 ?7 w- K+ ]( J0 Csvcadm restart nagios
7 {# ~# T, h6 V% N" Q, J' v9 ^svcs nagios3 W& K& q! z& v( u) k: A- S
svcs -xv nagios
, C; E- d- [5 L% ysvcadm clear nagios. L: P! [$ y% j
The following KB article has important information on Solaris and services:
. S7 P, X. U- u) h- a. }* E
. i0 A6 z7 Y( O
  O7 N4 e( s% h) @. w; k# Y. w/ f
Apple OS X
Security-Enhanced Linux
SELinux is not implemented in Apple OS X and hence is not an issue.

( @6 r: q5 S7 ?$ K% o; W( ~Prerequisites
First, make sure Xcode is installed. If it is not installed visit the App Store and install Xcode (3.8GB download).
Then you need to download and install MacPorts, instructions for doing this can be found here:
Once you've done this, follow these steps in a terminal session:
sudo xcodebuild -license
" g) z4 H* ]3 C: j+ P) vView the agreement and then type agree
# k8 ^! V" w* }, w( ]sudo xcode-select --install
You will be prompted on your Mac display to install the component, click install
Click Agree
Wait while it is downloaded and installed
Continue in your terminal session (you may need to close and open your terminal session):
sudo /opt/local/bin/port install zlib libpng jpeg gd2 apache2 php70 php70-apache2handler
% K% R& F$ }9 |3 ?: `* O+ z+ qDownloading the Sourcecd /tmp
$ v' R$ t; Q, [! T8 W; Y8 Ecurl -L -o nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz. d* T: S+ m# A
tar xzf nagioscore.tar.gz! R$ ^- W7 s1 @
Compilecd /tmp/nagioscore-nagios-4.4.0/$ R  ?% C6 K4 p% X/ c9 y
sudo ./configure --with-httpd-conf=/opt/local/apache2/conf/extra --with-gd-lib=/opt/local/lib --with-gd-inc=/opt/local/include! W- F1 I% Y3 D+ H6 @* v
sudo make all9 J; r& K; T; G( e; u
Create User And Group
Currently Nagios Core does not have a built in script for creating the nagios user and group. However NRPE v3 does have this script, so we're going to download it and run it which makes things easy.
sudo make install-groups-users
# S( F4 Z" y- h) I6 p# Ksudo dseditgroup -o edit -a _www -t user nagios
  x4 O  P: |) ^* `: V6 }Install Binaries
This step installs the binary files, CGIs, and HTML files.
sudo make install
  U6 L: j  g# p0 n. g2 w/ TInstall Service / Daemon
This installs the script in /etc/rc.d/init.d/nagios which is not the correct way it should be run in OS X however a native OS X launch script does not exist in this version of Nagios Core.
sudo make install-init
8 E& ]! j" Y8 G
You will configure it to start at boot using a Global Daemon property list.
Open the vi text editor with the following command:
sudo vi /Library/LaunchDaemons/org.nagios.nagios.plist
This creates a new file.
Press i on the keyboard to enter insert mode.
Paste the following into the vi editor:
<?xml version="1.0" encoding="UTF-8"?>! }5 y0 j6 R0 ^8 `) _9 o! m
<!DOCTYPE plist PUBLIC "-//Apple/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
0 l, I- i3 Z7 l$ [2 X* h<plist version="1.0">7 h# p7 @( T  }* ^/ L# j# i
<dict>9 i4 P* x+ ~/ ]" R6 \1 [+ n& E  b" F) {
        <key>Label</key>2 m. Y7 r# q4 I
        <string>org.nagios.nagios</string>, L+ a6 M0 \$ E- s, X3 [& @3 B1 W3 x
        <key>UserName</key>" {. V  J: w# M
        <string>nagios</string>
6 B" T1 n7 X$ t5 Y% q' E        <key>GroupName</key>8 ^+ }' A8 E% J. q9 N8 m3 ]
        <string>nagios</string>- u/ m. @5 W- B
        <key>Program</key>
9 d3 U$ c9 `/ m7 p' G0 q# M7 ^7 r        <string>/etc/rc.d/init.d/nagios</string>
+ F( @  w% }- X# n2 u  ?1 ]        <key>ProgramArguments</key>) C: G2 p: x7 y- I2 K% V
        <array>
$ J% Z' b& H4 z" [" O                <string>nagios</string>
% g. O/ z/ R- K* `) ~$ f                <string>start</string>8 C# P1 p% t. s% g( c( @. }% e# u- S  x
        </array>* T3 W: L& n' c& Q
        <key>KeepAlive</key>
  f* D" p2 e$ e" k        <dict>
) h' I* k5 o: \4 g$ N6 `                <key>SuccessfulExit</key>5 y6 j+ Q$ J9 g) r
                <false/>+ z. R7 h4 D; _- S9 s1 E# y
                <key>NetworkState</key>
2 z3 G4 J8 r- n6 _2 ~                <true/>% w* W5 ~3 j! X% h) L; w8 t7 E* r
        </dict>: z+ a! ?# i  v2 f0 u
        <key>RunAtLoad</key>8 J. z0 i9 \9 N7 [
        <true/>
7 h6 c2 s1 v( T; c. d        <key>ProcessType</key>
  J7 L: |" p8 d. N5 e        <string>Background</string>
8 n# o) N7 E4 @$ {</dict>
' `% u& S" O- y$ _1 O</plist>. J1 Z8 N  h% n
Press escape on the keyboard to exit insert mode.
Type :wq on the and press Enter.
The file has been saved and Nagios will automatically start on the next boot.

, u2 `* I6 @+ X; X% H, Y! P
Information on starting and stopping services will be explained further on.

) a' y% L' H! P1 v2 B  G( S% p$ t; ^Install Command Mode
This installs and configures the external command file.
sudo make install-commandmode; O' F2 u! U1 F7 t7 z7 S% Z# K/ I
Install Configuration Files
This installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start.
sudo make install-config& v1 I! {8 L8 y5 W& t
Install Apache Config Files
This installs the Apache web server configuration files.
sudo make install-webconf
9 g" i$ a- e& \8 c; c' M
As well as installing the Apache web server configuration files, there are additional changes required to the Apache config file httpd.conf to enable modules.
Commands that do all of these changes are below, but first is a list of the changes being made.
Change this:
<IfModule dir_module>% g. N; ~" _% K- {# y# O& W
    DirectoryIndex index.html
. U7 u6 P" f0 A/ {# _9 D& C7 ]</IfModule>
To this:
<IfModule dir_module>; _; D- l- v/ W; @% [) L3 X
    DirectoryIndex index.php index.html index.htm AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps
( Y1 M( S4 U" T! W& O</IfModule>
5 N' {5 L/ {6 Q- L
Add these lines to the end of the file:
Include conf/extra/nagios.conf& a$ E" {  d; ~3 Z' c' i
Include conf/extra/mod_php70.conf* j5 B2 B+ O6 C7 I. y1 d/ B; w% F
Execute the following commands to make the changes described above:
sudo cp /opt/local/etc/php70/php.ini-production /opt/local/etc/php70/php.ini
# Q9 \8 A: O) v! a) g2 dcd /opt/local/apache2/modules/4 R' {; K/ \' x4 ?& U! W- L
sudo /opt/local/apache2/bin/apxs -a -e -n php7 mod_php70.so1 @9 e7 h9 P: I
printf '\nInclude conf/extra/nagios.conf\n' | sudo tee -a /opt/local/apache2/conf/httpd.conf
+ Q% p- H& q6 Sprintf '\nInclude conf/extra/mod_php70.conf\n' | sudo tee -a /opt/local/apache2/conf/httpd.conf( Y5 Q/ G: G0 f3 [% V6 ~
sudo sed -i '' 's/DirectoryIndex index.html/DirectoryIndex index.php index.html index.htm AddType application\/x-httpd-php .phpAddType application\/x-httpd-php-source .phps/g' /opt/local/apache2/conf/httpd.conf% e  n8 n0 L1 N4 b! F0 ?
Configure Firewall
The firewall in OS X is turned off by default. Please refer to the Apple documentation for information on how to enable or configure TCP port 80 inbound.

) i& {0 q, ~; x, R. M; l2 ZCreate nagiosadmin User Account
You'll need to create an Apache user account to be able to log into Nagios.
The following command will create a user account called nagiosadmin and you will be prompted to provide a password for the account.
sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin0 N+ e% S! G) T
When adding additional users in the future, you need to remove -c from the above command otherwise it will replace the existing nagiosadmin user (and any other users you may have added).

' z6 ]* o7 I2 C  ^
$ t) v0 {3 R7 a4 ~8 {Start Apache Web Serversudo /opt/local/bin/port load apache2- V) x. |; O" m( b: K- Q3 k) Q; k
Start Service / Daemon
This command starts Nagios Core.
sudo /etc/rc.d/init.d/nagios start
( Y7 E" _  `0 \7 QTest Nagios
Nagios is now running, to confirm this you need to log into the Nagios Web Interface.
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
You will be prompted for a username and password. The username is nagiosadmin (you created it in a previous step) and the password is what you provided earlier.
Once you have logged in you are presented with the Nagios interface. Congratulations you have installed Nagios Core.
BUT WAIT ...
Currently you have only installed the Nagios Core engine. You'll notice some errors under the hosts and services along the lines of:
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_load, ...) failed. errno is 2: No such file or directory
These errors will be resolved once you install the Nagios Plugins, which is covered in the next step.

5 N2 d8 Y/ w+ r$ x8 AInstalling The Nagios Plugins
Nagios Core needs plugins to operate properly. These steps are going to install the Nagios Plugins that are available via MacPorts. Future versions of the Nagios Plugins package will be updated to support OS X, until then the version available via MacPorts will be fine.
These get installed to /opt/local/libexec/nagios/ so the /usr/local/nagios/etc/resource.cfg file also needs to be updated and Nagios restarted (covered in the steps below).
sudo /opt/local/bin/port install nagios-plugins
$ Q; F, O; _& H7 B& V0 l3 ^# rsudo sed -i '' 's/\/usr\/local\/nagios\/libexec/\/opt\/local\/libexec\/nagios/g' /usr/local/nagios/etc/resource.cfg
3 D# s- q2 m3 t5 N5 [8 Tsudo /etc/rc.d/init.d/nagios stop
3 r* D2 i: q& Z& Q! }( esudo /etc/rc.d/init.d/nagios start  V0 C9 e: A4 _! O& M! ?+ @1 N: k
Test Plugins
Point your web browser to the ip address or FQDN of your Nagios Core server, for example:
http://10.25.5.143/nagios
http://core-013.domain.local/nagios
Go to a host or service object and "Re-schedule the next check" under the Commands menu. The error you previously saw should now disappear and the correct output will be shown on the screen.

- U. @4 F& n: o- f3 lService / Daemon Commands
These commands are for starting / stopping / restarting / status Nagios.
sudo /etc/rc.d/init.d/nagios start4 E0 C. h' D' a! X
sudo /etc/rc.d/init.d/nagios stop) G5 e+ V! G  Z3 r" p% ?
sudo /etc/rc.d/init.d/nagios restart
  J3 _) B) E! f! N5 M; m! k7 esudo /etc/rc.d/init.d/nagios status; D+ m" @8 K  N; {  {% T% D
. V( l- m, N: M

  X5 n8 u$ H' t  c4 q8 G& l# w3 O/ C) b/ N: n
Final Thoughts
For any support related questions please visit the Nagios Support Forums at:
[url=]http://support.nagios.com/forum/[/url]
1 h# `- Y, ]' a* K
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )点击这里给我发消息

GMT+8, 2026-4-9 00:04 , Processed in 0.097054 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

快速回复 返回顶部 返回列表