找回密码
 注册
查看: 5279|回复: 0

install nagios环境

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2018-6-25 21:38:58 | 显示全部楼层 |阅读模式
Installing Nagios Core From Source- f0 J+ z# O* l, D6 r
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! X& ^: B. ]# a# q2 W- R7 d  [
  • Install Nagios Plugins, H1 G0 |1 X" X0 |/ T" H

    - o5 s" W9 y# K9 O
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.

: O7 P( q* ^; |- O7 q& \) {- t
Please select your OS:
& i5 _+ s6 o4 [& N* k

; ?! a2 o2 C0 N  R+ W* Q4 @
1 B- }" v$ e- n2 B0 k% n
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/config4 g% D8 W! w: P/ B$ \" S
setenforce 0* I' J  C: B8 L) y9 F
Prerequisites
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, Q8 c% ^; Q; i, I. w6 |
wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz
2 a) U, H( S% m5 H: _tar xzf nagioscore.tar.gz+ ^3 X$ _6 V/ m: X
Compilecd /tmp/nagioscore-nagios-4.4.0/
2 Z) U% V- @  a4 H9 g./configure
( T0 o$ k; j5 ?: p  Smake all
+ \3 f; N" {! q+ ?, P, gCreate User And Group
This creates the nagios user and group. The apache user is also added to the nagios group.
make install-groups-users# n1 q" n$ ?$ N; s
usermod -a -G nagios apache7 P! L9 y# ^2 E+ H4 _. [
Install Binaries
This step installs the binary files, CGIs, and HTML files.
make install
/ F% t8 o* n; h# u" W# U0 YInstall 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
( y' X, V. U, q& ~, h* S( Uchkconfig --level 2345 httpd on2 T9 v  ]0 z) Z2 Y. I
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x =====
make install-init
* u& A+ D3 W  `" d4 _. v$ n7 msystemctl enable httpd.service0 f3 t; V+ W  [/ t
Information on starting and stopping services will be explained further on.

# F" E. H+ L4 z0 x# X5 kInstall Command Mode
This installs and configures the external command file.
make install-commandmode; C  G. l: ?' w+ L5 ]2 Y6 j' h8 y+ T
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( s5 ^/ ?$ X- c2 N3 G
Install Apache Config Files
This installs the Apache web server configuration files. Also configure Apache settings if required.
make install-webconf
8 V8 l2 v$ @1 _$ B! n3 l, w4 kConfigure 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 ACCEPT% I% z, [9 i' d. G' a" K3 }, I1 U
service iptables save0 N, y) W! O+ u4 ?
ip6tables -I INPUT -p tcp --destination-port 80 -j ACCEPT, ?% L4 j* q$ r6 T
service ip6tables save
6 ~- _2 ?* ^( ]. @
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x =====
firewall-cmd --zone=public --add-port=80/tcp. W0 g1 g+ |" f# I0 J/ }
firewall-cmd --zone=public --add-port=80/tcp --permanent2 y  r" Z! h) T1 [+ ?# ^
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 nagiosadmin2 @  u/ }" H2 K- K# t6 G0 g
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 P5 n4 |1 [& `# s2 L
# f3 a: [9 s5 B
Start Apache Web Server
===== CentOS 5.x / 6.x | RHEL 5.x / 6.x | Oracle Linux 5.x / 6.x =====
service httpd start: G2 P/ n1 c. H' g8 G/ Q
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x =====
systemctl start httpd.service* x+ O' j& \! p. e# _' d
Start 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 start9 {, p2 s2 ~) Q8 T. Y
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x =====
systemctl start nagios.service
6 o6 W* x# A) K9 J& |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 {; K5 ^8 F/ Y% o3 ~) XInstalling 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.

& \! J+ J; g8 V5 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:

% e. B. `# k9 _8 G3 K: oPrerequisites
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
. @0 k. h- r. W2 y, a! t: zyum install -y perl-Net-SNMP: y! D9 G" g, j' {
cd /tmp
" h3 `- Q( D! H2 ]! }; |7 a" jwget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
4 R7 d$ z* y+ E1 Etar xzf autoconf-2.60.tar.gz 6 I- t6 ^! {0 A% T0 G
cd /tmp/autoconf-2.60
5 j# x3 H& F* x./configure
* @% _. c3 G9 U/ emake
& n5 X. x& d9 b* X7 D8 zmake install! e% }. k& _0 A* `& R) [
===== 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-release
7 p# m2 O" L5 cyum install -y perl-Net-SNMP
3 I  T, t- c# E7 ~% ~6 b2 i
===== RHEL 5.x | Oracle Linux 5.x =====
cd /tmp/ x+ h7 S. r2 Z
wget http://archives.fedoraproject.or ... latest-5.noarch.rpm
9 i, j9 K  [9 A3 \: erpm -ihv epel-release-latest-5.noarch.rpm  p$ f1 [- U$ P! ^0 q
yum install -y gcc glibc glibc-common make gettext automake wget openssl-devel net-snmp net-snmp-utils* s, f$ S' D. x* V
yum install -y perl-Net-SNMP
: X9 w7 Z6 V( [% awget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz# D5 m5 e& k' J0 {9 c/ d' d5 M4 Z
tar xzf autoconf-2.60.tar.gz
+ i; e4 s: P% K! ?3 gcd /tmp/autoconf-2.60
( W7 l2 |8 E' c, B./configure 3 H( ^' ?& A) |/ h
make
1 }4 m8 B  q9 V" @1 H5 @! h2 g5 nmake install
9 H( H& s2 M4 S1 M, @
===== RHEL 6.x | Oracle Linux 6.x =====
cd /tmp
! N( D6 z1 g* Fwget https://dl.fedoraproject.org/pub ... latest-6.noarch.rpm) [  K( x. v1 U) b) F
rpm -ihv epel-release-latest-6.noarch.rpm3 \6 @/ J6 Y( A
yum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils
# ]" I# g) j, U% k2 ]& c7 fyum install -y perl-Net-SNMP
* h% U' t0 l3 z
===== RHEL 7.x =====
cd /tmp4 f# H$ ?9 _1 C: n% G
wget https://dl.fedoraproject.org/pub ... latest-7.noarch.rpm) T/ x- T9 P1 v2 _7 b3 z5 l
rpm -ihv epel-release-latest-7.noarch.rpm
$ n, h) [0 R. A- q% Hsubscription-manager repos --enable=rhel-7-server-optional-rpms
/ p/ O* N% I+ g/ q8 Z: Yyum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils
7 e. h5 u0 B$ J7 E" O+ l3 ]yum install -y perl-Net-SNMP
) m* C: K8 t7 [# n) G6 m7 ?3 j: e
===== Oracle Linux 7.x =====
yum install -y yum-utils  b! V! |, g6 w
yum-config-manager --enable ol7_optional_latest+ R% O8 _$ Z" G  c2 p! \. B+ u
cd /tmp. G* k0 E" ^9 t' L& {) r
wget https://dl.fedoraproject.org/pub ... latest-7.noarch.rpm
0 O0 g' R6 p9 ^, k+ O5 i6 Vrpm -ihv epel-release-latest-7.noarch.rpm4 Y  h6 A; X$ _
yum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils
& P/ B  c( }( o) |yum install -y perl-Net-SNMP% j* V  d. d; n) D# _9 L
Downloading The Sourcecd /tmp
5 s' x2 ]7 o& r7 [' Twget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz5 K# B  l6 x0 K6 U! K7 z
tar zxf nagios-plugins.tar.gz1 b) g  \  z: d* ~+ m0 j# i
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/! u% [3 z* O; L9 Q- X; F7 W
./tools/setup4 ~$ c. T4 k0 C4 e  J
./configure1 B6 }- f  N1 n# [; c
make' Z6 u& r4 n8 \  g
make install
8 ?: Z; C) S. M/ H5 E  T& W. F7 ATest 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.

7 i$ c  a1 V5 D: k7 H  F& rService / 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: B; g" o8 c% K9 Y# L& L
service nagios stop
2 ]$ b# e& j) [6 P4 b. T% s. H5 Pservice nagios restart' Y$ B# X, S' J6 q4 b, r& S! E
service nagios status
# J4 }- n, d0 H& i4 U
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x =====
systemctl start nagios.service
; x9 g7 I" t9 H& y$ F8 ~systemctl stop nagios.service
# Q- `1 h4 U2 a% h& Csystemctl restart nagios.service( {2 G  e9 t( F7 l1 E
systemctl status nagios.service
: L6 H6 _  W0 h  `/ f4 P3 P8 x6 c! n) Z
7 c! H* V8 L$ u1 V: X0 y
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*
( V; V  ^2 t# W0 t+ C- C/ sPrerequisites
Perform these steps to install the pre-requisite packages.
===== Ubuntu 14.x / 15.x =====
sudo apt-get update" p) e2 Q# U3 T
sudo apt-get install -y autoconf gcc libc6 make wget unzip apache2 apache2-utils php5 libgd2-xpm-dev5 i. o4 M: I& \# V3 b& _
===== Ubuntu 16.x / 17.x =====
sudo apt-get update
1 B: C0 h8 i- psudo apt-get install -y autoconf gcc libc6 make wget unzip apache2 php libapache2-mod-php7.0 libgd2-xpm-dev
, t4 J2 K: w+ G% X
===== Ubuntu 18.x =====
sudo apt-get update- x, ~* G) t4 J$ s
sudo apt-get install -y autoconf gcc libc6 make wget unzip apache2 php libapache2-mod-php7.2 libgd-dev3 Y% x. u6 n  H
Downloading the Sourcecd /tmp1 z$ B' }' l0 V, Y2 o
wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz, E. z% p' u- m5 z9 |
tar xzf nagioscore.tar.gz( y/ X8 o& J% ^5 [. k3 |
Compilecd /tmp/nagioscore-nagios-4.4.0/; V4 r% L% E: z8 L" e
sudo ./configure --with-httpd-conf=/etc/apache2/sites-enabled
$ x) g) l& T7 k0 J# g( A1 Fsudo make all% x) b2 M( z' Q
Create 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
/ Y& \; Y$ g  w- L8 q9 Asudo usermod -a -G nagios www-data
% {/ v8 @. |3 ?' R8 G* e6 ]Install Binaries
This step installs the binary files, CGIs, and HTML files.
sudo make install" L6 T% n& g; {" |$ C
Install Service / Daemon
This installs the service or daemon files and also configures them to start on boot.
sudo make install-init
$ Q' o2 d3 \$ w0 ?% n
Information on starting and stopping services will be explained further on.
3 @" D4 h# D+ _! P; |1 A2 x) {
Install Command Mode
This installs and configures the external command file.
sudo make install-commandmode
; E0 A) M* j5 E. L- n" fInstall 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 o: b6 f* [! z/ F
Install Apache Config Files
This installs the Apache web server configuration files and configures Apache settings.
sudo make install-webconf
2 d" n) l! F9 Q2 i! W' {sudo a2enmod rewrite* N1 v4 ^/ t+ [) v, s( O( Z' r
sudo a2enmod cgi
$ E* U0 J7 C. u; pConfigure 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: @1 w- r+ l& e; ?6 Z9 P% M
sudo ufw reload8 ~1 {/ i( r' J
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 htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin* f' j3 r' Z, y. }% {8 E/ u7 U+ I# 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).

) R/ J2 t, k* t0 D2 l8 t2 P1 X7 i5 l0 F8 }* I6 f
Start Apache Web Server
===== Ubuntu 14.x =====
Need to restart it because it is already running.
sudo service apache2 restart
$ F( {  L5 k8 Q) B% a  ~
===== Ubuntu 15.x / 16.x / 17.x /18.x =====
Need to restart it because it is already running.
sudo systemctl restart apache2.service
( O6 v5 o/ V1 c! rStart Service / Daemon
This command starts Nagios Core.
===== Ubuntu 14.x =====
sudo start nagios5 d" y3 X% F% M3 H/ C$ s& T# s8 n
===== Ubuntu 15.x / 16.x / 17.x / 18.x =====
sudo systemctl start nagios.service
( p( p' w, f1 Z' I1 }1 \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.
% c- c; R7 O; M- U8 w) O5 G
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.

2 |2 T. g/ X9 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:

0 k3 [3 K# C2 w; u3 Q8 F" \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* Q& j; e5 Y- G- _  v; R# R
Downloading The Sourcecd /tmp8 P4 a8 N  B/ ], z1 U
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz- c3 P/ f1 A+ q: [& p3 X* Q  ]
tar zxf nagios-plugins.tar.gz' [$ d! M( @4 v( R9 k6 f
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/
4 P7 w9 `( T/ A* S7 O: T( m/ C9 k/ msudo ./tools/setup
5 }8 t% x9 h" t+ ~: N# L# psudo ./configure
# @0 J: q' P" y  Q8 Z7 o8 P, i% J/ gsudo make
$ @1 r$ X% ~8 u* t  G( ]2 isudo make install5 V. ]1 S+ ^6 X0 z5 W$ q0 o9 G
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.

! ?+ A* A8 g, u) B9 t. m- v, X. @Service / Daemon Commands
Different Linux distributions have different methods of starting / stopping / restarting / status Nagios.
===== Ubuntu 14.x =====
sudo start nagios
; _' \  R* X( C3 o3 t* N" t* Gsudo stop nagios
4 Q; X; P4 b: B: N9 isudo restart nagios
; C- ]. u$ A1 x. |  o( m* I/ Lsudo status nagios( y8 t- F. R2 H0 j7 u8 G% o" t; V
===== Ubuntu 15.x / 16.x / 17.x / 18.x =====
sudo systemctl start nagios.service
2 t5 Z4 ]5 @1 Y2 U9 Esudo systemctl stop nagios.service
; l/ o& ~0 C. s1 X3 t4 Ksudo systemctl restart nagios.service
+ I# i/ l) Z8 h3 @sudo systemctl status nagios.service
3 I: d/ f" D, Q8 X' J9 x+ e7 v3 L+ d9 S2 o  C* V6 D

  [) j& y+ u$ N. p! ]1 U0 H
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.

# ~& m- m: v, \Prerequisites
Perform these steps to install the pre-requisite packages.
===== SUSE SLES 11.3 =====
cd /tmp
, D) x8 ^  b: v" M3 `2 F' Z9 r# swget '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'
9 E. T5 `# S. F  twget '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'
) }1 c" J9 I( j6 N0 C( hsudo rpm -ivh sle-sdk-release-*: a: z  n9 [4 z, i7 a$ v7 S
sudo suse_register% l( `$ v1 c. f/ t7 k
sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php53 apache2-mod_php53 gd gd-devel1 ?  F) e* c# u4 h, x, b  y# |
===== SUSE SLES 11.4 =====
cd /tmp
9 p' _7 }  l2 A+ J; p' \. swget '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'
4 {( H7 ]( ]* F* Ewget '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'
% P2 Z6 G3 a5 f% ^* Psudo rpm -ivh sle-sdk-release-*
* Q7 W4 n0 p! Y4 q6 c+ s* vsudo suse_register
8 @  S6 T' c3 f1 T4 Q( asudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php53 apache2-mod_php53 gd gd-devel7 o+ Y, Y( J1 _, }
===== SUSE SLES 12 =====
sudo SUSEConnect -p sle-sdk/12/x86_64; X4 W1 b7 ?1 t5 I6 H
sudo SUSEConnect -p sle-module-web-scripting/12/x86_64
6 t2 \9 ?% p5 ssudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php5 apache2-mod_php5 gd gd-devel
. z2 P% @0 n: K7 \
===== SUSE SLES 12.1 =====
sudo SUSEConnect -p sle-sdk/12.1/x86_64
: [4 |, A- l- F  q/ A. ~sudo SUSEConnect -p sle-module-web-scripting/12/x86_64) z1 B- ?( C9 a# ?3 j  ]
sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php5 apache2-mod_php5 gd gd-devel
2 l; z3 a* [7 B0 K
===== SUSE SLES 12.2 =====
sudo SUSEConnect -p sle-sdk/12.2/x86_64
$ J5 s9 X% R, @9 _, Csudo SUSEConnect -p sle-module-web-scripting/12/x86_641 I; W4 D% y: v& N& t+ F
sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php5 apache2-mod_php5 gd gd-devel
6 f& @6 |2 k$ h: a# t6 M0 O
===== SUSE SLES 12.3 =====
sudo SUSEConnect -p sle-sdk/12.3/x86_64
! d7 t+ Z; M4 G2 Wsudo SUSEConnect -p sle-module-web-scripting/12/x86_64+ n) l* _# Q' N7 f
sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php5 apache2-mod_php5 gd gd-devel
; `. M3 T: N) x$ @
===== 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
: L! E! v* |# U/ s/ Y' b0 u
===== openSUSE Leap 15.x =====
sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php7 apache2-mod_php7 gd gd-devel9 o) p: j: m3 a+ C( Z1 P

% d4 Q8 U1 s% }. N: Y( wDownloading the Sourcecd /tmp9 ?  c, w* R9 B
wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz8 ^( ~, q# j3 g; l' g# K: V
tar xzf nagioscore.tar.gz
3 L3 }4 L) A% eCompilecd /tmp/nagioscore-nagios-4.4.0/
) \1 t1 [$ f+ o- H" H( x0 qsudo ./configure --with-httpd-conf=/etc/apache2/vhosts.d% Y6 B/ p0 h$ n; j6 [+ I
sudo make all
$ _# k$ Y  p: G! @  T! gCreate 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-users8 H: G* v( Z7 ^
sudo /usr/sbin/usermod -A nagios wwwrun
0 y9 k, A5 c( s; ]
===== SUSE SLES 12.x | openSUSE Leap 42.x / 15.x =====
sudo make install-groups-users1 o, ~  H: [' J. n' a; j
sudo /usr/sbin/usermod -a -G nagios wwwrun2 k& _/ w" g2 `% j6 h4 D
Install Binaries
This step installs the binary files, CGIs, and HTML files.
sudo make install( B# F5 D  I8 i# S  G- A) x* q
Install Service / Daemon
This installs the service or daemon files and also configures them to start on boot.
sudo make install-init4 @* L4 \- A% ^/ o
Information on starting and stopping services will be explained further on.
( _9 M  |% m* Z" S' H+ c
Install Command Mode
This installs and configures the external command file.
sudo make install-commandmode
! H$ `* ?3 s1 S0 Q8 O! `, IInstall 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+ m7 r0 B6 D, _( h
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# Y: h: @% I% s
sudo /usr/sbin/a2enmod rewrite
0 Z- W; c4 H8 p3 r7 t1 csudo /usr/sbin/a2enmod cgi
% F1 `/ y& h2 k3 J! |sudo /usr/sbin/a2enmod version+ F7 @0 {. y6 y  p; O7 u. N# m
sudo /usr/sbin/a2enmod php5
' i- S, D  ~2 |) Bsudo /sbin/chkconfig --set apache2 on% a8 q& j$ c4 d8 G" }
===== SUSE SLES 12.x | openSUSE Leap 42.x =====
sudo make install-webconf5 G+ x! K7 H, }$ M6 h
sudo /usr/sbin/a2enmod rewrite. l' y, ~: T- _1 H! a- @/ Z' k
sudo /usr/sbin/a2enmod cgi
1 C" c  F: v$ k* bsudo /usr/sbin/a2enmod version! p* p: P6 X8 Q7 m, l: \$ N
sudo /usr/sbin/a2enmod php5
; t: y( v4 q- Q! ], g5 O7 csudo systemctl enable apache2.service9 w, m) B9 t/ x4 C: _# V  c
===== openSUSE Leap 15.x =====
sudo make install-webconf
3 u. e2 p  b: N* r2 Xsudo /usr/sbin/a2enmod rewrite0 H+ N+ b. t4 M# E8 J
sudo /usr/sbin/a2enmod cgi
9 y7 R& N+ }/ lsudo /usr/sbin/a2enmod version, t8 F. _3 h% E5 U& b4 z; ]/ W
sudo /usr/sbin/a2enmod php7
. q4 U4 P4 L5 g7 Asudo systemctl enable apache2.service
8 U; n( I2 ]0 _+ M  D5 m% K  ?" YConfigure 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/SuSEfirewall2
: N: f( Y" ^( ysudo /sbin/service SuSEfirewall2_init restart. \' O! E/ }  s3 V8 C8 _7 l
sudo /sbin/service SuSEfirewall2_setup restart
- l. G, A9 V" }) L" e8 R
===== SUSE SLES 12.x =====
sudo /usr/sbin/SuSEfirewall2 open EXT TCP 805 D7 ?; \( D  [8 v
sudo systemctl restart SuSEfirewall2
  ^1 d- Y. r* w5 r
===== openSUSE Leap 42.x =====
Port 80 is enabled when Apache is installed, nothing needs to be done.
$ n5 c. x) S0 B9 D( y/ A) [
===== openSUSE Leap 15.x =====
sudo firewall-cmd --zone=public --add-port=80/tcp' l; g" e( c" U% N# p3 ]
sudo firewall-cmd --zone=public --add-port=80/tcp --permanent' W% E5 b$ t) p5 z- w- h7 {  _

. L! a, z2 y8 O8 @7 A$ g: |2 c0 ?# 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.
sudo htpasswd2 -c /usr/local/nagios/etc/htpasswd.users nagiosadmin5 @( j# |6 H  T  D, a' O& U
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).

% G& b" Q" O# Z$ R! g& O# @/ m( i# a. s8 A3 W7 V
Start Apache Web Server
===== SUSE SLES 11.x =====
sudo /sbin/service apache2 start/ x+ }) ^2 g9 [# z. `$ a0 N
===== SUSE SLES 12.x | openSUSE Leap 42.x / 15.x =====
sudo systemctl start apache2.service" B, T  W% C. j; u6 m
Start Service / Daemon
This command starts Nagios Core.
===== SUSE SLES 11.x =====
sudo /sbin/service nagios start
4 V* j$ u6 f2 `: z( D
===== SUSE SLES 12.x | openSUSE Leap 42.x / 15.x =====
sudo systemctl start nagios.service4 Z2 D0 Q9 G3 V2 I
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.
  G- z) W' X5 x. d2 ^
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.

5 p, @; ~+ W5 w+ y* p
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:
, h( v8 F( F+ Q- z
Prerequisites
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
7 a% \- H% l7 m) P5 w1 C: r
===== 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-SNMP
5 y- Z* j5 |9 j2 `Downloading The Sourcecd /tmp
3 ~: T. x/ g7 W& l. }2 bwget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz
) A5 F6 y$ }; Y7 utar zxf nagios-plugins.tar.gz
4 V/ y6 [6 \6 ]7 YCompile + Installcd /tmp/nagios-plugins-release-2.2.1/4 E/ j! p: Y2 \* k8 i/ e' q
sudo ./tools/setup) K$ g; U; {/ ]! x
sudo ./configure
- D: s# p$ s3 W7 s* Tsudo make
, y7 M, ]0 `  rsudo make install# `$ [8 v; h3 m5 T; j% D% W8 ]
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.

