|
Installing Nagios Core From Source8 D* Q3 o. M" {( i: W
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- o3 v, W5 k1 W- o$ q W2 M1 f" x9 h
- Install Nagios Plugins- Q& `7 f" i' n' J$ r
/ M1 b& B9 o( D, Q" g
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.
% n. D0 G$ M( e0 x7 U/ \Please select your OS:
( ?+ n, k+ P* k# ]" N
- E: ?+ \( D0 g5 J- |9 |8 D% @/ A/ B6 g8 R1 }' L# J8 ~1 z
CentOS | RHEL | Oracle Linux Security-Enhanced LinuxThis 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
2 F6 p* x4 P/ d# {2 u$ r4 Bsetenforce 0$ {; {; X; V; N4 t
PrerequisitesPerform 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
6 `7 y7 [& l2 X j# Bwget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz- G' R6 ~+ O8 r9 V
tar xzf nagioscore.tar.gz5 k; _$ p6 @% X) y+ ?
Compilecd /tmp/nagioscore-nagios-4.4.0/! c0 w2 t$ Q# V$ j$ W4 g9 W: Z
./configure
7 T* f4 {- u+ q% Imake all7 V: j: U( `7 K2 `( h/ g# Q
Create User And GroupThis creates the nagios user and group. The apache user is also added to the nagios group. make install-groups-users
$ o" m5 m, T9 B: k+ x4 z& U7 u+ H/ zusermod -a -G nagios apache
& a5 a u) ^9 {4 N8 V* [& _Install BinariesThis step installs the binary files, CGIs, and HTML files. make install
6 L, f u+ t$ _( VInstall Service / DaemonThis 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-init3 {- t( O4 Q1 v* ~, ~( b
chkconfig --level 2345 httpd on3 J" u; v* e$ L# D! n
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x ===== make install-init! q) y, \& Y L7 ~8 |0 g
systemctl enable httpd.service7 y8 F3 J1 Q4 k8 \/ m3 x
Information on starting and stopping services will be explained further on. # O1 c& N$ |/ H5 \* E# E! l
Install Command ModeThis installs and configures the external command file. make install-commandmode( m1 h& I+ Z4 V4 b) R% O; h% c. ~
Install Configuration FilesThis installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start. make install-config" l9 O1 k) D* v; ~: t/ l
Install Apache Config FilesThis installs the Apache web server configuration files. Also configure Apache settings if required. make install-webconf
/ u3 F# H% n6 }& zConfigure FirewallYou 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
' k; F, y( Z1 t; qservice iptables save
5 U; R7 n$ \9 D- W* w3 m& c0 L8 Rip6tables -I INPUT -p tcp --destination-port 80 -j ACCEPT% n) Z+ v! v% w: j
service ip6tables save. b" | a, K6 b) @3 ?
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x ===== firewall-cmd --zone=public --add-port=80/tcp- }6 p4 J: D$ o' ]6 n3 x
firewall-cmd --zone=public --add-port=80/tcp --permanent
4 l+ X1 d# n/ l4 XCreate nagiosadmin User AccountYou'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; w! w0 q/ m- ^
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).
/ i1 q4 @0 {, L
$ G; Z d/ v4 uStart Apache Web Server===== CentOS 5.x / 6.x | RHEL 5.x / 6.x | Oracle Linux 5.x / 6.x ===== service httpd start$ x5 r- T; i1 j1 \, [' G2 [
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x ===== systemctl start httpd.service) i. x: X( D q- E5 r3 I# y- N
Start Service / DaemonThis command starts Nagios Core. ===== CentOS 5.x / 6.x | RHEL 5.x / 6.x | Oracle Linux 5.x / 6.x ===== service nagios start' O# S( J* c7 M( w& ?% ]
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x ===== systemctl start nagios.service
" r5 u7 h0 ?3 I9 d( e7 DTest NagiosNagios 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.
: M' d3 W6 A6 EInstalling The Nagios PluginsNagios 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.
' @) d4 y4 ?' g. \. V- E% @ u& cPlease 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:
5 z4 F, p, |) h9 c5 `6 O! bPrerequisitesMake 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! X4 j, ~* h, ?/ P9 V- s
yum install -y perl-Net-SNMP, G& x! l- ~ m/ ]$ V8 Q4 ]
cd /tmp
5 l; _& w; q9 L" i7 a7 m" | kwget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
. Y9 a! G9 Q' e( K- J7 @) q+ dtar xzf autoconf-2.60.tar.gz 9 ~3 r! d$ a+ q
cd /tmp/autoconf-2.60
{4 w/ W. U2 C, J) |) g./configure , H; _ l* y# G, b- a3 h8 a1 S! R
make: I! l5 t( L* E5 i3 X
make install
1 B4 Q/ c0 } A===== 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& a4 }3 [+ M/ i! d( [( ]) b
yum install -y perl-Net-SNMP
# Y( A* @1 h( x4 s===== RHEL 5.x | Oracle Linux 5.x ===== cd /tmp
5 i; u' X8 H; X/ ~) A2 w; w hwget http://archives.fedoraproject.or ... latest-5.noarch.rpm
( L. E. h e" b# @& Qrpm -ihv epel-release-latest-5.noarch.rpm! @7 c% @% w; R4 w6 ]- J9 {
yum install -y gcc glibc glibc-common make gettext automake wget openssl-devel net-snmp net-snmp-utils6 T& A1 W" ~. r
yum install -y perl-Net-SNMP/ U. B! d, ?& Y- t8 T
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz) V( d+ Z3 e0 ^5 V) e" V
tar xzf autoconf-2.60.tar.gz
* w4 z1 F8 N* s0 l( G4 I4 Q- P, m6 @cd /tmp/autoconf-2.60
9 B$ e5 ]2 W- @, J7 `./configure 4 V2 Q6 C7 m6 f3 z: c; a; H
make
6 c4 s5 |- W( K* a* Imake install# c2 G- ]0 K6 }+ H
===== RHEL 6.x | Oracle Linux 6.x ===== cd /tmp1 d5 i5 I d2 ^6 S4 `
wget https://dl.fedoraproject.org/pub ... latest-6.noarch.rpm' @2 B$ z, ^, B/ Z# T
rpm -ihv epel-release-latest-6.noarch.rpm
* C! K( c/ F1 l6 O1 v6 W6 t; A4 Vyum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils
! F/ V, Y5 h+ B+ _yum install -y perl-Net-SNMP
+ u+ v9 t0 ~( p$ o# S===== RHEL 7.x ===== cd /tmp
) I, n7 A6 d4 ^ L# Jwget https://dl.fedoraproject.org/pub ... latest-7.noarch.rpm5 Z7 v, B' e# ~3 X7 i* `9 q
rpm -ihv epel-release-latest-7.noarch.rpm4 S( W# `: s# T$ {& s
subscription-manager repos --enable=rhel-7-server-optional-rpms r5 U8 n+ h) R! v9 I
yum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils2 O$ v: s n7 P, v3 g& K
yum install -y perl-Net-SNMP
) O1 e/ T# Q9 O. T. y* R===== Oracle Linux 7.x ===== yum install -y yum-utils
& n! H2 R @% [8 Z( K8 ]yum-config-manager --enable ol7_optional_latest. ~* j( q1 s- V
cd /tmp
' B# ^% s( Z8 j- C3 qwget https://dl.fedoraproject.org/pub ... latest-7.noarch.rpm
0 S5 r, R) a# z1 Z9 jrpm -ihv epel-release-latest-7.noarch.rpm9 G- o( C; a! C+ X2 ~$ @, i
yum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils* D2 w, J+ b) M/ M7 ]
yum install -y perl-Net-SNMP# W: Q3 @( C! D
Downloading The Sourcecd /tmp
) W, P+ w( I/ P( {' ^% [ o0 uwget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz
. G+ w; O- V/ m# b0 q4 C: D. e4 Ztar zxf nagios-plugins.tar.gz
/ F: `, A" ^' l; r1 wCompile + Installcd /tmp/nagios-plugins-release-2.2.1/% z. G0 F5 Q6 ?+ m( }( o
./tools/setup& u/ b# {/ L9 T5 I( N, N8 o
./configure
4 p+ {) s& Z+ q7 T5 |: zmake2 B$ h6 C) \& g" A6 X1 N1 c
make install+ m0 K: l! |" T: A7 E7 { w
Test PluginsPoint 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+ k8 A* A" A+ v, P
Service / Daemon CommandsDifferent 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& q: _" {# a1 O
service nagios stop, t2 d! @2 v7 C: E- |+ o5 ]$ S
service nagios restart5 W' P9 e8 G0 F; R8 Q# o; ^
service nagios status5 p. K" w$ \, |0 b3 @
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x ===== systemctl start nagios.service1 v* A& t% a- W6 ~
systemctl stop nagios.service
1 d6 l: s- J; \( T* p, E0 _# ^systemctl restart nagios.service, a4 z( a& X- k6 ^6 ~2 ]/ B) x: q
systemctl status nagios.service
1 u5 {* X0 r/ s5 u& ?5 P# D; Q6 T% A2 E& {# X
8 F3 g4 W# A1 x o7 a% q
Ubuntu Security-Enhanced LinuxThis 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 {8 Z) V6 {1 E W: o0 {
PrerequisitesPerform these steps to install the pre-requisite packages. ===== Ubuntu 14.x / 15.x ===== sudo apt-get update
" Q3 f7 c/ L- Xsudo apt-get install -y autoconf gcc libc6 make wget unzip apache2 apache2-utils php5 libgd2-xpm-dev
/ l9 P a7 W0 z# r5 m) I5 m0 p. Q===== Ubuntu 16.x / 17.x ===== sudo apt-get update/ U8 W. E9 Y G6 \$ l) c7 x; ^
sudo apt-get install -y autoconf gcc libc6 make wget unzip apache2 php libapache2-mod-php7.0 libgd2-xpm-dev3 l* ~9 X7 L, x* b V5 ?
===== Ubuntu 18.x ===== sudo apt-get update8 ?$ J$ l- b& W+ H9 B
sudo apt-get install -y autoconf gcc libc6 make wget unzip apache2 php libapache2-mod-php7.2 libgd-dev
3 ]: H" Q* g2 C7 ?' k6 L# [9 M) e1 |Downloading the Sourcecd /tmp' I! W: S$ d9 [( s& Y% J
wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz5 H2 I: _; g. m6 I; a5 X. d
tar xzf nagioscore.tar.gz: u z4 I& K3 C! C% n# s
Compilecd /tmp/nagioscore-nagios-4.4.0/
0 ?7 X) M1 w, w- Ysudo ./configure --with-httpd-conf=/etc/apache2/sites-enabled. Z8 ]! [) i# M9 ~+ W% b
sudo make all
2 b( B. I, N% p }$ Z+ }4 PCreate User And GroupThis creates the nagios user and group. The www-data user is also added to the nagios group. sudo make install-groups-users
( h9 o( F: r$ U' t o# l9 f; `sudo usermod -a -G nagios www-data
, \& R2 ]* v) ~/ L# PInstall BinariesThis step installs the binary files, CGIs, and HTML files. sudo make install, E S. k/ g0 G8 m& L
Install Service / DaemonThis installs the service or daemon files and also configures them to start on boot. sudo make install-init! D! L# N% B) v+ i L; s8 U
Information on starting and stopping services will be explained further on. # T! a! B2 J% P- y. U6 ~
Install Command ModeThis installs and configures the external command file. sudo make install-commandmode
5 O* t# M9 ?; l9 P8 {Install Configuration FilesThis installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start. sudo make install-config& g0 Q+ D5 R5 j
Install Apache Config FilesThis installs the Apache web server configuration files and configures Apache settings. sudo make install-webconf5 I3 ]9 Z- @1 ]1 g" C6 y K; X+ ~% R
sudo a2enmod rewrite
4 D/ v; T& W4 I: ~$ Y" L- q, l, isudo a2enmod cgi) @* s) O- B4 n$ y
Configure FirewallYou 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 u/ O/ ]6 K9 @
sudo ufw reload1 G2 ?. o0 e5 M( \- ~1 h2 g. M
Create nagiosadmin User AccountYou'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. D* k! p2 U2 U! B( 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). * m% E1 }) y ], J
# \/ t: e2 W* n2 I# Z2 TStart Apache Web Server===== Ubuntu 14.x ===== Need to restart it because it is already running. sudo service apache2 restart
0 F6 c G0 B5 Y- m' h===== Ubuntu 15.x / 16.x / 17.x /18.x ===== Need to restart it because it is already running. sudo systemctl restart apache2.service8 ^0 w3 i; h' K, z
Start Service / DaemonThis command starts Nagios Core. ===== Ubuntu 14.x ===== sudo start nagios
1 ?$ m9 C0 q- K+ }. W. V===== Ubuntu 15.x / 16.x / 17.x / 18.x ===== sudo systemctl start nagios.service
! R4 h: l5 B" j( s% h: x: s* N. CTest NagiosNagios 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.
$ r' |1 h; D) t6 g1 hInstalling The Nagios PluginsNagios 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.
, t% a# h$ r& rPlease 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: . Q# @9 O8 \* T$ r
PrerequisitesMake 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
) j* o* j6 \, J1 g v2 s4 aDownloading The Sourcecd /tmp
" u: r% ~5 f+ A6 |+ ?' x) H% r3 ]$ J4 |wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz
; b1 a: [$ a: I% o% etar zxf nagios-plugins.tar.gz( k3 x6 y# G- U. G \8 O' h' l
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/
/ T" S1 Q, o5 p! v ? esudo ./tools/setup
2 C! E( G+ D9 |! u! J4 g7 esudo ./configure
/ C7 D: W9 x4 n7 f0 A6 R" U* wsudo make
: o: p# S$ |( Y4 A6 fsudo make install, |0 i+ d) d9 ^5 G4 u- ^
Test PluginsPoint 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 e* U# V5 s2 d7 k" f. D: j: aService / Daemon CommandsDifferent Linux distributions have different methods of starting / stopping / restarting / status Nagios. ===== Ubuntu 14.x ===== sudo start nagios- s% i; L! y, _9 Z# V" {
sudo stop nagios p) }+ g- Y1 C. T6 O. g+ [
sudo restart nagios
. E0 y' B" e6 r$ Z" Csudo status nagios
/ `) b( H, f3 a) S/ b===== Ubuntu 15.x / 16.x / 17.x / 18.x ===== sudo systemctl start nagios.service
3 o$ a0 i4 o7 N: W! q6 r% K2 Csudo systemctl stop nagios.service
& h2 V1 C2 @8 Fsudo systemctl restart nagios.service
7 h& [( I$ Q4 t. T9 jsudo systemctl status nagios.service" U8 ~8 z) P/ U
! B% {5 k, e* f0 \
. ]9 G' k3 C+ z2 aSUSE SLES | openSUSE Leap Security-Enhanced LinuxThis 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/configIf the file does not exist, SELinux is not enabled.
5 r! ~, E/ t3 i- GPrerequisitesPerform these steps to install the pre-requisite packages. ===== SUSE SLES 11.3 ===== cd /tmp
& J4 O* k! z: |: q) f+ awget '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') m) W3 A* E3 p k6 C! {- t6 D
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'
+ w1 @' W- h; a& O) Asudo rpm -ivh sle-sdk-release-*
% V* r# v) D4 z; s2 t% g# rsudo suse_register8 s- `: d6 h6 o; y/ T# b
sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php53 apache2-mod_php53 gd gd-devel; Z2 `7 W+ i! g- c! x
===== SUSE SLES 11.4 ===== cd /tmp' n9 `1 L9 ^# q$ L5 @) x
wget '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'7 _* I: C: q' F$ z8 N" X
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'6 ?3 e! C9 l4 ^+ o, V" N' [. g, r
sudo rpm -ivh sle-sdk-release-*
( I) @& L" F0 v1 ^, D, {% Psudo suse_register
; u' y: |" {# L& U$ x; `7 Q6 nsudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php53 apache2-mod_php53 gd gd-devel
5 r* g' E% f* t% i===== SUSE SLES 12 ===== sudo SUSEConnect -p sle-sdk/12/x86_643 h6 O, ^; ]" A, J
sudo SUSEConnect -p sle-module-web-scripting/12/x86_64
# X; U: K% x( zsudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php5 apache2-mod_php5 gd gd-devel0 S }( Y# S4 g0 x2 L+ c2 M
===== SUSE SLES 12.1 ===== sudo SUSEConnect -p sle-sdk/12.1/x86_64
# i' y+ Y) w! D* z' ksudo SUSEConnect -p sle-module-web-scripting/12/x86_64
& T: q \6 c# o- _9 k& psudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php5 apache2-mod_php5 gd gd-devel
$ i9 v9 H* b- }% e/ i===== SUSE SLES 12.2 ===== sudo SUSEConnect -p sle-sdk/12.2/x86_64
* |9 X M9 C- a* Isudo SUSEConnect -p sle-module-web-scripting/12/x86_642 m6 K3 r# }3 p+ a" k; a
sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php5 apache2-mod_php5 gd gd-devel
5 y/ n% y# _% ?. v+ N===== SUSE SLES 12.3 ===== sudo SUSEConnect -p sle-sdk/12.3/x86_64+ @. h) F' a3 Z9 A! G: Q( `# p* o. R
sudo SUSEConnect -p sle-module-web-scripting/12/x86_64! B( a4 V! W8 D& B( D4 _
sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php5 apache2-mod_php5 gd gd-devel
: b6 h" R! m% `. E- `===== openSUSE Leap 42.x ===== sudo zypper --non-interactive install autoconf gcc glibc make wget unzip apache2 apache2-utils php5 apache2-mod_php5 gd gd-devel3 o. D; ^% k8 t7 {9 O6 y
===== 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% A8 Z1 A2 @* G, D* {4 H b
- C' }" w4 D/ I
Downloading the Sourcecd /tmp
3 w3 Q$ {1 d' A: o. [/ F9 ^wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz! m* \6 Q9 ~# @9 }
tar xzf nagioscore.tar.gz, {, J3 v9 f; ~, d
Compilecd /tmp/nagioscore-nagios-4.4.0/
1 l, f5 s5 D C: \sudo ./configure --with-httpd-conf=/etc/apache2/vhosts.d0 }- n/ A. s; | J" [- k
sudo make all
. w& o3 a: _7 C7 `2 I3 e' v6 [Create User And GroupThis 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 o$ b8 i- U. `% A' g9 ^$ z
sudo /usr/sbin/usermod -A nagios wwwrun
* s. Y5 `4 A8 i. b5 {" Z===== SUSE SLES 12.x | openSUSE Leap 42.x / 15.x ===== sudo make install-groups-users
/ o8 ^9 d- ~& u( ?; ^% w2 Esudo /usr/sbin/usermod -a -G nagios wwwrun7 N2 C7 L3 j! T4 X" p1 }' E+ c, \
Install BinariesThis step installs the binary files, CGIs, and HTML files. sudo make install
8 E- |1 e5 M, f4 R0 J- WInstall Service / DaemonThis installs the service or daemon files and also configures them to start on boot. sudo make install-init' r$ N4 c5 G/ e7 ?$ {; ~ l5 j
Information on starting and stopping services will be explained further on. # ]: h. q; [0 [" B! T
Install Command ModeThis installs and configures the external command file. sudo make install-commandmode8 b, }0 V( U2 ~. i. ?4 K) V! y
Install Configuration FilesThis installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start. sudo make install-config
- ~0 k0 b1 \/ d4 c! ^6 I0 NInstall Apache Config FilesThis installs the Apache web server configuration files. Also configure Apache settings if required. ===== SUSE SLES 11.x ===== sudo make install-webconf' `) a3 ?6 c; [) `7 O
sudo /usr/sbin/a2enmod rewrite1 r3 z6 g+ v6 a3 }
sudo /usr/sbin/a2enmod cgi2 j4 P1 `# F: z; r1 p
sudo /usr/sbin/a2enmod version( D P/ p7 p4 W" p; ]' W
sudo /usr/sbin/a2enmod php5% U& I+ b: b9 z7 [3 C4 S
sudo /sbin/chkconfig --set apache2 on
& G+ D7 [ d0 ]# j$ m- n2 }===== SUSE SLES 12.x | openSUSE Leap 42.x ===== sudo make install-webconf: t1 I. x+ m/ k; Y% Q+ A
sudo /usr/sbin/a2enmod rewrite
# F/ K. F" Z* `2 M! Esudo /usr/sbin/a2enmod cgi+ `4 S3 l7 @* G
sudo /usr/sbin/a2enmod version
2 U1 B/ g" a* A' t+ J* A' I$ i Gsudo /usr/sbin/a2enmod php5
7 o( m( c$ J- x6 [) wsudo systemctl enable apache2.service- n6 u9 b8 m0 `# W/ X9 ^5 Z% l
===== openSUSE Leap 15.x ===== sudo make install-webconf
; C' y9 f; s1 j. z' P: dsudo /usr/sbin/a2enmod rewrite3 \3 ^3 r0 O4 E! n
sudo /usr/sbin/a2enmod cgi
: ^9 Y. Q' s4 f. F1 x9 usudo /usr/sbin/a2enmod version
8 p2 b8 m8 b( }! |sudo /usr/sbin/a2enmod php7
1 W( W: P' F- S( T8 z+ s/ Msudo systemctl enable apache2.service0 a. R2 t& J/ d" c( g7 e
Configure FirewallYou 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/SuSEfirewall26 r3 d! u" r0 d9 d
sudo /sbin/service SuSEfirewall2_init restart
4 h. W! h. K8 U* _) Gsudo /sbin/service SuSEfirewall2_setup restart
5 m9 A$ i# H$ D- @7 t9 S; V===== SUSE SLES 12.x ===== sudo /usr/sbin/SuSEfirewall2 open EXT TCP 80
' q% V* p1 P- u- O/ Rsudo systemctl restart SuSEfirewall2
: c6 N+ ?$ j: I* R( a===== openSUSE Leap 42.x ===== Port 80 is enabled when Apache is installed, nothing needs to be done.
) H! s- [# F, a$ F* u$ e6 @- V===== openSUSE Leap 15.x ===== sudo firewall-cmd --zone=public --add-port=80/tcp( e2 U! |3 J0 _" Z( d/ Q o' K) A
sudo firewall-cmd --zone=public --add-port=80/tcp --permanent/ a4 W+ h) s$ D, D5 @
# O1 c* W( P: S; pCreate nagiosadmin User AccountYou'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 nagiosadmin2 @8 ~ Z0 z. r6 ^
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).
9 ?( \. ~( W2 o9 t1 b& a$ j
0 p/ i" `8 V- _+ o6 T7 z+ ~4 C, D: eStart Apache Web Server===== SUSE SLES 11.x ===== sudo /sbin/service apache2 start3 [- u5 P7 j& i* F) [
===== SUSE SLES 12.x | openSUSE Leap 42.x / 15.x ===== sudo systemctl start apache2.service
5 v# {$ D7 m& {, e' K) Z4 B/ L( l3 HStart Service / DaemonThis command starts Nagios Core. ===== SUSE SLES 11.x ===== sudo /sbin/service nagios start7 b6 v1 N2 v. X3 t6 ]: m
===== SUSE SLES 12.x | openSUSE Leap 42.x / 15.x ===== sudo systemctl start nagios.service
$ w. e! ~3 I- v" d7 ATest NagiosNagios 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 D& z( |' V1 g8 j5 y7 v
Installing The Nagios PluginsNagios 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 t2 f, j, u$ V- X# x4 ?
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 l: r; e5 O; p/ xPrerequisitesMake 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
. ~4 e; n7 V& g2 p===== 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
6 w4 O2 y* w* v, Z, J& V$ ~; z. q9 \Downloading The Sourcecd /tmp0 n8 A( M# i8 c( v- T" F9 O
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz
8 `* T' f3 O! G1 Etar zxf nagios-plugins.tar.gz
( D* N# _1 l9 A9 o7 q! vCompile + Installcd /tmp/nagios-plugins-release-2.2.1/6 t' q* K' D" R2 C: z4 m! j
sudo ./tools/setup; y6 F. S e& u+ u6 S' \ C6 }2 E
sudo ./configure4 Z$ v7 u" J0 U7 L4 v" t) C
sudo make
3 p! E( x8 n0 e( U" w1 ~2 Ksudo make install
6 g0 m3 L v3 O9 }Test PluginsPoint 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.
" c3 l! b+ a* J- G6 VService / Daemon CommandsDifferent Linux distributions have different methods of starting / stopping / restarting / status Nagios. ===== SUSE SLES 11.x ===== sudo /sbin/service nagios start' J6 R7 ?) t; r1 O% B; H
sudo /sbin/service nagios stop
" ? o/ K# u8 c4 W# Hsudo /sbin/service nagios restart0 `6 ^0 p1 j# A) l# T3 o
sudo /sbin/service nagios status ===== SUSE SLES 12.x | openSUSE Leap 42.x / 15.x ===== sudo systemctl start nagios.service: c3 ~6 B5 N& Y
sudo systemctl stop nagios.service
! ~. }+ }' b) i3 O3 I& `# @9 ?! ]sudo systemctl restart nagios.service3 A C) l8 t- n$ t. Z1 f
sudo systemctl status nagios.service5 Q+ A8 A9 U% [$ Q3 ^0 `! p0 j
+ s! e& M8 w+ v5 ~' ^. G
9 [; F! D5 k4 _9 K9 }3 z$ I0 w1 l
Debian | Raspbian All steps on Debian require to run as root. To become root simply run: Debian: su
& _/ {. x! J# v& V1 U! FRaspbian: sudo -i N' t, ]$ H5 U: Q
All commands from this point onwards will be as root.
7 [9 D* Q' d* v9 mSecurity-Enhanced LinuxThis 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*
" u: c9 A# G& BPrerequisitesPerform these steps to install the pre-requisite packages. ===== 7.x / 8.x ===== apt-get update' A2 B: r) ~; ]7 d
apt-get install -y autoconf gcc libc6 make wget unzip apache2 apache2-utils php5 libgd2-xpm-dev
: F3 l0 [6 m: U! z9 M, e- G. x===== 9.x ===== apt-get update
6 H: K+ k# p* j- O4 e! n2 Papt-get install -y autoconf gcc libc6 make wget unzip apache2 apache2-utils php libgd-dev5 e7 A* ?- G" A5 K
Downloading the Sourcecd /tmp2 [+ Z( L# H. A% A
wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz
: t# N" z7 [& |0 M: Etar xzf nagioscore.tar.gz# P5 C3 e+ S8 r8 g3 N3 o
Compilecd /tmp/nagioscore-nagios-4.4.0/4 k {% k' h4 N0 r
./configure --with-httpd-conf=/etc/apache2/sites-enabled6 k: A; d u# B
make all2 Y0 a% \- @. m
Create User And GroupThis creates the nagios user and group. The www-data user is also added to the nagios group. make install-groups-users: |9 Q" H3 n6 d4 v1 z& k% P" l+ o
usermod -a -G nagios www-data
4 r6 |( G7 o5 x, ~4 m0 `2 |Install BinariesThis step installs the binary files, CGIs, and HTML files. make install
6 o6 Z, Z X* rInstall Service / DaemonThis installs the service or daemon files and also configures them to start on boot. make install-init
1 I% p* K) Y6 ^Information on starting and stopping services will be explained further on.
* P0 ]( @' { M7 p# O0 dInstall Command ModeThis installs and configures the external command file. make install-commandmode3 q7 D: U r6 r5 C2 O7 _
Install Configuration FilesThis installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start. make install-config" ]7 J+ r) I( Q4 I5 {' H
Install Apache Config FilesThis installs the Apache web server configuration files and configures the Apache settings. make install-webconf
+ L! W6 s% W1 m/ i' Za2enmod rewrite
, ~/ B U$ D7 Z; I9 ]: la2enmod cgi2 @* q& w- A- j, ~2 O% X
Configure FirewallYou 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
. o' h# R" u$ capt-get install -y iptables-persistentAnswer yes to saving existing rules
% E0 w8 o1 b+ }9 @ {+ V2 z% u1 v3 pCreate nagiosadmin User AccountYou'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 [/ H. a7 u7 k, D: B& Q
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). ) @1 _2 a1 O3 `2 v- K1 `4 C. H9 V
3 o5 M/ `7 j/ q8 |
Start Apache Web Server===== 7.x ===== Need to restart it because it is already running. service apache2 restart; w! v0 ]; K* p( C t
===== 8.x / 9.x ===== Need to restart it because it is already running. systemctl restart apache2.service. {* F0 A, q' V! i# S
Start Service / DaemonThis command starts Nagios Core. ===== 7.x ===== service nagios start
8 U1 H+ c9 ?$ g( I3 d4 q===== 8.x / 9.x ===== systemctl start nagios.service
- A1 D$ e0 I6 I9 B1 X" ATest NagiosNagios 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.
/ Z# B% l0 ?4 E3 rInstalling The Nagios PluginsNagios 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.
/ f @/ V' N# ~. w- sPlease 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:
$ R) T( G" c' O7 S& }0 h: WPrerequisitesMake 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 gettext5 C- [0 ^5 Q. V! C, s- P& N( x
Downloading The Sourcecd /tmp! {! a' M( c0 a" R9 t# t
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz
. d9 T ?% g# {1 utar zxf nagios-plugins.tar.gz
; x6 d. s6 P& o @/ ACompile + Installcd /tmp/nagios-plugins-release-2.2.1/
1 v* A* j( m, |2 U0 ^# n# H2 D0 c./tools/setup
! Y9 k8 M2 @- i% Y; K6 Z5 q. a./configure9 _: G; F2 `2 W4 u1 u. G
make
4 X2 V [; d: h! `; j3 \7 dmake install3 m7 N% R7 y S0 g. o
Test PluginsPoint 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 O0 D, W5 x' P1 jService / Daemon CommandsDifferent Linux distributions have different methods of starting / stopping / restarting / status Nagios. ===== 7.x ===== service nagios start
5 S5 d4 G6 o# ?5 _) I3 i zservice nagios stop/ k& } m& H' t# q7 T% Z
service nagios restart
+ i( X0 ~ D4 ^5 ]5 R; vservice nagios status
# g+ `0 ? E$ f3 Q# Z===== 8.x / 9.x ===== systemctl start nagios.service$ ^: _$ C: W$ z% k& p
systemctl stop nagios.service
9 f9 \1 H1 T6 ?8 R5 nsystemctl restart nagios.service: A+ p% \8 Z- c' s' |9 j5 W
systemctl status nagios.service
* v. m6 a- X; X
( J* K7 @9 T4 H) C1 V, K9 C; s# d8 n! G
Fedora Security-Enhanced LinuxThis 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
( ^; f+ w+ T& w: D1 Q( e1 O/ Hsetenforce 0! Z: _' O" y+ B9 ~; s% ^
PrerequisitesPerform these steps to install the pre-requisite packages. dnf install -y gcc glibc glibc-common perl httpd php wget gd gd-devel
% ?: B8 g% Z8 adnf update -y Downloading the Sourcecd /tmp; T* o4 x9 f: P% C# s: w& {) [
wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz5 e8 D+ P8 {& I% Q' w$ R v: K
tar xzf nagioscore.tar.gz
) `( Z" n' {: ^7 c; QCompilecd /tmp/nagioscore-nagios-4.4.0/
% O- t; G7 }( ^8 o1 J./configure
5 o9 M- r: {% ?! r$ emake all
# ^) k! P7 X v3 o# S- RCreate User And GroupThis creates the nagios user and group. The apache user is also added to the nagios group. make install-groups-users t5 c. E5 x7 p, S6 I
usermod -a -G nagios apache
* P: L9 I9 m, ]8 YInstall BinariesThis step installs the binary files, CGIs, and HTML files. make install
# f" Y7 p3 x3 B, [Install Service / DaemonThis 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
+ l4 S& m+ D/ G# }, R# s: Psystemctl enable httpd.service' Y; ]% \# i) i7 @/ x2 s& X
Information on starting and stopping services will be explained further on. + K6 X6 N& c! m. R$ S5 U# P
Install Command ModeThis installs and configures the external command file. make install-commandmode
# p4 W0 {) U8 E! x1 @! l& {Install Configuration FilesThis installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start. make install-config
# K% j; h" @( WInstall Apache Config FilesThis installs the Apache web server configuration files. Also configure Apache settings if required. make install-webconf$ N1 K& p! Y, b# ?9 D6 H
Configure FirewallYou 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. L2 k1 A- H$ P3 b/ Y5 t4 Q4 l
firewall-cmd --zone=FedoraServer --add-port=80/tcp --permanent8 y* V; B2 h n q- B8 V& Q1 _
Create nagiosadmin User AccountYou'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 nagiosadmin9 q; ^8 {; X# E) e4 P' x/ F7 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). " H, y* Y; ]$ z. @
; b) T3 Q8 s7 N1 c+ @
Start Apache Web Serversystemctl start httpd.service
/ X* p8 o1 U- t4 _( IStart Service / DaemonThis command starts Nagios Core. systemctl start nagios.service2 ^8 h6 H+ D9 t% x
Test NagiosNagios 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 @/ B m$ ^( a CInstalling The Nagios PluginsNagios 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.
. }7 u7 I* O5 m) e( k' S, GPlease 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:
5 n7 L) v8 j! W4 _8 SPrerequisitesMake 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 autoconf D' v/ }; F0 {! O/ }0 X
Downloading The Sourcecd /tmp0 ?, `0 V5 I( d& k* N" s
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz
$ G9 j& w2 w8 T f) x5 s5 \tar zxf nagios-plugins.tar.gz: y+ K: ^/ H% S
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/
8 m6 z% N: g7 G. c1 j0 T./tools/setup( \( L# ?2 N. U& u
./configure6 ^5 G% ~( b, w$ `
make/ @. O+ y3 p7 u
make install
8 E+ c/ X$ C% z/ _" c+ cTest PluginsPoint 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. 6 A X$ G$ ?5 h3 J# }2 {
Service / Daemon CommandsThese commands are for starting / stopping / restarting / status Nagios. systemctl start nagios.service
' }* B V r. V; T) U7 a0 f; F: X: psystemctl stop nagios.service3 L, s2 d' M/ Y! ^1 s2 f0 ?
systemctl restart nagios.service m7 U w t7 b- L
systemctl status nagios.service2 W0 I! U0 N9 @- t# Q
* m$ ?6 s, a/ Q# m9 fArch Linux Security-Enhanced LinuxThis 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/configIf the file does not exist, SELinux is not enabled. 1 X: b0 e9 D, o0 r2 L5 }
PrerequisitesPerform these steps to install the pre-requisite packages. pacman --noconfirm -Syyu: j8 |4 ~4 S, g% @. |& f! z, h0 o
pacman --noconfirm -S gcc glibc make wget unzip apache php gd traceroute php-apache Downloading the Sourcecd /tmp
. G- Z8 `' i, X* Z, Qwget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz
! m5 T: A( }( W" f1 Ctar xzf nagioscore.tar.gz
# a0 S, C0 z m- B# n+ ECompilecd /tmp/nagioscore-nagios-4.4.0/
2 ?% O) u: A6 f' b9 G& C0 x./configure --with-httpd-conf=/etc/httpd/conf/extra
( V2 Z; n* _! {7 `8 Zmake all
2 f# Y. b: d7 J6 g7 F( SCreate User And GroupThis creates the nagios user and group. The http user is also added to the nagios group. make install-groups-users
7 r; G- g% N V! A& ^' D: y5 r$ Q, xusermod -a -G nagios http
( t; u- }* `# P! wInstall BinariesThis step installs the binary files, CGIs, and HTML files. make install
. E7 `' S( c5 s5 S6 XInstall Service / DaemonThis 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-init9 M) k& q T5 l& X$ X8 T
systemctl enable httpd.service
3 m0 B! y" {6 p4 Z) ]Install Command ModeThis installs and configures the external command file. make install-commandmode" K# Q! k$ F% C0 u
Install Configuration FilesThis installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start. make install-config
) K6 A% _( i6 n/ W8 kInstall Apache Config FilesThis installs the Apache web server configuration files. make install-webconf: m! J2 G) o, X' y+ B
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.soTo this: #LoadModule mpm_event_module modules/mod_mpm_event.so
* v0 g/ I; h: r2 o' m/ UChange this: #LoadModule mpm_prefork_module modules/mod_mpm_prefork.soTo this: LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
1 Z( |' Y+ Q& s1 ~5 _Change this: <IfModule !mpm_prefork_module>: x- e0 y; M% P& K0 V6 g o- \
#LoadModule cgid_module libexec/apache24/mod_cgid.so8 i. j8 w- g p7 A1 A
</IfModule>5 u& g% n t$ E# a
<IfModule mpm_prefork_module>
9 q" O; L/ I6 q5 r' O7 g #LoadModule cgi_module libexec/apache24/mod_cgi.so
& f; d0 c0 T/ O" a3 s" ^</IfModule>To this: <IfModule !mpm_prefork_module>
5 w" L8 t- }; M) Y LoadModule cgid_module libexec/apache24/mod_cgid.so
0 Z- M; k: O$ W- F$ \</IfModule>
# H* K7 f: d. ?. i<IfModule mpm_prefork_module>
+ K% _% q, d' U* ^ LoadModule cgi_module libexec/apache24/mod_cgi.so
. i2 r+ E L( ^/ d</IfModule>
* y! P; C+ c! C% i* k0 i7 `, \4 M# uChange this: <IfModule dir_module>
4 O% h: A0 f# {- D DirectoryIndex index.html
# i7 w# Z7 |8 k n, ~</IfModule>To this: <IfModule dir_module>
" i1 ^; g$ o: @5 m' H3 P DirectoryIndex index.php index.html index.htm AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps
. e& j/ ^2 v8 E( [: C</IfModule>
: `- \0 C) I; O, NAdd these lines to the end of the file: LoadModule php7_module modules/libphp7.so8 g/ @; Q# S2 Y- ]3 u8 d1 L9 b
Include "conf/extra/nagios.conf"( g! d1 S$ D/ g. a
Include "conf/extra/php7_module.conf"0 ?0 ]" d" d+ N' ?6 f
<FilesMatch ".php$">
) H( o/ y" E' K SetHandler application/x-httpd-php8 D1 _2 e8 f3 M. A. w c/ H0 R
</FilesMatch>/ @0 `2 c- E; j
<FilesMatch ".phps$">
9 k5 l7 P# _( F# u; i1 y7 h# d0 l/ S7 d SetHandler application/x-httpd-php-source1 ]4 ~# ]2 G; i6 L" n* Y) x5 s
</FilesMatch>& {( U. \" ^$ k% T8 @% ~5 h
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- @5 ^8 a. L6 ]8 p" K! ~. x5 c
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% i0 g0 Y$ z8 ?' J S
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' /etc/httpd/conf/httpd.conf) g3 [. A" G- q. y6 q" z6 j
sed -i 's/#LoadModule cgid_module/LoadModule cgid_module/g' /etc/httpd/conf/httpd.conf$ M9 V4 w$ c. N. v2 j2 X
sed -i 's/#LoadModule cgi_module/LoadModule cgi_module/g' /etc/httpd/conf/httpd.conf M. n% X5 U0 q6 i5 K, K
echo 'LoadModule php7_module modules/libphp7.so' >> /etc/httpd/conf/httpd.conf
' K; C# q) x$ I* I1 N4 K0 vecho 'Include "conf/extra/nagios.conf"' >> /etc/httpd/conf/httpd.conf
0 h( S L2 z" Xecho 'Include "conf/extra/php7_module.conf"' >> /etc/httpd/conf/httpd.conf
7 _$ K/ s9 ?3 f, ?printf '\n<FilesMatch ".php$">\n' >> /etc/httpd/conf/httpd.conf
# R- x0 c7 g- j5 `printf '\tSetHandler application/x-httpd-php\n' >> /etc/httpd/conf/httpd.conf
7 N, ~- E; ^ B' yprintf '</FilesMatch>\n' >> /etc/httpd/conf/httpd.conf* H' h+ m( P; N0 b. d
printf '<FilesMatch ".phps$">\n' >> /etc/httpd/conf/httpd.conf" d7 \" V- U& |
printf '\tSetHandler application/x-httpd-php-source\n' >> /etc/httpd/conf/httpd.conf( l G2 M7 V- B. s; O
printf '</FilesMatch>\n' >> /etc/httpd/conf/httpd.conf6 o9 Q) |: E' p2 H
Configure FirewallArch 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 AccountYou'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 K- N+ v; T1 ^" k# S4 x- PWhen 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. h# l' D) o. |6 J! I m8 ?5 l- j$ h8 }( a* z7 {
Start Apache Web Serversystemctl start httpd.service
, v# q0 I' j4 Y7 E+ TStart Service / DaemonThis command starts Nagios Core. systemctl start nagios.service4 Z% M% v' v, L$ {1 @2 }1 {
Test NagiosNagios 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 d& x! J- t3 N6 v- g3 C
Installing The Nagios PluginsNagios 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. ) A, }) @7 o: |# u' [# e0 A
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: 6 n& s; k) s& j% @/ F
PrerequisitesMake 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
5 d7 k" ~& J& D$ BDownloading The Sourcecd /tmp
. h; S; M8 g8 p: S8 j& U* \1 Qwget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz
+ R) t. t! q) d! H, }tar zxf nagios-plugins.tar.gz4 S- P5 L X, j
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/# t( N, O" U1 F) ~
./tools/setup
! M) N8 H" ~, a; G./configure5 G. V, @: w0 ^/ R4 r9 [
make$ l( w. @7 ?. o% q. L
make install
* \" _' B) X, K, E) YTest PluginsPoint 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* r- E1 L+ C2 [0 f1 p: M
Service / Daemon CommandsDifferent Linux distributions have different methods of starting / stopping / restarting / status Nagios. systemctl start nagios.service8 {* K X0 g. g
systemctl stop nagios.service+ t, ]5 X7 M- M5 p9 {
systemctl status nagios.service ! y; j5 d' d. v/ _5 p
1 r/ \9 Y9 y' d5 t2 P# ~
4 U/ { S" C- Z1 XGentoo Security-Enhanced LinuxThis 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/configIf the file does not exist, SELinux is not enabled. ) d' l8 v9 K) H7 R0 _0 s
PrerequisitesPerform these steps to install the pre-requisite packages. emerge --sync
/ y; O& ~( K* q, Zmkdir -p /etc/portage/package.use
A+ Q; ]1 H6 @% ~% S9 Techo "www-servers/apache dir cgi cgid event prefork apache2_modules_version" >> /etc/portage/package.use/apache6 ^ P3 g( `4 t0 x! ^ f7 L4 g1 E
echo "dev-lang/php apache2" >> /etc/portage/package.use/php) j4 `5 C$ C) a8 J# t
echo "app-eselect/eselect-php apache2" >> /etc/portage/package.use/eselect-php
3 e3 A' ]7 h# l7 Hecho "media-libs/gd gd png jpeg" >> /etc/portage/package.use/gd# ~5 D) k% z8 Z( I: G
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 /tmp4 o4 X+ k9 W4 D$ i1 M, F2 R) Q) C
wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz, @) \ B3 r' _: k/ ?# u
tar xzf nagioscore.tar.gz
( f9 z- m+ n$ f0 }6 _Compilecd /tmp/nagioscore-nagios-4.4.0/( m' l: \6 c0 h9 a) @9 h0 R
./configure --with-httpd-conf=/etc/apache2/vhosts.d --sysconfdir=/usr/local/nagios/etc
( F# ?2 |+ d" j8 U, K1 @make all6 e( ?; M9 ?3 U" L, l! B, D
Create User And GroupThis creates the nagios user and group. The http user is also added to the nagios group. make install-groups-users
8 p) `6 Z1 M7 B- F# Dusermod -a -G nagios apache0 q% u" u, m' Z6 @7 o: A; A8 K; C
Install BinariesThis step installs the binary files, CGIs, and HTML files. make install
$ q# P+ v [0 D; SInstall Service / DaemonThis 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' i2 C7 O0 t0 `% S
rc-update add apache2 default
- T7 e. U8 N" d4 M# E===== systemd ===== make install-init; `) h2 S+ z1 d
systemctl enable apache2.service
" w4 V5 E" M5 K$ `, V" _Install Command ModeThis installs and configures the external command file. make install-commandmode
0 v) B: G$ }) lInstall Configuration FilesThis installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start. make install-config
- |* V$ O2 g* kInstall Apache Config FilesThis installs the Apache web server configuration files. make install-webconf) P2 `; o- N5 A/ _" o' c
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"6 i3 _( @8 R' ~
The /run/apache_ssl_mutex directory also needs to be created. % J3 p0 U( e( p) N
Execute the following commands to make the change described above: sed -i '/^APACHE2_OPTS=/s/\([^"]*\)"$/\1 '"-D PHP"'"/' /etc/conf.d/apache2
9 z# ~; G! A0 U% G1 \mkdir -p /run/apache_ssl_mutex8 o0 @- ^7 |6 Z- K: s
Configure FirewallGentoo 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 AccountYou'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: z. j' `: b% E1 n9 x
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 K9 N4 S9 u e, {2 {7 u
; U. H# v$ m' k8 |Retart Apache Web Server===== openrc ===== rc-service apache2 restart; }2 B1 ?7 d9 ~0 F8 J R6 n5 D/ k2 l
===== systemd ===== systemctl restart apache2.service
: e l" ]: b) ~5 VStart Service / DaemonThis command starts Nagios Core. ===== openrc ===== rc-service nagios start1 [& o. b7 d+ E% v9 P/ _3 t
===== systemd ===== systemctl start nagios.service8 y. K; D& |+ q2 o1 _
Test NagiosNagios 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.
4 z$ H- N, U3 k. YInstalling The Nagios PluginsNagios 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. . U" }; z. P* M9 W$ J# {# W9 I
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: ! }( ^: D, d4 V) \0 ^& [
PrerequisitesMake 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
- I' N+ D0 C0 f" p) o( h, CDownloading The Sourcecd /tmp
5 V" h. n0 Z) Y a# W$ i9 lwget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz( Y! r" Q. R; M/ R; b
tar zxf nagios-plugins.tar.gz8 t, P) x# g3 j' @: w
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/2 q' f8 u) {& z
./tools/setup7 _ {4 M/ W9 e { F8 _
./configure: M7 A# H- c6 x* U1 n* J
make" k- \* @) O& Q) K
make install
3 D, ^" ~, V9 f( V. l1 j Schmod u+s /bin/ping' H8 L# ?+ M: D% a) Q$ Y9 Z
chmod u+s /bin/ping6; {6 P7 F; P; z5 Q* E7 @
Test PluginsPoint 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 ]5 T: Y" X. b5 n
Service / Daemon CommandsThe different init systems have different methods of starting / stopping / restarting / status Nagios. ===== openrc ===== rc-service nagios start. k1 Q& J3 I+ I' [2 L9 l
rc-service nagios stop" M- @- Q2 Q; [% I& L8 p
rc-service nagios status
' F! E% s9 @& @4 Rrc-service nagios restart
% ?) W! ]$ L; ]/ n$ r===== systemd ===== systemctl start nagios.service ! {# c. [) b& H/ }. F5 [* c
systemctl stop nagios.service
2 g, Q# T; W1 Lsystemctl status nagios.service, e; w3 N0 t; j, U
systemctl restart nagios.service
& o! }3 M7 h5 g4 g& X% Z- o2 h' P/ f" O1 ^0 h& k
3 T6 }; r. _/ c7 E0 [, N+ j, |+ ]
FreeBSD Security-Enhanced LinuxThis 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/configIf the file does not exist, SELinux is not enabled. 4 l1 p4 L* r2 f) J. T& D+ g; ^/ j
PrerequisitesPerform 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 z/ B1 [. _ F, J- Vwget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz
' U/ m* U2 T# d9 T4 I4 ]tar xzf nagioscore.tar.gz* r$ `* s* A6 \ C
Compilecd /tmp/nagioscore-nagios-4.4.0/; @0 R# M+ f8 D$ w/ X
./configure --with-httpd-conf=/usr/local/etc/apache24/Includes0 k" E. h2 p6 a! P* r
gmake all+ P6 d) r# C/ A- T4 p9 K* j4 D
Create User And GroupThis creates the nagios user and group. The www user is also added to the nagios group. make install-groups-users! U+ ^4 r8 d$ K2 g* I
pw group mod nagios -m www. z# _$ H2 w6 m' @/ V5 v# ~) H
Install BinariesThis step installs the binary files, CGIs, and HTML files. gmake install
' D5 F N( a1 L: P1 B3 Bchown nagios:nagios /usr/local/nagios/bin/*8 M+ ^* k4 i. ~+ S
Install Service / DaemonThis installs the service or daemon files and also configures them to start on boot. gmake install-init' @7 U! b) w( O' J9 N" p
echo '/usr/local/etc/rc.d/nagios start' >> /etc/rc.local
7 s' n8 l1 U6 T+ GInformation on starting and stopping services will be explained further on. , _& a) L# a& k2 \: i
Install Command ModeThis installs and configures the external command file. gmake install-commandmode
( ?4 N# s; I: G0 }6 Z: rInstall Configuration FilesThis installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start. gmake install-config/ P% \4 l5 w, Y1 b3 v
Install Apache Config FilesThis installs the Apache web server configuration files. gmake install-webconf8 e1 e+ Y8 d7 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: <IfModule !mpm_prefork_module>
+ R1 c" K* d( K0 f) t #LoadModule cgid_module libexec/apache24/mod_cgid.so& T# l4 W$ F" `; l* z) i6 K' }
</IfModule>
: r! w8 X; t3 q. v4 c1 g<IfModule mpm_prefork_module> f# I2 a4 m6 t r h3 g) w7 t
#LoadModule cgi_module libexec/apache24/mod_cgi.so
3 e" @0 ]- P# x' S</IfModule>To this: <IfModule !mpm_prefork_module>' j6 w5 D+ H5 v, d0 s6 R
LoadModule cgid_module libexec/apache24/mod_cgid.so8 v- X- ^9 r$ c+ C1 ]) Z6 s
</IfModule>. {7 \4 }+ c) f/ R/ K
<IfModule mpm_prefork_module>- C3 n- B8 R# [! F; j! F8 p
LoadModule cgi_module libexec/apache24/mod_cgi.so& W0 }& p; u |# l, ^
</IfModule>6 n( @/ y A5 b8 N1 A/ z2 m
Change this: <IfModule dir_module>5 F$ N# O- G2 R$ V
DirectoryIndex index.html
' o% _- e" s \* H8 b# y) ^</IfModule>To this: <IfModule dir_module>
4 B! r3 Q H$ d' y DirectoryIndex index.php index.html index.htm AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps
7 ~% N( L2 M0 n% _ i</IfModule># M" i8 U$ G$ Y# u' Z, R; C- U
Add these lines to the end of the file: <FilesMatch ".php$">2 f; A) Y7 @9 p: ^
SetHandler application/x-httpd-php
% e' Z8 Z" n k) m7 D' U9 ?</FilesMatch>
7 m# I9 Y' V! ]' c$ s6 A* \0 J<FilesMatch ".phps$">
1 V: W/ X7 p! W, G SetHandler application/x-httpd-php-source
% I0 K; d* u7 S1 O$ P</FilesMatch>/ H7 R+ }! v+ F4 P7 L: a* V/ V
Execute the following commands to make the changes described above: cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
2 y4 S! s$ H. f* V4 A9 k6 \echo 'apache24_enable="YES"' >> /etc/rc.conf
+ t, z O2 o# a8 Zsed -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& P/ d' e; _$ v
sed -i '' 's/#LoadModule cgid_module/LoadModule cgid_module/g' /usr/local/etc/apache24/httpd.conf) Q( L6 k8 G/ l+ ?% @6 E. z1 ~
sed -i '' 's/#LoadModule cgi_module/LoadModule cgi_module/g' /usr/local/etc/apache24/httpd.conf
$ Z4 {' |' [& i9 E- ~4 c9 kprintf '\n<FilesMatch ".php$">\n' >> /usr/local/etc/apache24/httpd.conf! i4 b+ N! k0 _& N2 m- D. A
printf '\tSetHandler application/x-httpd-php\n' >> /usr/local/etc/apache24/httpd.conf9 s* w! ~9 {2 W5 @4 P( m" z
printf '</FilesMatch>\n' >> /usr/local/etc/apache24/httpd.conf
! Y; B9 l# N0 `% Q E: @printf '<FilesMatch ".phps$">\n' >> /usr/local/etc/apache24/httpd.conf
. x$ @. @. o% T+ E' O! ~printf '\tSetHandler application/x-httpd-php-source\n' >> /usr/local/etc/apache24/httpd.conf
8 c2 S; o; D/ l2 v1 R, ]5 h6 m$ kprintf '</FilesMatch>\n' >> /usr/local/etc/apache24/httpd.conf! k2 h, ~( f) ]% G: |9 w7 s1 g E
Configure FirewallPlease refer to the FreeBSD documentation for information on how to enable or configure IP Filter to allow TCP port 80 inbound. ( {% V4 V, b$ \4 u/ f3 Q( m T
' t4 m9 U) M+ ~0 }
Create nagiosadmin User AccountYou'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 nagiosadmin0 I& T$ C3 U" q, y7 K' r' Q
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 w3 B. p3 Q, d: j
0 @: z. u+ _6 v! Q9 E5 F; y
Start Apache Web Serverservice apache24 start
% u. ]1 R/ h! h4 g( p7 gStart Service / DaemonThis command starts Nagios Core. service nagios start
; O) G0 T& h& c) f; k$ uTest NagiosNagios 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 \" I8 I/ [2 p7 Z+ S+ p" H+ }
Installing The Nagios PluginsNagios 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. ( N" d y# B" O0 k5 _4 M) Y4 J
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:
1 `: Q4 K0 A3 T- QPrerequisitesMake 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
" t o5 X3 ~4 a. H+ NDownloading The Sourcecd /tmp
$ n* R$ @$ M' X* d* `9 ^+ bwget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz6 N, r, y+ ^3 b( \# h- o
tar zxf nagios-plugins.tar.gz
% e1 ?4 ?1 E# p$ K% o9 x0 S- |6 kCompile + Installcd /tmp/nagios-plugins-release-2.2.1/. R0 i# o- m, k3 b( f
./tools/setup
7 b# \1 I7 s( U2 r7 j./configure! V5 b( q0 u1 P0 b9 [# {& S
gmake
! ?; |& Z( ?8 {* X3 r6 U$ `8 lgmake install
, d- n+ E* i0 r0 ?" Z! Y% mTest PluginsPoint 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$ q2 r+ M2 ZService / Daemon CommandsDifferent Linux distributions have different methods of starting / stopping / restarting / status Nagios. service nagios start+ T0 K3 O: g3 ?2 j! e
service nagios stop: D8 O0 ], {; W% c i3 t* o
service nagios restart
# ]5 m7 j( ?0 N( zservice nagios status
. N% i1 u$ g, @* G- L* K, Y2 x9 |2 P6 s, ~. e2 X) J% i
. E$ v3 h. g- h+ LSolaris Tested with Solaris 11.
: u4 s- S% I* a* ~Security-Enhanced LinuxSELinux is not implemented in Solaris and hence is not an issue. PrerequisitesPerform these steps to install the pre-requisite packages. echo 'export PATH=$PATH:/opt/csw/bin:/usr/xpg4/bin:/usr/sfw/bin' >> ~/.profile
& e4 K z8 y9 l$ E" ]source ~/.profile, O' ?# f& ~0 ~/ N$ Q2 D
pkgadd -d http://get.opencsw.org/now
0 V q' O. z& r! f! }6 N8 canswer all
# ?# {$ j2 o) W/ ~answer y# \% l& e* ^3 v
perl -ni.bak -le 'print; print "mirror=http://mirrors.ibiblio.org/opencsw/stable" if /mirror=/' /etc/opt/csw/pkgutil.conf w9 x1 n( n" T; L
pkgutil -y -i autoconf automake unzip gd
, T q6 J/ F5 L" g+ m) wpkg install gcc-45 web/php-53 apache-php53 gd Downloading the Sourcecd /tmp$ s( w+ i" K: Z
wget -O nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz
, d: k& F* ]6 ?) f$ b4 w; btar xzf nagioscore.tar.gz* h r! F: J; g1 ~6 Y+ S
Compilecd /tmp/nagioscore-nagios-4.4.0/
) h( n4 S9 z+ C6 T% U4 T./configure --with-httpd-conf=/etc/apache2/2.2/conf.d --with-gd-inc=/usr/include/gd2
; n2 S3 r# m8 p O6 g. _gmake all S7 r+ Q2 {4 F' H( v1 J
Create User And GroupThis creates the nagios user and group. The webservd user is also added to the nagios group. gmake install-groups-users
x y2 Z) i, Cusermod -G nagios webservd
. z3 a" h4 D" ZInstall BinariesThis step installs the binary files, CGIs, and HTML files. gmake install0 P2 C+ h- d: e n7 Q& v
Install Service / DaemonThis 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
. M# m; [1 K$ V, U6 qsvcbundle -o /lib/svc/manifest/site/nagios.xml -s service-name=application/nagios -s rc-script=/etc/init.d/nagios:2 -s model=contract
7 a9 Z# S/ A) {6 m; c: x' G- `Information on starting and stopping services will be explained further on.
7 b, P6 e4 u1 _- I R# N) KInstall Command ModeThis installs and configures the external command file. gmake install-commandmode! j5 P! L5 m9 K& G: D& f8 Q
Install Configuration FilesThis installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start. gmake install-config
+ s' `5 f' g& G2 @, _1 |, qInstall Apache Config FilesThis installs the Apache web server configuration files. Also configure Apache settings if required. gmake install-webconf
3 E3 d! U4 R; P# K) SConfigure FirewallOn 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. + q( A+ c* v: Z# @* k6 B. d' u7 r
Create nagiosadmin User AccountYou'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
: F0 ~! D, ~6 y6 F# DWhen 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).
9 L3 h. h+ T. J' I! e9 S" @
$ N. `$ j$ |, u `6 j( b, eStart Apache Web Serversvcadm enable apache225 N1 I, h2 p4 [1 m' g
Start Service / DaemonThis command starts Nagios Core. svcadm restart manifest-import% p) S6 z) E5 o" i3 J- H
svcadm enable nagios
5 z3 T" v# Y5 F1 \$ qTest NagiosNagios 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.
v# c5 k2 \: o4 x8 a8 w' _( Y: o9 DInstalling The Nagios PluginsNagios 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. 0 ^5 o! g; \+ o) \8 E# X! W
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:
- \8 {) v2 h8 U! a- u; SPrerequisitesAlready completed as part of the Nagios installation. Some of the plugins require the NET::SNMP perl module. Please refer to the following documentation: " Q3 v% g5 t- {- z2 J
Downloading The Sourcecd /tmp' f! s9 B5 C/ y4 i& w* F7 s
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugin ... elease-2.2.1.tar.gz+ O8 ?) C* h) i
tar zxf nagios-plugins.tar.gz$ z* i5 t G, c8 w( H% I: q/ p( F% v- ], l
Compile + Installcd /tmp/nagios-plugins-release-2.2.1/5 w' i. Z5 K( G0 ?- n% Y: z: C! F; n
./tools/setup/ P3 ], [# i7 r- l
./configure
0 T( O2 K% A. m8 j. U3 @% S- K6 _gmake( B& w) M# U& k( }) u
gmake install
4 F0 i6 I6 \+ X! ~Test PluginsPoint 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.
! \* ?# ^. V4 a+ L. k. J# HService / Daemon CommandsThese commands are for starting / stopping / restarting / status Nagios. svcadm enable nagios
( f& u3 ?- e( m0 jsvcadm disable nagios8 p8 _! I; I$ O
svcadm restart nagios) F! h& I5 y9 u9 Z' \& L3 \
svcs nagios
/ i3 f& h: d( W; q& i. Jsvcs -xv nagios$ f7 e0 \6 c8 N& w7 l* k1 x
svcadm clear nagios
* c9 p# }1 a1 k+ m" ^- \$ o. W/ f9 IThe following KB article has important information on Solaris and services:
. `( ?: @0 F+ P) p9 q
- ?% N9 q: _' b/ [; j- h' [; o/ n
Apple OS X Security-Enhanced LinuxSELinux is not implemented in Apple OS X and hence is not an issue.
) {: f7 l2 j( c8 }6 T+ I, cPrerequisitesFirst, 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
2 X% Q6 |8 F6 I. D4 E# T: mView the agreement and then type agree
$ u# \! r5 H1 zsudo xcode-select --installYou 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% A5 P2 d% v% P& ?3 I+ ^, o O
Downloading the Sourcecd /tmp
5 k8 y$ W' o8 }* wcurl -L -o nagioscore.tar.gz https://github.com/NagiosEnterpr ... nagios-4.4.0.tar.gz) ~1 `, H* O- H- F$ W4 `1 u
tar xzf nagioscore.tar.gz% `8 x0 _; N+ \) x
Compilecd /tmp/nagioscore-nagios-4.4.0/
" `5 k* U4 i# T; @ W% y% C2 isudo ./configure --with-httpd-conf=/opt/local/apache2/conf/extra --with-gd-lib=/opt/local/lib --with-gd-inc=/opt/local/include
$ E3 M' ~4 ~& {4 a, y, @sudo make all
1 ?) x/ e$ T( Z) k- M# ]Create User And GroupCurrently 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
, _3 J% B0 P/ s9 Z1 F; m2 ~sudo dseditgroup -o edit -a _www -t user nagios. `5 e% _- h# C* @
Install BinariesThis step installs the binary files, CGIs, and HTML files. sudo make install
6 ]# y' s0 `8 T9 aInstall Service / DaemonThis 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
1 B, H4 F5 G6 ?1 O5 c- x- m0 t: mYou 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.plistThis 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"?>6 w9 G! o! v, H3 E6 u8 u& M0 t
<!DOCTYPE plist PUBLIC "-//Apple/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">0 V" ]5 @# {$ T% I/ C Z" f6 z
<plist version="1.0">8 G% c1 R7 R5 I* h6 m
<dict>
1 G/ u' f- O# v9 m <key>Label</key>
# b! ]0 w7 G4 K5 v8 H <string>org.nagios.nagios</string>; X# v4 X; g7 U6 c. E' z0 L; w
<key>UserName</key>
+ [/ [" a2 b1 c+ T2 Y <string>nagios</string>* x2 D+ q: C5 A0 V
<key>GroupName</key>
! l- b4 j' {" N/ ]9 G) R <string>nagios</string>" d1 e1 q' |) n$ [) t
<key>Program</key>
) Z- U% e9 X) _9 a <string>/etc/rc.d/init.d/nagios</string>2 }/ X3 I. }" ^2 }$ u
<key>ProgramArguments</key>
J! Q2 C2 X! `7 ]9 ^3 J <array>
% {" r9 }4 P9 R9 @4 P V, ^ <string>nagios</string>
! J6 P5 z( r: w3 E* d <string>start</string>9 a- D' G& D4 A; G7 ^' g/ M
</array>2 H- l6 w* m9 U- {- T' {, p& v
<key>KeepAlive</key>+ i# M6 ^" j; ?8 f/ B! r$ Z
<dict>3 f: g- N/ v p% R/ I
<key>SuccessfulExit</key>8 O* u$ \8 M r1 N6 |3 L3 D% @ Q
<false/>$ V7 U% F7 O( Y0 l3 e+ ^5 e- a& K
<key>NetworkState</key>. c+ }9 C' W; `
<true/>
) n( N u' P* g6 |7 p/ q- P8 o) c </dict>
# u; p4 a; L$ }& |( v$ q <key>RunAtLoad</key>: L( X7 a1 }6 |* H
<true/>
2 r0 p) \ q6 T& Z4 q) Q! v <key>ProcessType</key>
0 z3 Q! a4 t5 M. x" r" R <string>Background</string>
& k) p/ K0 y$ p! l1 Z! c</dict>
9 g( r5 D# y! I, |$ S0 E' n</plist>
# ]- l: E) T. G( t5 ^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. 5 C7 {, R' n" g4 C7 q2 q. u
Information on starting and stopping services will be explained further on. # g" p+ O/ ?2 v+ Z! x* [8 t3 M. t
Install Command ModeThis installs and configures the external command file. sudo make install-commandmode
" G, S- _! c7 p9 @, t' x% `& [, r# c# mInstall Configuration FilesThis installs the *SAMPLE* configuration files. These are required as Nagios needs some configuration files to allow it to start. sudo make install-config: ]9 ]' P) [; m J, D% q
Install Apache Config FilesThis installs the Apache web server configuration files. sudo make install-webconf1 j$ Y9 n# {# i5 u1 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>- M3 ]0 f8 u7 ^7 E, X
DirectoryIndex index.html
' v' W3 a" z. U) Y- P* {2 d</IfModule>To this: <IfModule dir_module>. `8 G, d) H7 E' [; G; R; k
DirectoryIndex index.php index.html index.htm AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps; @; f4 d1 v& y; @
</IfModule>
% F# `5 g5 b2 d( |5 ?7 D! t7 J( fAdd these lines to the end of the file: Include conf/extra/nagios.conf
D/ q5 M$ D! E5 o. ~7 ^9 LInclude conf/extra/mod_php70.conf3 o0 v! h6 _) j9 K
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
; U# \" \3 V* e& t/ m( ]4 q& dcd /opt/local/apache2/modules/; ^5 T! G. f5 g% O3 r
sudo /opt/local/apache2/bin/apxs -a -e -n php7 mod_php70.so
1 m7 B. Z R( k2 I1 `: W! Pprintf '\nInclude conf/extra/nagios.conf\n' | sudo tee -a /opt/local/apache2/conf/httpd.conf7 }% F$ q" B# G
printf '\nInclude conf/extra/mod_php70.conf\n' | sudo tee -a /opt/local/apache2/conf/httpd.conf* w% Q; Z8 m, n
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# R; Y; }' c* N5 e/ C
Configure FirewallThe 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. & q7 O( ^+ n$ H' h; Z% H0 `+ _
Create nagiosadmin User AccountYou'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% ^5 \. M1 I \+ ~
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).
1 Q* A: L8 a$ Q, d8 a. N
8 m1 s, x& W; S0 W( p8 F5 y' r/ xStart Apache Web Serversudo /opt/local/bin/port load apache2, a3 b2 r5 T. S7 R- V/ G
Start Service / DaemonThis command starts Nagios Core. sudo /etc/rc.d/init.d/nagios start
% K- h) |6 U, Q& ATest NagiosNagios 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 z* i0 H8 g% X1 E. F& ^
Installing The Nagios PluginsNagios 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
0 W' j9 F4 Y1 B4 c/ t* f% c! Hsudo sed -i '' 's/\/usr\/local\/nagios\/libexec/\/opt\/local\/libexec\/nagios/g' /usr/local/nagios/etc/resource.cfg
/ X" J# i9 l$ s( N( I! K. Tsudo /etc/rc.d/init.d/nagios stop- Y G' |7 l, _8 |! l% ^
sudo /etc/rc.d/init.d/nagios start
/ m- {( E( i8 ] U4 w6 s) ZTest PluginsPoint 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 I# n' Q# s8 v# C- T6 r- M0 j
Service / Daemon CommandsThese commands are for starting / stopping / restarting / status Nagios. sudo /etc/rc.d/init.d/nagios start
# x1 l: J" J4 O5 F, ]$ ^! t- `sudo /etc/rc.d/init.d/nagios stop
! [& Q0 b: {- w$ p' u3 vsudo /etc/rc.d/init.d/nagios restart
. y* |% E5 A% ~/ a2 _/ U5 {sudo /etc/rc.d/init.d/nagios status
0 Z6 F& W2 s$ j' a
8 T" {. f* n5 |- f
. h# D: o7 x4 u4 v& z
1 ~$ l6 t8 s0 k( p5 _Final Thoughts[url=]http://support.nagios.com/forum/[/url]
3 R, w6 C9 m4 K# i7 D: G S( Y |