$ P+ h' R3 Z4 _6 K4 [) A5 gService / Daemon Commands
Different Linux distributions have different methods of starting / stopping / restarting / status Nagios.
===== SUSE SLES 11.x =====
sudo /sbin/service nagios start6 P' u6 N" B( p$ E
sudo /sbin/service nagios stop! e- Y9 `: V) z- `
sudo /sbin/service nagios restart
3 W/ g- ^4 m. Z" x3 H, \sudo /sbin/service nagios status
===== SUSE SLES 12.x | openSUSE Leap 42.x / 15.x =====
sudo systemctl start nagios.service' y% A/ _7 O, b* S2 v
sudo systemctl stop nagios.service
# _& B9 o; S' c9 Y4 J  wsudo systemctl restart nagios.service9 E3 L0 A5 y% ^. T+ V! D4 _# b# Y9 m
sudo systemctl status nagios.service: J; e- T2 {8 ^1 m
9 L0 v9 L$ A2 v4 u1 u9 g& u- P& P4 a

; }4 o" e7 X8 U
Debian | Raspbian
All steps on Debian require to run as root. To become root simply run:
Debian:
su3 h0 H+ \$ x% a4 ~' L
Raspbian:
sudo -i0 x7 E7 M; Q# s+ ]5 L2 A
All commands from this point onwards will be as root.

8 d. o& r+ T* N& QSecurity-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*) N8 z8 Y# T, V5 O7 \0 d* y
Prerequisites
Perform these steps to install the pre-requisite packages.
===== 7.x / 8.x =====
apt-get update& R4 H, T! ?7 N1 T! F
apt-get install -y autoconf gcc libc6 make wget unzip apache2 apache2-utils php5 libgd2-xpm-dev
. K' y/ _: H8 j* I* E4 c
===== 9.x =====
apt-get update& ]! @. m8 Z! K) c3 @0 n4 S6 q
apt-get install -y autoconf gcc libc6 make wget unzip apache2 apache2-utils php libgd-dev
$ x3 `& ^6 B4 D$ U) C5 nDownloading the Sourcecd /tmp) T' C6 A9 T6 y+ X/ G0 ^; F! E
wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz
4 e/ E2 v  V6 Itar xzf nagioscore.tar.gz# y5 b% `4 @0 p* W/ ^0 |* N" t
Compilecd /tmp/nagioscore-nagios-4.4.0/
' _) n5 \9 _* [. F# t3 E./configure --with-httpd-conf=/etc/apache2/sites-enabled
$ Z5 U1 q6 H; s& d1 Wmake all
6 [) K* J9 r! N2 L6 GCreate 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: T0 X4 c% T5 h' o6 S, {9 A# d* I
usermod -a -G nagios www-data0 J/ P0 u5 ?5 |5 M6 T
Install Binaries
This step installs the binary files, CGIs, and HTML files.
make install8 F& H0 q& l$ S1 w( g8 I8 X
Install Service / Daemon
This installs the service or daemon files and also configures them to start on boot.
make install-init
+ z) E4 Q4 J" V5 t4 H) ~- p
Information on starting and stopping services will be explained further on.

& ~1 j7 M! U7 Y+ p+ r: iInstall Command Mode
This installs and configures the external command file.
make install-commandmode7 C: j$ K0 j: y9 L" n  c2 |* _
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
  ?3 [4 o( |2 u8 q  NInstall Apache Config Files
This installs the Apache web server configuration files and configures the Apache settings.
make install-webconf3 `% f* @' U9 T* s) |% D% n0 H7 d
a2enmod rewrite
" Z6 l) X2 L% C  e9 {6 B' _a2enmod cgi8 l8 t0 c( _. F8 i
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
2 ~9 T5 C2 ^3 Qapt-get install -y iptables-persistent
Answer yes to saving existing rules

4 d8 F1 y" b* a0 Q+ ECreate 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& g& {' j$ G5 @% M  h1 h4 ^
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).

* m4 X" }- D0 L1 A1 j
, {7 @; h, H2 L) |Start Apache Web Server
===== 7.x =====
Need to restart it because it is already running.
service apache2 restart
7 n! K+ D+ s- ]- p4 f4 V
===== 8.x / 9.x =====
Need to restart it because it is already running.
systemctl restart apache2.service
2 J6 m5 I! K1 E+ KStart Service / Daemon
This command starts Nagios Core.
===== 7.x =====
service nagios start
: _. {6 u) Y  J: r" X4 s
===== 8.x / 9.x =====
systemctl start nagios.service( u) l+ u" b( L5 ]& q5 l
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.
9 M! f" p- }  k( _3 l0 ~
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.

) q: k5 U4 {' w$ n6 G# W9 S  v7 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 r6 o& Q& O& K! K/ A( E# nPrerequisites
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
/ g, U6 m( M9 {Downloading The Sourcecd /tmp
# Q2 H( t6 H! ?7 _- I% R1 z7 fwget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz# b- v1 k( T$ c" u, ?
tar zxf nagios-plugins.tar.gz: c8 I/ n" ^$ `" M% U7 V/ v5 t
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/
8 ?2 r( c; D* o+ ]./tools/setup6 c2 n3 X  p3 F6 u3 g8 S# b: e
./configure% H, [6 s# k7 o( S' U
make) c. o& i8 r, ]
make install, h: t7 m! r1 o- Q  L5 _* Z$ y- g
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.

& @; l+ `$ B; O. q( BService / Daemon Commands
Different Linux distributions have different methods of starting / stopping / restarting / status Nagios.
===== 7.x =====
service nagios start5 {8 R& L/ {& {& F; J) p3 v1 j
service nagios stop
9 i8 y4 M8 \9 L3 h: }service nagios restart  o" j) O5 M2 S/ G  G4 \5 V" Y
service nagios status+ K7 a& l% {! X7 ]
===== 8.x / 9.x =====
systemctl start nagios.service
6 u  k5 B, L$ P& v% Xsystemctl stop nagios.service% s5 F0 U) c# V! x
systemctl restart nagios.service! L$ B8 P( [. q5 [
systemctl status nagios.service8 T- E4 J" {7 u; {# K* j
' Z8 o, N" i* [# i/ r4 ?

/ J! M# g0 s  l" L* ]& q
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
* Y' W) p. _7 q! d1 A+ W7 i: W- Osetenforce 0& U) e% s, M" A8 |. ?
Prerequisites
Perform these steps to install the pre-requisite packages.
dnf install -y gcc glibc glibc-common perl httpd php wget gd gd-devel, M& b' `3 }. F# i" m: C- s
dnf update -y Downloading the Sourcecd /tmp. U+ c1 y+ B' a2 J/ l
wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz6 z2 q5 F1 P. g* ^, a3 @
tar xzf nagioscore.tar.gz# d  e( p# y4 M- T! h* X6 y
Compilecd /tmp/nagioscore-nagios-4.4.0/( G7 x* a$ ~$ ^- {" W: I
./configure# t# q: s5 \) X+ s; \
make all+ m2 S. v, p) w2 J9 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-users# c# ?4 n; P0 h$ z1 Z9 P% @
usermod -a -G nagios apache
$ a" q! f7 l$ c: WInstall Binaries
This step installs the binary files, CGIs, and HTML files.
make install
# o% ?" k, L5 g# T3 L8 R6 EInstall 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- ]8 K! z! r# v0 Z
systemctl enable httpd.service% \# w8 h* e) F: r. H6 q! d# W4 O
Information on starting and stopping services will be explained further on.
2 _* H# }! s$ D' _
Install Command Mode
This installs and configures the external command file.
make install-commandmode
# y$ T& ]$ t5 c1 k7 H- }: ^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, v, n2 G) x+ c+ ?2 }8 H
Install Apache Config Files
This installs the Apache web server configuration files. Also configure Apache settings if required.
make install-webconf0 @$ g7 t. @6 e" ~+ `4 d
Configure 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/tcp( ]8 q, v6 f$ m" x1 m5 y0 _
firewall-cmd --zone=FedoraServer --add-port=80/tcp --permanent: v9 ~  Z6 v# R+ `6 u2 H, c) ?. j
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
" x/ v4 U9 \* E! L" W1 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).

3 u+ b+ I( y4 }( i4 |# Y" t6 ~% c% T( L8 \
Start Apache Web Serversystemctl start httpd.service
% S& g7 Q/ z# L( FStart Service / Daemon
This command starts Nagios Core.
systemctl start nagios.service9 @+ w# u: _  |& r0 I" o2 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.

) R6 C5 |4 T% s; eInstalling 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.
4 M. r1 Y5 F1 E+ L8 d; 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:
  V. P6 F) H! n8 T" C" r) r7 l
Prerequisites
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 autoconf1 s: D" ]2 p/ e+ l/ c: s
Downloading The Sourcecd /tmp' i2 s5 L- {" G& n
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz% I* g) d8 O. g& m0 j4 s( w
tar zxf nagios-plugins.tar.gz! r4 r% Z, g7 E! e; w% m
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/
7 c" e# ~; q: {/ B, {1 \" G./tools/setup
$ w; @4 W& a1 o! l4 a./configure
* s3 A" x; y, N; Omake1 j; \/ `; c! R
make install
( B6 r7 E# }6 HTest 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.

- O3 l' q/ Q  |( G  D2 F% vService / Daemon Commands
These commands are for starting / stopping / restarting / status Nagios.
systemctl start nagios.service* W' Y5 b! A/ e: `  l) m' i
systemctl stop nagios.service
( L! _  u8 Z8 ?, S3 Tsystemctl restart nagios.service1 o4 ?1 G2 v# m: }2 s: C
systemctl status nagios.service
% H( V" |) t! s& e; `$ T2 X5 ^. A0 L  a1 R
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.
& N1 z) q9 `- t/ _6 O
Prerequisites
Perform these steps to install the pre-requisite packages.
pacman --noconfirm -Syyu
$ p& b; h) h) X6 c) Vpacman --noconfirm -S gcc glibc make wget unzip apache php gd traceroute php-apache Downloading the Sourcecd /tmp
( X5 k" x  d$ Y# ~7 O; V$ |wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz
2 ^' P, G2 P$ }8 Etar xzf nagioscore.tar.gz2 W* \6 C# ~4 p, C$ h
Compilecd /tmp/nagioscore-nagios-4.4.0// l4 }/ g; k6 s" h( M- O1 v
./configure --with-httpd-conf=/etc/httpd/conf/extra5 ]* o9 P2 m8 S6 ]8 X/ I! m
make all
7 X" ~) m- t% D3 X8 Q+ {1 ?4 d( v' OCreate User And Group
This creates the nagios user and group. The http user is also added to the nagios group.
make install-groups-users
  X, G. u3 [, i1 X! Y5 iusermod -a -G nagios http2 F0 ^& Q' {9 Z5 ?" E' ^4 Z
Install Binaries
This step installs the binary files, CGIs, and HTML files.
make install
1 J6 r) |3 s8 K$ lInstall 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
" ^9 s/ |7 m$ ?/ R. \7 h& X0 F, msystemctl enable httpd.service2 }+ ]4 p& M- B3 v
Install Command Mode
This installs and configures the external command file.
make install-commandmode
$ A0 V  o0 h+ B! o, o5 ]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
8 Q7 X; A8 ~9 VInstall Apache Config Files
This installs the Apache web server configuration files.
make install-webconf% E7 v8 j" y% {; Y
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.so: `5 p5 H7 w. U+ \* @: [# C
Change this:
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
To this:
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so  r: W7 k4 R9 F' F% n( `; K6 n
Change this:
<IfModule !mpm_prefork_module>
/ |0 P: c9 c6 J. ~2 y6 Z        #LoadModule cgid_module libexec/apache24/mod_cgid.so) X) C: l6 \* x* B8 ?& r
</IfModule>3 Z* _! Z# y5 q! T) k* g
<IfModule mpm_prefork_module>
% z% T0 d0 X. S9 l, x        #LoadModule cgi_module libexec/apache24/mod_cgi.so8 P5 ^* o& d6 f! h* B
</IfModule>
To this:
<IfModule !mpm_prefork_module>* I5 S0 P) E, J# g- U: e
        LoadModule cgid_module libexec/apache24/mod_cgid.so# S6 X# b' V! B! [7 [0 G
</IfModule>
. c* W3 |3 ]4 z4 i" P7 T<IfModule mpm_prefork_module>" c4 z: A  |0 y3 w
        LoadModule cgi_module libexec/apache24/mod_cgi.so
- g; M: r( [2 w</IfModule>! _2 A) t% H$ D$ J, Y4 H) J: l
Change this:
<IfModule dir_module>' }% d# {& ^  H" b1 W
    DirectoryIndex index.html$ x; G4 t3 @8 K6 G0 E# i) \
</IfModule>
To this:
<IfModule dir_module>- e/ u6 ~" t  D  s. l
    DirectoryIndex index.php index.html index.htm AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps
" O( E- s/ R& M" {</IfModule>
# S8 |! J, I1 a
Add these lines to the end of the file:
LoadModule php7_module modules/libphp7.so9 ?! Z' }( P1 b$ c: a& h* I4 C0 X
Include "conf/extra/nagios.conf"
/ b; {' a. s$ j0 IInclude "conf/extra/php7_module.conf"7 D5 @" y! f5 J! k3 `5 t
<FilesMatch ".php$">2 P9 |, |0 A# H1 @( I
    SetHandler application/x-httpd-php
- `2 r! h7 G& M$ u4 h, \</FilesMatch>- S2 H4 @0 r/ c8 T9 }. U. W+ T+ E6 U
<FilesMatch ".phps$">6 h2 F; Q1 ?( i+ c
    SetHandler application/x-httpd-php-source
% m4 D6 y9 q* ?</FilesMatch>
7 M9 X* A: N6 S! v3 J
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.conf4 y, @$ e! M4 x/ x
sed -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
" g( H' c, n# W/ a5 e6 jsed -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.conf
( s  m% F8 Y7 J* w( K" p/ Ised -i 's/#LoadModule cgid_module/LoadModule cgid_module/g' /etc/httpd/conf/httpd.conf- I! o- D& a8 _
sed -i 's/#LoadModule cgi_module/LoadModule cgi_module/g' /etc/httpd/conf/httpd.conf3 ~) R, @8 d$ v
echo 'LoadModule php7_module modules/libphp7.so' >> /etc/httpd/conf/httpd.conf) c' K5 Y% X4 s- b  T
echo 'Include "conf/extra/nagios.conf"' >> /etc/httpd/conf/httpd.conf
0 z7 Z  x, T8 a3 n6 F" }echo 'Include "conf/extra/php7_module.conf"' >> /etc/httpd/conf/httpd.conf2 k* b% |8 A" E1 Z
printf '\n<FilesMatch ".php$">\n' >> /etc/httpd/conf/httpd.conf
6 `; O7 }# {+ t7 Z) V: @) Wprintf '\tSetHandler application/x-httpd-php\n' >> /etc/httpd/conf/httpd.conf) y, J4 h0 d+ b7 w3 G
printf '</FilesMatch>\n' >> /etc/httpd/conf/httpd.conf2 d! Q0 R" k2 G( K4 l( e  E
printf '<FilesMatch ".phps$">\n' >> /etc/httpd/conf/httpd.conf
0 i9 t4 W1 b/ O( Z  H9 R' d6 ]' c3 pprintf '\tSetHandler application/x-httpd-php-source\n' >> /etc/httpd/conf/httpd.conf. v* v! _" C2 }) }: f! m! W
printf '</FilesMatch>\n' >> /etc/httpd/conf/httpd.conf! i6 k' ^' N! r; H9 \( ?
Configure 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  ~, w4 e8 y, r
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).

* ]( Y4 A3 }( h' q: v6 P1 t! v" V. E  m3 {6 a! {
Start Apache Web Serversystemctl start httpd.service
! ?/ ^% v& h, z. JStart Service / Daemon
This command starts Nagios Core.
systemctl start nagios.service
" i: L6 T! }9 \1 R  ^) UTest 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.
- L- n- Y2 Z" N6 {$ }1 o
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.

3 u! k9 S3 r* N3 v0 M3 [( g
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:

( G( _9 D8 Y2 c) U7 N2 aPrerequisites
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- i- i# V' `5 g! r: v
Downloading The Sourcecd /tmp0 b( {1 `- @; n, h) K
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz
0 ?4 w- r9 E1 \( x9 Utar zxf nagios-plugins.tar.gz+ M( s& C$ b% n! q/ p; r
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/
  t3 S2 F- C4 z./tools/setup+ m/ F# f8 i! j  }) Q
./configure
5 g) H( y9 [% G. O+ T5 Smake  X; P/ a: b6 w
make install1 C5 a! f/ ?  L* Z! P+ T
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.

  |# Z) q1 ]0 s% N' n" [Service / Daemon Commands
Different Linux distributions have different methods of starting / stopping / restarting / status Nagios.
systemctl start nagios.service/ ?/ ?! D0 V' Y: J9 u2 Q
systemctl stop nagios.service
+ ^* U7 g+ p' t" n( Y: ?! \8 d2 @systemctl status nagios.service
) Y; m  ^3 |, R& e7 \  i1 H5 c) _# n( {  i( a; [

8 S0 T* r6 D$ `9 [* L
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.
1 U! P, V5 j/ l3 {  L4 M
Prerequisites
Perform these steps to install the pre-requisite packages.
emerge --sync0 a5 k* u1 l) P
mkdir -p /etc/portage/package.use
6 B, L" T7 o7 F* `! _, u2 x/ m, jecho "www-servers/apache dir cgi cgid event prefork apache2_modules_version" >> /etc/portage/package.use/apache; d4 C+ _0 B! |" Y
echo "dev-lang/php apache2" >> /etc/portage/package.use/php
% H1 ^6 H' x8 |) ~8 b3 `" pecho "app-eselect/eselect-php apache2" >> /etc/portage/package.use/eselect-php$ E, w) m; T8 s( d( v6 b
echo "media-libs/gd gd png jpeg" >> /etc/portage/package.use/gd0 L3 F9 {( V8 n6 _
emerge --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 /tmp2 [: x* o3 W! j& V: G6 `& L9 Y
wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz
4 c6 `9 j# y- d/ o. Ttar xzf nagioscore.tar.gz: g; t! c; U& D* Y& L' g
Compilecd /tmp/nagioscore-nagios-4.4.0/; {, [# J) V* I6 W
./configure --with-httpd-conf=/etc/apache2/vhosts.d --sysconfdir=/usr/local/nagios/etc
$ t' ]9 A8 B/ Y0 Umake all0 `3 s) W& \- W2 n+ ~" o5 b, [* G
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
) v$ t% L$ D2 h$ ousermod -a -G nagios apache2 p! n' F' l4 ~+ F! j& k
Install Binaries
This step installs the binary files, CGIs, and HTML files.
make install
; c) ^2 O+ d" X9 U- j0 p- g, PInstall 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. p7 R! N( y1 p( w+ b2 e3 i0 P
rc-update add apache2 default
7 u: s- a/ V& ^6 `& v( |
===== systemd =====
make install-init( E: e# ]8 X& v/ g7 G  f# }
systemctl enable apache2.service
) ?5 B7 z2 S; a( w# N. Z" `! DInstall Command Mode
This installs and configures the external command file.
make install-commandmode/ h# m9 H9 y* W
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
+ t7 ~) J& U4 ^6 C0 i% X3 wInstall Apache Config Files
This installs the Apache web server configuration files.
make install-webconf
% L" |: ~4 T/ t( c" v
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"
, A; z) \( p. A# W
The /run/apache_ssl_mutex directory also needs to be created.
" Q) w: ]" N2 C, t- K
Execute the following commands to make the change described above:
sed -i '/^APACHE2_OPTS=/s/\([^"]*\)"$/\1 '"-D PHP"'"/' /etc/conf.d/apache22 \- z" D# y3 V! y# F4 u
mkdir -p /run/apache_ssl_mutex6 D: y" g  P* O: A' ?- r) n% f& A, s
Configure 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 nagiosadmin6 L% v& \' Z9 r# O( Y, J
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).

- B8 @- _, @, A6 L7 H% F9 @6 C, A" M+ i- ~$ H9 S( l; ]
Retart Apache Web Server
===== openrc =====
rc-service apache2 restart. @* K, _( W, n; C; Z2 r, F
===== systemd =====
systemctl restart apache2.service: }* E% [$ c/ O$ T) ]1 Y
Start Service / Daemon
This command starts Nagios Core.
===== openrc =====
rc-service nagios start
  z; j. [$ M/ [/ q& X
===== systemd =====
systemctl start nagios.service3 I% J. `  G$ b6 _* A
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.
5 F3 f5 w) ?' j4 g7 C1 D2 f
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.
+ |: u0 G8 u0 x; T
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 f9 F  h! ?/ m" f
Prerequisites
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-SNMP9 {! \/ H0 v; L
Downloading The Sourcecd /tmp
. t: g2 e6 z; G9 |" G9 v7 Wwget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz/ p' Y7 D0 ^, ~, p: A5 K
tar zxf nagios-plugins.tar.gz( R1 X7 p' E2 k) T$ x( @1 T
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/
3 \4 G2 x  L. `( B2 b2 N./tools/setup
& m8 j1 B8 }; I./configure
& t+ {" s5 E. U6 Smake, ]4 E, K3 H! Q
make install
/ ]- b8 b  x! [" q0 u" G3 H# n- Rchmod u+s /bin/ping
2 r8 ^& {+ `( g, |% Uchmod u+s /bin/ping6
6 Z' a3 _7 ]9 z% e) cTest 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.

5 A& T" z8 _* E+ q) mService / Daemon Commands
The different init systems have different methods of starting / stopping / restarting / status Nagios.
===== openrc =====
rc-service nagios start
6 z' w1 Z* T$ v, K" V! d8 Wrc-service nagios stop5 i( z( V3 d$ g
rc-service nagios status9 v3 c, i" z# I
rc-service nagios restart
0 S! O5 Q7 e! _. F0 o
===== systemd =====
systemctl start nagios.service 4 p4 T1 Y' H+ U0 r: W+ j% Z+ [% z2 A
systemctl stop nagios.service: K# L3 `0 c& p. `! S  Z
systemctl status nagios.service6 y) C. l( [/ u6 I. q
systemctl restart nagios.service% ]4 I1 ]7 p- S- x

7 R2 Z6 |  a/ q
5 Y& d( c" I% l+ Y
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.
0 v: s: P* k1 h, Q
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
1 j- C* |8 ]0 ^wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz
9 f$ K8 J' Z3 {2 f7 q5 star xzf nagioscore.tar.gz! b: n- T  `, T. \( }% L5 c- Q4 o
Compilecd /tmp/nagioscore-nagios-4.4.0/
) C9 v/ W" v5 `: u3 X./configure --with-httpd-conf=/usr/local/etc/apache24/Includes
; d: Y) J0 \- X2 `gmake all
4 x* w: V+ |" b; u, kCreate User And Group
This creates the nagios user and group. The www user is also added to the nagios group.
make install-groups-users2 g( L* A- k. U' v+ p
pw group mod nagios -m www5 L% R5 J- N3 k, q
Install Binaries
This step installs the binary files, CGIs, and HTML files.
gmake install( H. H, f  W, y' I
chown nagios:nagios /usr/local/nagios/bin/*9 ^" k4 b, @& I- T1 N5 t) c" y( f
Install Service / Daemon
This installs the service or daemon files and also configures them to start on boot.
gmake install-init
  C5 j( s5 v; }* D8 [6 x4 ]echo '/usr/local/etc/rc.d/nagios start' >> /etc/rc.local+ a' x* K; N6 R& u& K( Z
Information on starting and stopping services will be explained further on.
9 z- q0 q8 m, w" g% ?  E8 Y
Install Command Mode
This installs and configures the external command file.
gmake install-commandmode
/ S, ?5 @* @% Y5 @# DInstall 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* o) D7 t: D0 _
Install Apache Config Files
This installs the Apache web server configuration files.
gmake install-webconf
: x" R) r1 A/ 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>) y- S' E% U; K4 a3 n
        #LoadModule cgid_module libexec/apache24/mod_cgid.so& c1 M1 L5 z' R4 R/ \6 g6 Y6 u; w% ~
</IfModule>) Y, T8 @5 |- @+ f% X
<IfModule mpm_prefork_module>% f2 {1 S  S/ ?" C' ]) o5 e6 O
        #LoadModule cgi_module libexec/apache24/mod_cgi.so
0 [- c5 q& p3 W' [; P& ]</IfModule>
To this:
<IfModule !mpm_prefork_module>% P$ w8 h* t2 h$ _' y
        LoadModule cgid_module libexec/apache24/mod_cgid.so
. V7 t6 ]! T7 ~6 A/ s4 Z& y</IfModule>% @8 \  s) W+ g2 a+ l
<IfModule mpm_prefork_module>
, Y# U( D9 U6 h0 ^& M* M        LoadModule cgi_module libexec/apache24/mod_cgi.so
% A( }! I6 f& C</IfModule>
# d6 E8 r2 c8 ]/ V' w. `
Change this:
<IfModule dir_module>
, u6 |3 R4 W; V5 O9 a    DirectoryIndex index.html% G3 [* D4 j" m% A# p
</IfModule>
To this:
<IfModule dir_module>
/ a# d6 T! V5 C5 K    DirectoryIndex index.php index.html index.htm AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps
, I' v- B, M  G% Y" `6 q4 p</IfModule>
& J+ a! [- A; ^  |* Q
Add these lines to the end of the file:
<FilesMatch ".php$">, L- C7 B  @! z& x- a4 y
    SetHandler application/x-httpd-php
9 K+ x1 M( g6 S</FilesMatch>
) \9 F3 f, T+ z# u<FilesMatch ".phps$">
4 e# m+ m/ E9 k9 _+ }' S# G    SetHandler application/x-httpd-php-source
) m  |; z" U9 U' Y</FilesMatch>9 {( l  m# E# ?6 v) Z
Execute the following commands to make the changes described above:
cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
/ F3 i* [( d1 P/ U: Y0 pecho 'apache24_enable="YES"' >> /etc/rc.conf
; h+ i, o0 g/ h: ]  N% }# d# Dsed -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.conf
7 F4 L5 J% ?/ d, `* f. P; ^/ K' q# Tsed -i '' 's/#LoadModule cgid_module/LoadModule cgid_module/g' /usr/local/etc/apache24/httpd.conf7 I1 M7 t4 f! M. n% W9 p
sed -i '' 's/#LoadModule cgi_module/LoadModule cgi_module/g' /usr/local/etc/apache24/httpd.conf+ ?  I/ j/ F( e5 K# O
printf '\n<FilesMatch ".php$">\n' >> /usr/local/etc/apache24/httpd.conf( ^' G+ v6 D4 H3 o" P7 i
printf '\tSetHandler application/x-httpd-php\n' >> /usr/local/etc/apache24/httpd.conf
# ]. L" S8 K4 X2 a; y4 D9 p2 fprintf '</FilesMatch>\n' >> /usr/local/etc/apache24/httpd.conf! z+ p) ?% ~; }4 `2 C* p% @
printf '<FilesMatch ".phps$">\n' >> /usr/local/etc/apache24/httpd.conf
6 X! x7 p9 x8 {2 x! K+ Q: `6 p' Hprintf '\tSetHandler application/x-httpd-php-source\n' >> /usr/local/etc/apache24/httpd.conf
( W/ e4 [2 ^: X5 k  P6 xprintf '</FilesMatch>\n' >> /usr/local/etc/apache24/httpd.conf
% c8 U* F% w" GConfigure Firewall
Please refer to the FreeBSD documentation for information on how to enable or configure IP Filter to allow TCP port 80 inbound.
2 x) m7 b; f& U) u9 Z/ P' X5 Y" `

9 S  g# e8 D6 I4 z& t/ R2 }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) L6 {7 K# Y+ \3 n* }5 a, d) I6 }
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).
- q" a3 h' [$ g( @+ \; E
9 e# _( @* a' J6 s: |6 ]
Start Apache Web Serverservice apache24 start
; z. m  g8 P/ L2 B7 C* Z1 IStart Service / Daemon
This command starts Nagios Core.
service nagios start3 t# K( r+ s4 E6 j% a
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 `. |- r3 O  r$ e0 C! [: l. eInstalling 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& A6 G6 |5 y2 l
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 J1 A) L  H8 }/ P0 `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/ @8 b8 a+ V. S0 a2 m8 T
Downloading The Sourcecd /tmp
" E) d+ E5 m8 ~6 [. U2 P  c0 mwget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz# I8 m+ n& B7 k# J
tar zxf nagios-plugins.tar.gz
$ G6 b+ a; J. w; b2 c+ GCompile + Installcd /tmp/nagios-plugins-release-2.2.1/. x/ W% U1 }$ Y
./tools/setup
+ S8 o5 r0 R  z% q, e3 i& M% o./configure4 h! I: ?* d) j! [
gmake' S& L; p" r% R2 h! S( N( r' v
gmake install3 M2 h- j6 P9 \! B) v
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.
8 a/ @1 k( Z0 j% S1 j; ^. t" }
Service / Daemon Commands
Different Linux distributions have different methods of starting / stopping / restarting / status Nagios.
service nagios start
5 e0 j$ i- q0 x, _3 ^- xservice nagios stop
$ J/ d+ v3 M8 z# O0 I" x/ \9 m$ `service nagios restart
9 r4 q; ?+ x4 A  |; |$ Q3 J8 Fservice nagios status
1 y/ a! A' a5 v5 J5 c( K/ b0 K: H
, l6 g" {9 X& C. h# r3 F
, |8 S. J+ L; v" f& s2 T
Solaris
Tested with Solaris 11.

6 [! q8 k  v, ^5 w! _$ t* LSecurity-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' >> ~/.profile5 p/ S8 N, P' |: S! J
source ~/.profile
3 w( c: X  ~, W  T. j/ F! Opkgadd -d http://get.opencsw.org/now
% O  N& G: N2 @% Uanswer all+ \5 a) v8 p/ g/ ^" U5 j% G
answer y
2 s5 A% a. ?3 W, rperl -ni.bak -le 'print; print "mirror=http://mirrors.ibiblio.org/opencsw/stable" if /mirror=/' /etc/opt/csw/pkgutil.conf' x* Y$ P; Q5 m, f6 o
pkgutil -y -i autoconf automake unzip gd8 p4 M: F1 K; {
pkg install gcc-45 web/php-53 apache-php53 gd Downloading the Sourcecd /tmp
5 S+ e8 g( v: D9 J, Dwget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz
* @3 j  b' {# X; I/ C: A4 Ltar xzf nagioscore.tar.gz
8 S9 N5 s8 ?6 ]8 v! KCompilecd /tmp/nagioscore-nagios-4.4.0/0 A' p, o3 L* H  o0 d  d; e8 L& ~, w
./configure --with-httpd-conf=/etc/apache2/2.2/conf.d --with-gd-inc=/usr/include/gd2
7 Z& R, B2 {6 H* C' pgmake all
8 p9 R3 O( w0 J) N' D9 C* [3 sCreate User And Group
This creates the nagios user and group. The webservd user is also added to the nagios group.
gmake install-groups-users
  B5 w) W7 n2 H0 E- }usermod -G nagios webservd5 l9 F# S& A: C' V6 ^
Install Binaries
This step installs the binary files, CGIs, and HTML files.
gmake install
" d- Q3 b0 ]9 x4 Y9 V' VInstall 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
1 g( F! A# q$ Z. d: g! b! P& i+ d; Gsvcbundle -o /lib/svc/manifest/site/nagios.xml -s service-name=application/nagios -s rc-script=/etc/init.d/nagios:2 -s model=contract
& [9 \& F& N' a9 `; p* y. q
Information on starting and stopping services will be explained further on.

9 x2 U4 G) }9 w5 XInstall Command Mode
This installs and configures the external command file.
gmake install-commandmode
% ]# q, m# v( [& m3 N5 [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
! p& v. P+ q6 J) t' r  {4 g3 qInstall Apache Config Files
This installs the Apache web server configuration files. Also configure Apache settings if required.
gmake install-webconf
5 s4 Y; A0 a9 s6 BConfigure 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.
9 c$ H2 D9 t; f* n
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
  @* H7 K; O8 G( x) g% y
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).
, [5 [4 _$ q" x' U7 d  w1 g

0 ~" ]6 G! u8 F, aStart Apache Web Serversvcadm enable apache222 i3 \1 K- N4 r' l
Start Service / Daemon
This command starts Nagios Core.
svcadm restart manifest-import! x" l' G9 \+ Y0 c# A7 w, L* s% V
svcadm enable nagios
: b" d2 N" W8 c( g! m6 ETest 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 i9 y: \! h* _8 s1 b% |0 kInstalling 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 b- ~( ~7 L/ x# z8 ?' _
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:

  _+ H9 V7 b; p7 H5 C" dPrerequisites
Already completed as part of the Nagios installation. Some of the plugins require the NET::SNMP perl module. Please refer to the following documentation:
" F8 W  P( x& K, u( X6 n7 ?8 x/ P. S
Downloading The Sourcecd /tmp
: i* S2 y) v  rwget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz7 ]$ ~4 N+ V3 I: K
tar zxf nagios-plugins.tar.gz% U- n5 H3 L, e) N
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/# J/ E: x! l. @- ?* }- _
./tools/setup
0 n/ ^! d8 G3 b, A$ ]4 b./configure5 b6 S! c  n9 ]0 ]$ {" h1 y  A
gmake
, t; G' D0 S. Z# B9 Tgmake install# C- ?6 e$ e2 D7 ]5 R
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.
% T6 M9 g2 e4 o& e' Y% ]6 A
Service / Daemon Commands
These commands are for starting / stopping / restarting / status Nagios.
svcadm enable nagios* \. O1 q4 @  [9 n# W! k
svcadm disable nagios
1 J, X( x$ b" x+ c/ Isvcadm restart nagios
: t# c2 v9 ]. w; I9 esvcs nagios
: o% _& T) Z! h* A9 {# S* L8 A, I6 \svcs -xv nagios/ O8 U, }1 h% ~7 b) B) H
svcadm clear nagios
+ H7 a( R, c1 O) @# O3 T
The following KB article has important information on Solaris and services:

% }  W6 U2 [; C$ ?. \0 W/ F5 B; }5 H6 ]* ^

# C' ~, g' N! J# d4 P
Apple OS X
Security-Enhanced Linux
SELinux is not implemented in Apple OS X and hence is not an issue.

+ X4 _4 i, R% GPrerequisites
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 -license6 E% A9 v% ~% H0 t: T! o
View the agreement and then type agree# l1 G& V1 Z% I' y7 E
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. c" A; l# _* J* y1 c
Downloading the Sourcecd /tmp; j- _  I' b: a/ Z7 ^% S$ _! S
curl -L -o nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz7 m4 Z/ L! Q0 ^, ?# \
tar xzf nagioscore.tar.gz  |( W4 m* \) W  @  K
Compilecd /tmp/nagioscore-nagios-4.4.0/6 Z6 P" a4 _/ r$ S& h+ j- [1 b4 D
sudo ./configure --with-httpd-conf=/opt/local/apache2/conf/extra --with-gd-lib=/opt/local/lib --with-gd-inc=/opt/local/include
! w4 }1 x$ ?8 D  X% Lsudo make all
' P5 @7 {9 D$ R+ l. K9 |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
% ?8 e* D" W4 F1 Q8 }& c5 V# p& \& R  osudo dseditgroup -o edit -a _www -t user nagios' j4 C- D0 S3 t) ~9 ^
Install Binaries
This step installs the binary files, CGIs, and HTML files.
sudo make install- z3 U1 w! t) C4 n1 l2 v
Install 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* w. z+ f6 {7 [* 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"?>
7 J/ A( l2 @0 r( ^0 k5 E<!DOCTYPE plist PUBLIC "-//Apple/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+ {5 R5 d1 x9 u+ |+ D3 r
<plist version="1.0">
8 o2 A& o6 ^, C9 h% s. p% ]<dict>( }3 E$ v3 ?  ^" ?" G3 K
        <key>Label</key>
$ V2 m! p  ~) @4 V/ D# u* r        <string>org.nagios.nagios</string>5 t- X7 r0 p/ C9 C' ^/ \
        <key>UserName</key>0 Q+ h6 a% b6 |7 ~" Y; O1 X
        <string>nagios</string>0 A& z; _  J9 I& v  R* b
        <key>GroupName</key>, G9 i2 M. p8 _" A: U  ]
        <string>nagios</string>
- {7 T" J. ~3 Q' t        <key>Program</key>
  J% ~9 P* ^, r0 k$ [3 ]        <string>/etc/rc.d/init.d/nagios</string># T" L4 j( `: E- U; V% E
        <key>ProgramArguments</key>' l. k$ x! U8 D; |) b5 b
        <array>
" ~8 a' b1 ~" D& \4 c5 B" Z/ b' x7 r                <string>nagios</string>
; M7 c8 H* b" R% B  T5 u* C. \1 n                <string>start</string>( K! a3 q1 D1 h9 r$ s* ~
        </array>
) K, W+ ]9 E: e# u        <key>KeepAlive</key>' D+ h. A4 f! J' h( O
        <dict>
& F: N/ z0 S' v/ T/ e                <key>SuccessfulExit</key>
, K2 d: p/ p- P; g7 D. y( P                <false/>5 ?& j  S, T1 S  D' I7 |
                <key>NetworkState</key># C; z2 j8 ?( l& k7 c
                <true/>
  |- U! ~$ u. y' Z7 C* M; @: U        </dict>$ E4 }3 N$ f( Z8 B' p7 z
        <key>RunAtLoad</key>
% k" z/ z# p5 p4 U! {4 S        <true/>
0 \. q. @! x* M% `  e/ t        <key>ProcessType</key>
) [; D6 p( @( H% @6 @9 T        <string>Background</string>
9 [% A2 Q+ {! R+ Q</dict>6 z) Z" n* h8 o$ m
</plist>
) o+ @: }" C3 D# C/ h
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.
0 ~  N, Y, [( l* f4 g
Information on starting and stopping services will be explained further on.

# L& b& g: F' S- y4 e! D7 _Install Command Mode
This installs and configures the external command file.
sudo make install-commandmode4 O4 r3 Z. i& 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
( m# a- ]6 U! v7 r& N, U6 e" j2 jInstall Apache Config Files
This installs the Apache web server configuration files.
sudo make install-webconf
8 Z$ Z# E5 E. @7 a- _
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>$ c8 ~! y( v" M$ Q. Y3 o( }! g
    DirectoryIndex index.html) k! B/ c. ~& P% W
</IfModule>
To this:
<IfModule dir_module>, [/ t2 |# d* ^
    DirectoryIndex index.php index.html index.htm AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps
/ n/ L6 e, H1 X2 m1 ?$ q3 r7 I4 {</IfModule>2 J& @) @6 a# i' d4 t, ^( K$ \
Add these lines to the end of the file:
Include conf/extra/nagios.conf
" n0 j9 U! U. s  qInclude conf/extra/mod_php70.conf
, k- e& b* Z/ s5 E6 \8 Q) `5 _
Execute the following commands to make the changes described above:
sudo cp /opt/local/etc/php70/php.ini-production /opt/local/etc/php70/php.ini0 N0 J  p; [& I# j; @$ x
cd /opt/local/apache2/modules/! q6 y% N+ K( `1 t  G" c8 p
sudo /opt/local/apache2/bin/apxs -a -e -n php7 mod_php70.so
, w. B2 O! W( Y( j& K; D6 Gprintf '\nInclude conf/extra/nagios.conf\n' | sudo tee -a /opt/local/apache2/conf/httpd.conf; |6 K" W+ [; N& D' V* s
printf '\nInclude conf/extra/mod_php70.conf\n' | sudo tee -a /opt/local/apache2/conf/httpd.conf
4 T6 X  D: S8 d! ysudo 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! }% I$ ?; A6 \0 o: m
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.

) z/ `- k$ J5 H9 u! k% 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.
sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
' j  P3 A' K7 E# u  S8 S! 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).

2 A: p+ R) @9 u' y% M! |5 D
5 [4 n2 S3 l2 Z7 T7 ]Start Apache Web Serversudo /opt/local/bin/port load apache2
; P7 ]! w1 A7 b1 Y9 ~, @/ K* L4 M7 HStart Service / Daemon
This command starts Nagios Core.
sudo /etc/rc.d/init.d/nagios start9 ^8 S) u) z+ L0 k% k
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.

9 C8 d1 w3 a0 ^1 [% S, lInstalling 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
3 p, e1 k! t# L# j. dsudo sed -i '' 's/\/usr\/local\/nagios\/libexec/\/opt\/local\/libexec\/nagios/g' /usr/local/nagios/etc/resource.cfg
1 V  h/ V7 e/ }5 w$ C; xsudo /etc/rc.d/init.d/nagios stop6 q8 X$ d* R8 t; T
sudo /etc/rc.d/init.d/nagios start
& k0 H: C" H; b6 e' ZTest 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.
: A3 B' d- n1 Q5 D& C5 b* i% \
Service / Daemon Commands
These commands are for starting / stopping / restarting / status Nagios.
sudo /etc/rc.d/init.d/nagios start* \1 [% s  O; \2 E+ d2 H
sudo /etc/rc.d/init.d/nagios stop6 P$ q& \. S$ R  c
sudo /etc/rc.d/init.d/nagios restart$ D1 w5 a0 O) N0 F
sudo /etc/rc.d/init.d/nagios status5 k4 C3 g# y( P+ o, w/ }
  B. \, @) P3 J) h
: _( l0 p* p4 m, {: `
3 i: \6 M  v& f0 j3 l2 ~' D! X
Final Thoughts
For any support related questions please visit the Nagios Support Forums at:
[url=]http://support.nagios.com/forum/[/url]

; @: E# l2 q1 P4 B+ H6 J8 c
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 04:24 , Processed in 0.023055 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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