Compare commits

..

52 commits

Author SHA1 Message Date
Fedora Release Engineering
8d93daf301 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-24 22:36:36 +00:00
Guido Aulisi
fe349bea3e Update to 4.5.9 2025-05-13 20:55:53 +02:00
Zbigniew Jędrzejewski-Szmek
ffcb5f8a4f Add sysusers.d config file to allow rpm to create users/groups automatically
See https://fedoraproject.org/wiki/Changes/RPMSuportForSystemdSysusers.
2025-02-11 15:53:23 +01:00
Fedora Release Engineering
a7612acc88 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-17 19:38:58 +00:00
Miroslav Suchý
e0262c10ac convert GPLv2 license to SPDX
This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4
2024-07-29 11:27:11 +02:00
Fedora Release Engineering
6a1fa55ad7 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-18 19:07:16 +00:00
Guido Aulisi
8182a4d5ba Fix permissions (#2275532) 2024-04-27 22:46:12 +02:00
Fedora Release Engineering
258ce4a8a7 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-25 08:34:52 +00:00
Fedora Release Engineering
b884bb7c4b Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-21 09:09:57 +00:00
Guido Aulisi
17bb18eadb Update to 4.4.14 2023-08-16 13:16:04 +02:00
Fedora Release Engineering
01bd89cf42 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-20 16:15:48 +00:00
Guido Aulisi
0d310e03a8 Update to 4.4.10
Fix nagiostats permissions #2169033
2023-02-13 16:10:54 +01:00
Fedora Release Engineering
7b7fe58113 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 21:11:55 +00:00
Jitka Plesnikova
4bc39f64db Remove perl(MODULE_COMPAT), it will be replaced by generators 2023-01-13 09:49:58 +01:00
Florian Weimer
ecad3c5b17 Port configure script to C99
Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
2022-12-10 09:34:26 +01:00
Guido Aulisi
1eceb3fafa Update to 4.4.9 2022-11-17 12:10:04 +01:00
Nikola Knazekova
2be4ff8478 selinux: Update based on latest packaging guide
https://fedoraproject.org/wiki/SELinux/IndependentPolicy

Start shipping nagios interface file
Exclude installed policy module file from RPM verification

Signed-off-by: Nikola Knazekova <nknazeko@redhat.com>
2022-11-16 23:08:26 +00:00
Guido Aulisi
e510354fc1 Update to 4.4.8 2022-10-23 11:53:21 +02:00
Guido Aulisi
db9c91f4b2 Update to 4.4.7 2022-09-25 12:28:07 +02:00
Fedora Release Engineering
0ca22398d8 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-22 00:11:38 +00:00
Jitka Plesnikova
d8c8d224c6 Perl 5.36 rebuild 2022-06-01 10:34:01 +02:00
Fedora Release Engineering
ec9b36653d - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 20:51:03 +00:00
Guido Aulisi
a120f1b733 Bootstrap package correctly 2022-01-04 12:25:57 +01:00
Guido Aulisi
57ae9b0776 Require a generic mail program (#2036844) 2022-01-04 12:08:22 +01:00
Fedora Release Engineering
53d79d5a3e - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-22 15:48:04 +00:00
Jitka Plesnikova
e5f28a1e6d Perl 5.34 rebuild 2021-05-21 21:55:14 +02:00
Vit Mojzis
78ac89991b selinux: Fix issues reported by SELint
- sort permissions alphabetically
2021-03-23 15:17:28 +00:00
Vit Mojzis
80f8acdcd9 tests: Add decentralized SELinux policy test
- Test for unsound/dangerous SELinux policy practices
- Perform static policy code check using SELint

For more details and debugging tips see
https://fedoraproject.org/wiki/SELinux/IndependentPolicy#Testing
2021-03-23 15:17:28 +00:00
nknazeko
5a42318ffb ifndef sssd_signull block
Add interface sssd_signull from sssd policy module into an ifndef block
because it is not present in epel distribution policy.
2021-03-18 13:17:55 +00:00
Nikola Knazekova
198c2b0aeb Remove circular dependency
Remove 'Requires: %{name} = %{version}-%{release}' from SELinux subpackage.

Nagios-SELinux can be required by other packages without base Nagios package.
This can happen, when other policy modules are using interfaces defined in Nagios SELinux policy.
2021-03-16 15:22:36 +01:00
Zbigniew Jędrzejewski-Szmek
212673ea1e Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.
2021-03-02 16:13:25 +01:00
Guido Aulisi
8fcbae50dd Fix run path 2021-02-28 11:14:49 +01:00
Guido Aulisi
c5207d1ef2 Add missing require for nagios-plugins-ping 2021-02-28 11:13:59 +01:00
Guido Aulisi
294e23595a Require plugins needed for localhost monitoring (#1932297)
Remove mistakenly readded patch for conf.d
2021-02-27 18:54:56 +01:00
Guido Aulisi
c8c4e23495 Fix systemd unit file permissions #1676334 2021-02-27 18:44:58 +01:00
Guido Aulisi
61e247242c Update to 4.4.6
Fix for CVE-2020-13977 #BZ1849087
Some spec cleanup
2021-02-20 23:50:47 +01:00
Fedora Release Engineering
bb2160d495 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 21:12:37 +00:00
Tom Stellard
2ebf19920b Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2021-01-07 02:14:03 +00:00
Fedora Release Engineering
3354790fe0 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-28 08:49:55 +00:00
Jitka Plesnikova
d01ca16f6d Perl 5.32 rebuild 2020-06-23 11:07:22 +02:00
Martin Jackson
94927f2845 Correct parenthesized deps 2020-04-07 11:14:35 -05:00
Martin Jackson
04c906b821 Remove parens from selinux requires 2020-03-02 23:29:15 -06:00
Martin Jackson
b9411f29a2 Update specfile 2020-03-02 22:58:55 -06:00
Martin Jackson
2dca4ac09e Apply patch from new PR 2020-03-02 22:57:33 -06:00
Martin Jackson
4cfb87930a Remove with_selinux flags after endifs 2020-03-01 17:51:09 -06:00
Martin Jackson
10ba2039fb Update selinux subpackage to fix BZ#1749156 - thanks for the patch vmojzis 2020-02-26 18:20:05 -06:00
Vit Mojzis
1fa79c4c77 selinux: set file context for /etc/nrpe.d folder
Fixes:
   https://bugzilla.redhat.com/show_bug.cgi?id=1749156
2020-02-26 10:41:55 +01:00
Vit Mojzis
460ff9c51f Update nagios-selinux
Update nagios-selinux subpackage based on Decentrailized SELinux policy
project guidelines
https://fedoraproject.org/wiki/SELinux/IndependentPolicy
and enable it for Fedora.

Lines concerning older rhel where removed in order to simplify the spec
file.

Distribution nagios policy (rawhide version) was merged with the
additional rules that where shipped in nagios_epel policy module.
The resulting policy module will override the distribution policy when
the nagios-selinux package is installed.
2020-02-26 10:41:22 +01:00
Stephen Smoogen
06f08ea402 Add change to allow for problems found in mass rebuild and gcc10.
Fix BZ#1793909
2020-02-18 15:35:22 +00:00
Fedora Release Engineering
aef6df418c - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-29 14:34:11 +00:00
Stephen Smoogen
b48f1a1e3d remove nagios-socket.te as it is not used 2019-08-29 18:51:38 +00:00
Stephen Smoogen
7837f4d4ab Move to 4.4.5
Updated patches to cleanly patch
2019-08-29 18:40:12 +00:00
36 changed files with 3580 additions and 1 deletions

25
.gitignore vendored Normal file
View file

@ -0,0 +1,25 @@
nagios-3.2.1.tar.gz
/nagios-3.2.2.tar.gz
/nagios-3.2.3.tar.gz
/nagios-3.3.1.tar.gz
/nagios-3.4.1.tar.gz
/nagios-3.4.2.tar.gz
/nagios-3.4.3.tar.gz
/nagios-3.4.4.tar.gz
/nagios-3.5.0.tar.gz
/nagios-3.5.1.tar.gz
/nagios-4.0.8.tar.gz
/nagioscore-release-4.2.4.tar.gz
/nagioscore-nagios-4.3.1.tar.gz
/nagioscore-nagios-4.3.2.tar.gz
/nagioscore-nagios-4.3.4.tar.gz
/nagioscore-nagios-4.4.2.tar.gz
/nagioscore-nagios-4.4.3.tar.gz
/nagioscore-nagios-4.4.5.tar.gz
/nagioscore-nagios-4.4.6.tar.gz
/nagioscore-nagios-4.4.7.tar.gz
/nagioscore-nagios-4.4.8.tar.gz
/nagioscore-nagios-4.4.9.tar.gz
/nagioscore-nagios-4.4.10.tar.gz
/nagioscore-nagios-4.4.14.tar.gz
/nagioscore-nagios-4.5.9.tar.gz

View file

@ -1 +0,0 @@
epel8-playground decommissioned : https://pagure.io/epel/issue/136

View file

@ -0,0 +1,88 @@
diff -up ./startup/default-init.in.fix_el6_init ./startup/default-init.in
--- ./startup/default-init.in.fix_el6_init 2019-01-15 09:58:00.000000000 -0500
+++ ./startup/default-init.in 2019-02-05 09:38:09.463144849 -0500
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# chkconfig: 345 99 01
+# chkconfig: - 99 01
# description: Nagios network monitor
# processname: nagios
# File : nagios
@@ -24,6 +24,9 @@
# - Clean out redhat macros and other dependencies
# 2003-01-11 Ethan Galstad <egalstad@nagios.org>
# - Updated su syntax (Gary Miller)
+# 2018-11-28 Justin Paulsen <petaris@gmail.com>
+# - Patched for EPEL release of Nagioscore 4.4.2
+# - - nagios-0001-default-init.patch
#
# Description: Starts and stops the Nagios monitor
# used to provide network services status.
@@ -91,12 +94,12 @@ check_config ()
echo "ERROR: Could not delete '$NagiosCfgtestFile'"
exit 8
fi
- if ! su $NagiosUser -c "touch $NagiosCfgtestFile"; then
+ if ! su $NagiosUser -c "touch $NagiosCfgtestFile" -s /bin/sh ; then
echo "ERROR: Could not create or update '$NagiosCfgtestFile'"
exit 8
fi
- TMPFILE=$(mktemp /tmp/.configtest.XXXXXXXX)
+ TMPFILE=$(mktemp $NagiosCfgtestFile.XXX)
$NagiosBin -vp $NagiosCfgFile > "$TMPFILE"
WARN=`grep ^"Total Warnings:" "$TMPFILE" |awk -F: '{print \$2}' |sed s/' '//g`
ERR=`grep ^"Total Errors:" "$TMPFILE" |awk -F: '{print \$2}' |sed s/' '//g`
@@ -138,11 +141,14 @@ status_nagios ()
printstatus_nagios ()
{
- if status_nagios; then
+ status_nagios $1 $2
+ RETVAL=$?
+ if [ $RETVAL = 0 ]; then
echo "nagios (pid $NagiosPID) is running..."
else
echo "nagios is not running"
fi
+ return $RETVAL
}
killproc_nagios ()
@@ -157,7 +163,17 @@ pid_nagios ()
return 1
fi
- NagiosPID=`head -n 1 $NagiosRunFile`
+ export NagiosPID=`head -n 1 $NagiosRunFile`
+ if [[ -z "$NagiosPID" ]]; then
+ echo "No usable PID found in $NagiosRunFile"
+ exit 1
+ fi
+
+ regex='^[0-9]+$'
+ if ! [[ $NagiosPID =~ $regex ]]; then
+ echo "PID not number found in $NagiosRunFile"
+ exit 1
+ fi
}
# Check that nagios exists.
@@ -188,7 +204,7 @@ case "$1" in
fi
fi
- su $NagiosUser -c "touch $NagiosVarDir/nagios.log $NagiosRetentionFile"
+ su $NagiosUser -c "touch $NagiosVarDir/nagios.log $NagiosRetentionFile" -s /bin/sh
@BIN_RM@ -f $NagiosCommandFile
touch $NagiosRunFile
$NagiosBin -d $NagiosCfgFile
@@ -281,6 +297,7 @@ case "$1" in
*)
echo "Usage: nagios {start|stop|restart|reload|force-reload|status|checkconfig|configtest}"
exit 1
+ exit 2
;;
esac

View file

@ -0,0 +1,11 @@
diff -up ./Makefile.in.fix_httpd_conf_d ./Makefile.in
--- ./Makefile.in.fix_httpd_conf_d 2018-11-28 12:36:22.206486501 -0600
+++ ./Makefile.in 2018-11-28 12:37:26.098414877 -0600
@@ -337,6 +337,7 @@ install-groups-users:
@autoconf-macros/add_group_user $(DIST) $(NAGIOS_USER) $(NAGIOS_GRP) 1
install-webconf:
+ $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(HTTPD_CONF)
$(INSTALL) -m 644 sample-config/httpd.conf $(DESTDIR)$(HTTPD_CONF)/nagios.conf
if [ $(LN_HTTPD_SITES_ENABLED) -eq 1 ]; then \
$(LN_S) $(DESTDIR)$(HTTPD_CONF)/nagios.conf $(DESTDIR)/etc/apache2/sites-enabled/nagios.conf; \

View file

@ -0,0 +1,13 @@
diff --git a/Makefile.in b/Makefile.in
index b992ab1e..ef2a797f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -439,7 +439,7 @@ dox:
doxygen doxy.conf
-fullinstall: install install-init install-commandmode install-webconf install-devel
+fullinstall: install install-init install-commandmode install-webconf install-devel install-config
# Uninstall is too destructive if base install directory is /usr, etc.
#uninstall:

View file

@ -0,0 +1,50 @@
From 3bdd7e40e1c7e7484edcb53b01ef3cd446305466 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Mon, 15 Nov 2010 15:07:49 +0300
Subject: [PATCH 08/12] Fix path to CGI executables
See rhbz #653291 for additional details:
https://bugzilla.redhat.com/653291
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
Modified for 4.0.8 - Scott Wilkerson <swilkerson@nagios.com>
---
sample-config/httpd.conf.in | 4 ++--
subst.in | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/sample-config/httpd.conf.in b/sample-config/httpd.conf.in
index 71d4fbb..1b1e693 100644
--- a/sample-config/httpd.conf.in
+++ b/sample-config/httpd.conf.in
@@ -5,9 +5,9 @@
# configuration file. Customize the paths, etc. as
# needed to fit your system.
-ScriptAlias @cgiurl@ "@sbindir@"
+ScriptAlias @cgiurl@ "@cgidir@"
-<Directory "@sbindir@">
+<Directory "@cgidir@">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
diff --git a/subst.in b/subst.in
index a8e2c06..bbffb3a 100755
--- a/subst.in
+++ b/subst.in
@@ -35,6 +35,7 @@ while ($f = shift @ARGV) {
s|\@datarootdir\@|@datarootdir@|g;
s|\@sbindir\@|@sbindir@|g;
s|\@bindir\@|@bindir@|g;
+ s|\@cgidir\@|@libdir@/cgi-bin/|g;
s|\@htmurl\@|@htmurl@|g;
s|\@cgiurl\@|@cgiurl@|g;
s|\@MAIL_PROG\@|@MAIL_PROG@|g;
--
1.8.3.1

View file

@ -0,0 +1,39 @@
diff -up ./sample-config/httpd.conf.in.fix_path_to_passwd ./sample-config/httpd.conf.in
--- ./sample-config/httpd.conf.in.fix_path_to_passwd 2016-10-24 10:10:28.000000000 -0400
+++ ./sample-config/httpd.conf.in 2016-11-08 14:37:02.117929826 -0500
@@ -18,7 +18,7 @@ ScriptAlias @cgiurl@ "@sbindir@"
AuthName "Nagios Access"
AuthType Basic
- AuthUserFile @sysconfdir@/htpasswd.users
+ AuthUserFile @sysconfdir@/passwd
Require valid-user
</RequireAll>
</IfVersion>
@@ -31,7 +31,7 @@ ScriptAlias @cgiurl@ "@sbindir@"
AuthName "Nagios Access"
AuthType Basic
- AuthUserFile @sysconfdir@/htpasswd.users
+ AuthUserFile @sysconfdir@/passwd
Require valid-user
</IfVersion>
</Directory>
@@ -49,7 +49,7 @@ Alias @htmurl@ "@datadir@"
AuthName "Nagios Access"
AuthType Basic
- AuthUserFile @sysconfdir@/htpasswd.users
+ AuthUserFile @sysconfdir@/passwd
Require valid-user
</RequireAll>
</IfVersion>
@@ -62,7 +62,7 @@ Alias @htmurl@ "@datadir@"
AuthName "Nagios Access"
AuthType Basic
- AuthUserFile @sysconfdir@/htpasswd.users
+ AuthUserFile @sysconfdir@/passwd
Require valid-user
</IfVersion>
</Directory>

View file

@ -0,0 +1,29 @@
diff -up ./sample-config/template-object/templates.cfg.in.more_images ./sample-config/template-object/templates.cfg.in
--- ./sample-config/template-object/templates.cfg.in.more_images 2018-11-28 13:10:25.822264939 -0600
+++ ./sample-config/template-object/templates.cfg.in 2018-11-28 13:16:15.711410141 -0600
@@ -123,6 +123,7 @@ define host {
notification_interval 30 ; Resend notifications every 30 minutes
notification_options d,r ; Only send notifications for specific host states
contact_groups admins ; Notifications get sent to the admins by default
+ statusmap_image printer.png
register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE
}
@@ -142,9 +143,17 @@ define host {
notification_interval 30 ; Resend notifications every 30 minutes
notification_options d,r ; Only send notifications for specific host states
contact_groups admins ; Notifications get sent to the admins by default
+ statusmap_image switch.png
register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE
}
+# Define a template for routers that we can reuse
+define host{
+ name generic-router ; The name of this host template
+ use generic-switch ; Inherit default values from the generic-host template
+ statusmap_image router.png
+ register 0 ; DONT REGISTER THIS - ITS JUST A TEMPLATE
+}
###############################################################################

View file

@ -0,0 +1,12 @@
diff -up ./sample-config/nagios.cfg.in.conf_d ./sample-config/nagios.cfg.in
--- ./sample-config/nagios.cfg.in.conf_d 2017-08-24 17:43:48.000000000 -0400
+++ ./sample-config/nagios.cfg.in 2017-09-15 18:29:48.659666387 -0400
@@ -53,6 +53,8 @@ cfg_file=@sysconfdir@/objects/localhost.
#cfg_dir=@sysconfdir@/switches
#cfg_dir=@sysconfdir@/routers
+cfg_dir=@sysconfdir@/conf.d
+

View file

@ -0,0 +1,281 @@
diff -up ./base/Makefile.in.fix_localstatedir ./base/Makefile.in
--- ./base/Makefile.in.fix_localstatedir 2019-01-16 13:29:13.079040249 -0600
+++ ./base/Makefile.in 2019-01-16 13:32:54.103372583 -0600
@@ -33,7 +33,7 @@ LIBS=@LIBS@
prefix=@prefix@
exec_prefix=@exec_prefix@
-LOGDIR=@localstatedir@
+LOGDIR=@localstatedir@/log/nagios/
CFGDIR=@sysconfdir@
BINDIR=@bindir@
CGIDIR=@cgibindir@
diff -up ./cgi/Makefile.in.fix_localstatedir ./cgi/Makefile.in
--- ./cgi/Makefile.in.fix_localstatedir 2019-01-16 13:33:14.596032529 -0600
+++ ./cgi/Makefile.in 2019-01-16 13:33:35.252689754 -0600
@@ -12,7 +12,7 @@ SRC_LIB=../lib
prefix=@prefix@
exec_prefix=@exec_prefix@
-LOGDIR=@localstatedir@
+LOGDIR=@localstatedir@/log/nagios/
CFGDIR=@sysconfdir@
BINDIR=@bindir@
CGIDIR=@cgibindir@
diff -up ./common/Makefile.in.fix_localstatedir ./common/Makefile.in
--- ./common/Makefile.in.fix_localstatedir 2019-01-16 13:33:51.236424521 -0600
+++ ./common/Makefile.in 2019-01-16 13:34:17.928981586 -0600
@@ -13,7 +13,7 @@ LDFLAGS=@LDFLAGS@ @LIBS@
prefix=@prefix@
exec_prefix=@exec_prefix@
-LOGDIR=@localstatedir@
+LOGDIR=@localstatedir@/log/nagios/
CFGDIR=@sysconfdir@
BINDIR=@bindir@
CGIDIR=@cgibindir@
diff -up ./html/config.inc.php.in.fix_localstatedir ./html/config.inc.php.in
--- ./html/config.inc.php.in.fix_localstatedir 2019-01-16 13:35:06.875169375 -0600
+++ ./html/config.inc.php.in 2019-01-16 14:25:51.436714786 -0600
@@ -9,8 +9,8 @@ $cfg['cgi_base_url']='@cgiurl@';
// FILE LOCATION DEFAULTS
$cfg['main_config_file']='@sysconfdir@/nagios.cfg'; // default location of the main Nagios config file
-$cfg['status_file']='@localstatedir@/status.dat'; // default location of Nagios status file
-$cfg['state_retention_file']='@localstatedir@/retention.dat'; // default location of Nagios retention file
+$cfg['status_file']='@localstatedir@/spool/nagios/status.dat'; // default location of Nagios status file
+$cfg['state_retention_file']='@localstatedir@/spool/nagios/retention.dat'; // default location of Nagios retention file
diff -up ./html/Makefile.in.fix_localstatedir ./html/Makefile.in
--- ./html/Makefile.in.fix_localstatedir 2019-01-16 13:37:18.936977949 -0600
+++ ./html/Makefile.in 2019-01-16 13:37:36.645684091 -0600
@@ -4,7 +4,7 @@ LDFLAGS=@LDFLAGS@ @LIBS@
prefix=@prefix@
exec_prefix=@exec_prefix@
-LOGDIR=@localstatedir@
+LOGDIR=@localstatedir@/log/nagios/
CFGDIR=@sysconfdir@
BINDIR=@bindir@
CGIDIR=@cgibindir@
diff -up ./include/locations.h.in.fix_localstatedir ./include/locations.h.in
--- ./include/locations.h.in.fix_localstatedir 2019-01-16 13:38:02.700251743 -0600
+++ ./include/locations.h.in 2019-01-16 14:36:54.105757936 -0600
@@ -17,18 +17,18 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
************************************************************************/
-#define DEFAULT_TEMP_FILE "@localstatedir@/tempfile"
+#define DEFAULT_TEMP_FILE "@localstatedir@/spool/nagios/tempfile"
#define DEFAULT_TEMP_PATH "/tmp"
-#define DEFAULT_CHECK_RESULT_PATH "@localstatedir@/spool/checkresults"
-#define DEFAULT_STATUS_FILE "@localstatedir@/status.dat"
-#define DEFAULT_LOG_FILE "@localstatedir@/nagios.log"
-#define DEFAULT_LOG_ARCHIVE_PATH "@localstatedir@/archives/"
-#define DEFAULT_DEBUG_FILE "@localstatedir@/nagios.debug"
-#define DEFAULT_COMMENT_FILE "@localstatedir@/comments.dat"
-#define DEFAULT_DOWNTIME_FILE "@localstatedir@/downtime.dat"
-#define DEFAULT_RETENTION_FILE "@localstatedir@/retention.dat"
-#define DEFAULT_COMMAND_FILE "@localstatedir@/rw/nagios.cmd"
-#define DEFAULT_QUERY_SOCKET "@localstatedir@/rw/nagios.qh"
+#define DEFAULT_CHECK_RESULT_PATH "@localstatedir@/spool/nagios/checkresults"
+#define DEFAULT_STATUS_FILE "@localstatedir@/spool/nagios/status.dat"
+#define DEFAULT_LOG_FILE "@localstatedir@/log/nagios/nagios.log"
+#define DEFAULT_LOG_ARCHIVE_PATH "@localstatedir@/log/nagios/archives/"
+#define DEFAULT_DEBUG_FILE "@localstatedir@/log/nagios/nagios.debug"
+#define DEFAULT_COMMENT_FILE "@localstatedir@/spool/nagios/comments.dat"
+#define DEFAULT_DOWNTIME_FILE "@localstatedir@/spool/nagios/downtime.dat"
+#define DEFAULT_RETENTION_FILE "@localstatedir@/spool/nagios/retention.dat"
+#define DEFAULT_COMMAND_FILE "@localstatedir@/spool/nagios/cmd/nagios.cmd"
+#define DEFAULT_QUERY_SOCKET "@localstatedir@/spool/nagios/cmd/nagios.qh"
#define DEFAULT_CONFIG_FILE "@sysconfdir@/nagios.cfg"
#define DEFAULT_PHYSICAL_HTML_PATH "@datadir@"
#define DEFAULT_URL_HTML_PATH "@htmurl@"
@@ -36,6 +36,6 @@
#define DEFAULT_URL_CGIBIN_PATH "@cgiurl@"
#define DEFAULT_CGI_CONFIG_FILE "@sysconfdir@/cgi.cfg"
#define DEFAULT_LOCK_FILE "@subsyslockfile@"
-#define DEFAULT_OBJECT_CACHE_FILE "@localstatedir@/objects.cache"
-#define DEFAULT_PRECACHED_OBJECT_FILE "@localstatedir@/objects.precache"
-#define DEFAULT_EVENT_BROKER_FILE "@localstatedir@/broker.socket"
+#define DEFAULT_OBJECT_CACHE_FILE "@localstatedir@/spool/nagios/objects.cache"
+#define DEFAULT_PRECACHED_OBJECT_FILE "@localstatedir@/spool/nagios/objects.precache"
+#define DEFAULT_EVENT_BROKER_FILE "@localstatedir@/spool/nagios/broker.socket"
diff -up ./sample-config/nagios.cfg.in.fix_localstatedir ./sample-config/nagios.cfg.in
--- ./sample-config/nagios.cfg.in.fix_localstatedir 2018-08-16 15:10:12.000000000 -0400
+++ ./sample-config/nagios.cfg.in 2018-11-30 13:52:14.989761698 -0500
@@ -15,7 +15,7 @@
# for historical purposes. This should be the first option specified
# in the config file!!!
-log_file=@localstatedir@/nagios.log
+log_file=@localstatedir@/log/nagios/nagios.log
@@ -63,7 +63,7 @@ cfg_file=@sysconfdir@/objects/localhost.
# directly) in order to prevent inconsistencies that can occur
# when the config files are modified after Nagios starts.
-object_cache_file=@localstatedir@/objects.cache
+object_cache_file=@localstatedir@/spool/nagios/objects.cache
@@ -79,7 +79,7 @@ object_cache_file=@localstatedir@/object
# Read the documentation section on optimizing Nagios to find our more
# about how this feature works.
-precached_object_file=@localstatedir@/objects.precache
+precached_object_file=@localstatedir@/spool/nagios/objects.precache
@@ -92,7 +92,7 @@ precached_object_file=@localstatedir@/ob
# defined as macros in this file and restrictive permissions (600)
# can be placed on this file.
-resource_file=@sysconfdir@/resource.cfg
+resource_file=@sysconfdir@/private/resource.cfg
@@ -102,7 +102,7 @@ resource_file=@sysconfdir@/resource.cfg
# The contents of the status file are deleted every time Nagios
# restarts.
-status_file=@localstatedir@/status.dat
+status_file=@localstatedir@/spool/nagios/status.dat
@@ -151,14 +151,14 @@ check_external_commands=1
# directory level instead of on the file, as the file is deleted every
# time its contents are processed.
-command_file=@localstatedir@/rw/nagios.cmd
+command_file=@localstatedir@/spool/nagios/cmd/nagios.cmd
# QUERY HANDLER INTERFACE
# This is the socket that is created for the Query Handler interface
-#query_socket=@localstatedir@/rw/nagios.qh
+#query_socket=@localstatedir@/spool/nagios/cmd/nagios.qh
@@ -176,7 +176,7 @@ lock_file=@subsyslockfile@
# is created, used, and deleted throughout the time that Nagios is
# running.
-temp_file=@localstatedir@/nagios.tmp
+temp_file=@localstatedir@/spool/nagios/nagios.tmp
@@ -243,7 +243,7 @@ log_rotation_method=d
# This is the directory where archived (rotated) log files should be
# placed (assuming you've chosen to do log rotation).
-log_archive_path=@localstatedir@/archives
+log_archive_path=@localstatedir@/log/nagios/archives
@@ -618,7 +618,7 @@ retain_state_information=1
# This file is used only if the retain_state_information
# variable is set to 1.
-state_retention_file=@localstatedir@/retention.dat
+state_retention_file=@localstatedir@/spool/nagios/retention.dat
@@ -831,8 +831,8 @@ process_performance_data=0
# Performance data is only written to these files if the
# enable_performance_data option (above) is set to 1.
-#host_perfdata_file=@localstatedir@/host-perfdata
-#service_perfdata_file=@localstatedir@/service-perfdata
+#host_perfdata_file=@localstatedir@/log/nagios/host-perfdata
+#service_perfdata_file=@localstatedir@/log/nagios/service-perfdata
@@ -1292,7 +1292,7 @@ debug_verbosity=1
# DEBUG FILE
# This option determines where Nagios should write debugging information.
-debug_file=@localstatedir@/nagios.debug
+debug_file=@localstatedir@/log/nagios/nagios.debug
diff -up ./sample-config/template-object/commands.cfg.in.fix_localstatedir ./sample-config/template-object/commands.cfg.in
--- ./sample-config/template-object/commands.cfg.in.fix_localstatedir 2019-01-16 13:50:29.366875513 -0600
+++ ./sample-config/template-object/commands.cfg.in 2019-01-16 13:51:22.140000845 -0600
@@ -241,7 +241,7 @@ define command {
define command {
command_name process-host-perfdata
- command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> @localstatedir@/host-perfdata.out
+ command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> @localstatedir@/log/nagios/host-perfdata.out
}
@@ -249,5 +249,5 @@ define command {
define command {
command_name process-service-perfdata
- command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> @localstatedir@/service-perfdata.out
+ command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> @localstatedir@/log/nagios/service-perfdata.out
}
diff -up ./startup/default-init.in.fix_localstatedir ./startup/default-init.in
--- ./startup/default-init.in.fix_localstatedir 2019-01-16 14:16:54.874599523 -0600
+++ ./startup/default-init.in 2019-01-16 14:22:55.103634621 -0600
@@ -41,12 +41,12 @@
# Our install-time configuration.
NagiosBin=@bindir@/@nagios_name@
NagiosCfgFile=@sysconfdir@/nagios.cfg
-NagiosCfgtestFile=@localstatedir@/nagios.configtest
-NagiosStatusFile=@localstatedir@/status.dat
-NagiosRetentionFile=@localstatedir@/retention.dat
-NagiosCommandFile=@localstatedir@/rw/nagios.cmd
+NagiosCfgtestFile=@localstatedir@/spool/nagios/nagios.configtest
+NagiosStatusFile=@localstatedir@/spool/nagios/status.dat
+NagiosRetentionFile=@localstatedir@/spool/nagios/retention.dat
+NagiosCommandFile=@localstatedir@/spool/nagios/cmd/nagios.cmd
NagiosRunFile=@subsyslockfile@
-NagiosVarDir=@localstatedir@
+NagiosVarDir=@localstatedir@/spool/nagios/
NagiosCGIDir=@cgibindir@
NagiosUser=@nagios_user@
NagiosGroup=@nagios_grp@
diff -up ./startup/default-service.in.fix_localstatedir ./startup/default-service.in
--- ./startup/default-service.in.fix_localstatedir 2019-01-16 14:23:17.575262522 -0600
+++ ./startup/default-service.in 2019-01-16 14:23:39.273903222 -0600
@@ -8,7 +8,7 @@ Type=forking
ExecStartPre=@bindir@/nagios -v @sysconfdir@/nagios.cfg
ExecStart=@bindir@/nagios -d @sysconfdir@/nagios.cfg
ExecStop=@BIN_KILL@ -s TERM ${MAINPID}
-ExecStopPost=@BIN_RM@ -f @localstatedir@/rw/nagios.cmd
+ExecStopPost=@BIN_RM@ -f @localstatedir@/spool/nagios/cmd/nagios.cmd
ExecReload=@bindir@/nagios -v @sysconfdir@/nagios.cfg
ExecReload=@BIN_KILL@ -s HUP ${MAINPID}
diff -up ./t-tap/Makefile.in.fix_localstatedir ./t-tap/Makefile.in
--- ./t-tap/Makefile.in.fix_localstatedir 2019-01-16 14:24:14.944312569 -0600
+++ ./t-tap/Makefile.in 2019-01-16 14:24:42.359858604 -0600
@@ -42,7 +42,7 @@ LIBS=@LIBS@ ../lib/libnagios.a
prefix=@prefix@
exec_prefix=@exec_prefix@
-LOGDIR=@localstatedir@
+LOGDIR=@localstatedir@/log/nagios/
CFGDIR=@sysconfdir@
BINDIR=@bindir@
CGIDIR=@cgibindir@

View file

@ -0,0 +1,114 @@
diff -up ./cgi/extinfo.c.remove_3rdparty_links ./cgi/extinfo.c
--- ./cgi/extinfo.c.remove_3rdparty_links 2019-08-20 15:29:34.000000000 +0000
+++ ./cgi/extinfo.c 2019-08-29 18:17:32.321544245 +0000
@@ -557,27 +557,6 @@ void document_header(int use_stylesheet)
printf("<LINK REL='stylesheet' TYPE='text/css' HREF='%s%s'>\n", url_stylesheets_path, NAGFUNCS_CSS);
}
- if (display_type == DISPLAY_HOST_INFO)
- vidurl = "https://www.youtube.com/embed/n3QEAf-MxY4";
- else if(display_type == DISPLAY_SERVICE_INFO)
- vidurl = "https://www.youtube.com/embed/f_knwQOS6FI";
-
- if (enable_page_tour == TRUE && vidurl) {
- printf("<script type='text/javascript' src='%s%s'></script>\n", url_js_path, JQUERY_JS);
- printf("<script type='text/javascript' src='%s%s'></script>\n", url_js_path, NAGFUNCS_JS);
- printf("<script type='text/javascript'>\n");
- printf("var vbox, vBoxId='extinfo%d', vboxText = "
- "'<a href=https://www.nagios.com/tours target=_blank>"
- "Click here to watch the entire Nagios Core 4 Tour!</a>';\n",
- display_type);
- printf("$(document).ready(function() {\n"
- "var user = '%s';\nvBoxId += ';' + user;\n",
- current_authdata.username);
- printf("vbox = new vidbox({pos:'lr',vidurl:'%s',text:vboxText,"
- "vidid:vBoxId});\n", vidurl);
- printf("});\n</script>\n");
- }
-
printf("</head>\n");
printf("<body CLASS='extinfo'>\n");
diff -up ./cgi/status.c.remove_3rdparty_links ./cgi/status.c
--- ./cgi/status.c.remove_3rdparty_links 2019-08-20 15:29:34.000000000 +0000
+++ ./cgi/status.c 2019-08-29 18:17:32.322544264 +0000
@@ -556,31 +556,8 @@ void document_header(int use_stylesheet)
/* JS function to append content to elements on page */
printf("<script type='text/javascript'>\n");
if (enable_page_tour == TRUE) {
- printf("var vbox, vBoxId='status%d%d', vboxText = "
- "'<a href=https://www.nagios.com/tours target=_blank>"
- "Click here to watch the entire Nagios Core 4 Tour!</a>';\n",
- display_type, group_style_type);
printf("$(document).ready(function() {\n"
"$('#top_page_numbers').append($('#bottom_page_numbers').html() );\n");
- if (display_type == DISPLAY_HOSTS)
- vidurl = "https://www.youtube.com/embed/ahDIJcbSEFM";
- else if(display_type == DISPLAY_SERVICEGROUPS) {
- if (group_style_type == STYLE_HOST_DETAIL)
- vidurl = "https://www.youtube.com/embed/nNiRr0hDZag";
- else if (group_style_type == STYLE_OVERVIEW)
- vidurl = "https://www.youtube.com/embed/MyvgTKLyQhA";
- } else {
- if (group_style_type == STYLE_OVERVIEW)
- vidurl = "https://www.youtube.com/embed/jUDrjgEDb2A";
- else if (group_style_type == STYLE_HOST_DETAIL)
- vidurl = "https://www.youtube.com/embed/nNiRr0hDZag";
- }
- if (vidurl) {
- printf("var user = '%s';\nvBoxId += ';' + user;",
- current_authdata.username);
- printf("vbox = new vidbox({pos:'lr',vidurl:'%s',text:vboxText,"
- "vidid:vBoxId});\n", vidurl);
- }
printf("});\n");
}
printf("function set_limit(url) { \nthis.location = url+'&limit='+$('#limit').val();\n }\n");
diff -up ./cgi/tac.c.remove_3rdparty_links ./cgi/tac.c
--- ./cgi/tac.c.remove_3rdparty_links 2019-08-20 15:29:34.000000000 +0000
+++ ./cgi/tac.c 2019-08-29 18:17:32.323544284 +0000
@@ -308,17 +308,7 @@ void document_header(int use_stylesheet)
if (enable_page_tour == TRUE) {
printf("<script type='text/javascript' src='%s%s'></script>\n", url_js_path, NAGFUNCS_JS);
-
- printf("<script type='text/javascript'>\nvar vbox, vBoxId='tac', "
- "vboxText = '<a href=https://www.nagios.com/tours target=_blank>"
- "Click here to watch the entire Nagios Core 4 Tour!</a>';\n");
- printf("$(document).ready(function() {\n"
- "var user = '%s';\nvBoxId += ';' + user;", current_authdata.username);
- printf("vbox = new vidbox({pos:'lr',"
- "vidurl:'https://www.youtube.com/embed/l20YRDhbOfA',text:vboxText,"
- "vidid:vBoxId});");
- printf("\n});\n</script>\n");
- }
+ }
diff --git a/html/main.php b/html/main.php
index 15713f8d..91cb1266 100644
--- a/html/main.php
+++ b/html/main.php
@@ -23,21 +23,7 @@ if ($theme != 'dark' && $theme != 'light') {
<script type='text/javascript'>
var cookie;
- <?php if ($cfg["enable_page_tour"]) { ?>
- var vbox;
- var vBoxId = "main";
- var vboxText = "<a href=https://www.nagios.com/tours target=_blank> " +
- "Click here to watch the entire Nagios Core 4 Tour!</a>";
- <?php } ?>
$(document).ready(function() {
- var user = "<?php echo htmlspecialchars($_SERVER['REMOTE_USER'] ?? ''); ?>";
-
- <?php if ($cfg["enable_page_tour"]) { ?>
- vBoxId += ";" + user;
- vbox = new vidbox({pos:'lr',vidurl:'https://www.youtube.com/embed/2hVBAet-XpY',
- text:vboxText,vidid:vBoxId});
- <?php } ?>
-
getCoreStatus();
});

View file

@ -0,0 +1,57 @@
diff --git a/contrib/Makefile.in b/contrib/Makefile.in
index 72e4d4a9..62415152 100644
--- a/contrib/Makefile.in
+++ b/contrib/Makefile.in
@@ -84,52 +84,3 @@ $(CGI_O): $(CGI_C)
%.cgi : %.c
$(CC) $(CFLAGS) $(LDFLAGS) $< $(CGI_O) -o $@
-
-##############################################################################
-# making similar EPEL rpm for Fedora/RHEL/CentOS
-
-ifneq ("$(wildcard /etc/redhat-release)","")
-
-ARCH ?= $(shell uname -m)
-ifeq ($(ARCH),x86_64)
-RPM_ARCH := x86_64
-else
- ifeq ($(ARCH),i686)
-RPM_ARCH := i386
- else
- ifeq ($(ARCH),aarch64)
-RPM_ARCH := aarch64
- else
-$(error Unknown arch "$(ARCH)".)
- endif
- endif
-endif
-
-# Create our own tarball and put ino rpmbuild/SOURCES
-localsrc-rpm:
- # create nagios tar ball.
- @(cd ..;rm -f nagios-@VERSION@)
- @(cd ..;ln -s . nagios-@VERSION@)
- @(cd ..;tar zhcf nagios-@VERSION@.tar.gz --exclude nagios-@VERSION@/nagios-@VERSION@.tar.gz --exclude nagios-@VERSION@/nagios-@VERSION@ --exclude RCS --exclude CVS --exclude build-* --exclude *~ --exclude .git* nagios-@VERSION@/)
- @(cd ..;rm -f nagios-@VERSION@)
- # build the rpm using rpmbuild from ./rmbuild as topdir
- @rm -rf rpmbuild && mkdir -p ./rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
- @cp ../nagios-@VERSION@.tar.gz rpmbuild/SOURCES/nagios-@VERSION@.tar.gz
- @cp epel-patches/* ./rpmbuild/SOURCES
- @rpmbuild -ba --define "_topdir ${PWD}/rpmbuild" epel-nagios.spec
- @cp rpmbuild/RPMS/$(RPM_ARCH)/*.rpm .
- @cp rpmbuild/SRPMS/*.src.rpm .
- @ls -l *.rpm
-
-# tarball from https://github.com/NagiosEnterprises/nagioscore/releases/download/nagios-%{version}/nagios-%{version}.tar.gz
-rpm: init-epelrpm build-epelrpm
- @mv rpmbuild/RPMS/$(RPM_ARCH)/*.rpm .
- @ls -l *.rpm
-init-epelrpm:
- # build the rpm using rpmbuild from ./rmbuild as topdir
- @rm -rf ./rpmbuild && mkdir -p ./rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
- @spectool -C ./rpmbuild/SOURCES -g epel-nagios.spec
- @cp epel-patches/* ./rpmbuild/SOURCES
-build-epelrpm:
- @rpmbuild -ba --define "_topdir ${PWD}/rpmbuild" epel-nagios.spec
-endif

View file

@ -0,0 +1,48 @@
diff -up ./contrib/eventhandlers/disable_active_service_checks.fix_spool ./contrib/eventhandlers/disable_active_service_checks
--- ./contrib/eventhandlers/disable_active_service_checks.fix_spool 2017-08-24 17:43:48.000000000 -0400
+++ ./contrib/eventhandlers/disable_active_service_checks 2017-09-19 15:21:28.173643069 -0400
@@ -16,7 +16,7 @@
printfcmd="/usr/bin/printf"
-CommandFile="/usr/local/nagios/var/rw/nagios.cmd"
+CommandFile="/var/spool/nagios/"
# get the current date/time in seconds since UNIX epoch
datetime=`date +%s`
diff -up ./contrib/eventhandlers/disable_notifications.fix_spool ./contrib/eventhandlers/disable_notifications
--- ./contrib/eventhandlers/disable_notifications.fix_spool 2017-08-24 17:43:48.000000000 -0400
+++ ./contrib/eventhandlers/disable_notifications 2017-09-19 15:21:28.198643530 -0400
@@ -14,7 +14,7 @@
printfcmd="/usr/bin/printf"
-CommandFile="/usr/local/nagios/var/rw/nagios.cmd"
+CommandFile="/var/spool/nagios/"
# get the current date/time in seconds since UNIX epoch
datetime=`date +%s`
diff -up ./contrib/eventhandlers/enable_active_service_checks.fix_spool ./contrib/eventhandlers/enable_active_service_checks
--- ./contrib/eventhandlers/enable_active_service_checks.fix_spool 2017-08-24 17:43:48.000000000 -0400
+++ ./contrib/eventhandlers/enable_active_service_checks 2017-09-19 15:21:28.199643549 -0400
@@ -16,7 +16,7 @@
printfcmd="/usr/bin/printf"
-CommandFile="/usr/local/nagios/var/rw/nagios.cmd"
+CommandFile="/var/spool/nagios/"
# get the current date/time in seconds since UNIX epoch
datetime=`date +%s`
diff -up ./contrib/eventhandlers/submit_check_result.fix_spool ./contrib/eventhandlers/submit_check_result
--- ./contrib/eventhandlers/submit_check_result.fix_spool 2017-08-24 17:43:48.000000000 -0400
+++ ./contrib/eventhandlers/submit_check_result 2017-09-19 15:21:28.200643567 -0400
@@ -24,7 +24,7 @@
echocmd="/bin/echo"
-CommandFile="/usr/local/nagios/var/rw/nagios.cmd"
+CommandFile="/var/spool/nagios/"
# get the current date/time in seconds since UNIX epoch
datetime=`date +%s`

View file

@ -0,0 +1,36 @@
diff -up ./contrib/eventhandlers/distributed-monitoring/obsessive_svc_handler.fix_plugin ./contrib/eventhandlers/distributed-monitoring/obsessive_svc_handler
--- ./contrib/eventhandlers/distributed-monitoring/obsessive_svc_handler.fix_plugin 2017-08-24 17:43:48.000000000 -0400
+++ ./contrib/eventhandlers/distributed-monitoring/obsessive_svc_handler 2017-09-19 15:21:28.201643586 -0400
@@ -21,7 +21,7 @@
#
# Location of the submit_check_result_via_nsca script
-SubmitCmd="/usr/local/nagios/libexec/eventhandlers/submit_check_result_via_nsca"
+SubmitCmd="/usr/lib64/nagios/plugins/eventhandlers/submit_check_result_via_nsca"
# Convert the state string to the corresponding return code
return_code=-1
diff -up ./contrib/eventhandlers/redundancy-scenario1/handle-master-host-event.fix_plugin ./contrib/eventhandlers/redundancy-scenario1/handle-master-host-event
--- ./contrib/eventhandlers/redundancy-scenario1/handle-master-host-event.fix_plugin 2017-08-24 17:43:48.000000000 -0400
+++ ./contrib/eventhandlers/redundancy-scenario1/handle-master-host-event 2017-09-19 15:21:28.202643604 -0400
@@ -13,7 +13,7 @@ echocmd="/bin/echo"
mailcmd="/bin/mail"
# Location of the event handlers
-eventhandlerdir="/usr/local/nagios/libexec/eventhandlers"
+eventhandlerdir="/usr/lib64/nagios/plugins/eventhandlers"
# Only take action on hard host states...
diff -up ./contrib/eventhandlers/redundancy-scenario1/handle-master-proc-event.fix_plugin ./contrib/eventhandlers/redundancy-scenario1/handle-master-proc-event
--- ./contrib/eventhandlers/redundancy-scenario1/handle-master-proc-event.fix_plugin 2017-08-24 17:43:48.000000000 -0400
+++ ./contrib/eventhandlers/redundancy-scenario1/handle-master-proc-event 2017-09-19 15:21:28.203643623 -0400
@@ -13,7 +13,7 @@ echocmd="/bin/echo"
mailcmd="/bin/mail"
# Location of the event handlers
-eventhandlerdir="/usr/local/nagios/libexec/eventhandlers"
+eventhandlerdir="/usr/lib64/nagios/plugins/eventhandlers"
# Only take action on hard service states...

View file

@ -0,0 +1,12 @@
diff -up ./startup/default-service.in.fix_uidgid ./startup/default-service.in
--- ./startup/default-service.in.fix_uidgid 2019-02-22 11:57:38.432525592 -0500
+++ ./startup/default-service.in 2019-02-22 11:58:03.823003073 -0500
@@ -5,6 +5,8 @@ After=network.target local-fs.target
[Service]
Type=forking
+User=nagios
+Group=nagios
ExecStartPre=@bindir@/nagios -v @sysconfdir@/nagios.cfg
ExecStart=@bindir@/nagios -d @sysconfdir@/nagios.cfg
ExecStop=@BIN_KILL@ -s TERM ${MAINPID}

View file

@ -0,0 +1,13 @@
diff --git a/Changelog b/Changelog
index a5fd04c6..51394645 100644
--- a/Changelog
+++ b/Changelog
@@ -9,7 +9,7 @@ FIXES
* Fixed duplicate properties appearing in statusjson.cgi (#718) (Sebastian Wolf)
* Fixed NERD not building when enabled in ./configure (#723) (Sebastian Wolf)
* Fixed build process when using GCC 10 (#721) (Michael Orlitzky)
-* Fixed postauth vulnerabilities in histogram.js, map.js, trends.js (CVE-2020-1408) (Thanks UraSec Team) (Sebastian Wolf)
+* Fixed postauth vulnerabilities in histogram.js, map.js, trends.js (CVE-2020-13977) (Thanks UraSec Team) (Sebastian Wolf)
* When using systemd, configuration will be verified before reloading (#715) (tatref)
* Fixed HARD OK states triggering on the maximum check attempt (#757) (Sebastian Wolf)

19
nagios.README.SELinux.rst Normal file
View file

@ -0,0 +1,19 @@
================
Nagios and SELinux
================
While there is an Nagios policy in the default Selinux policies, it does
not meet the needs of the current Nagios software. In working with the
SELinux security group, there is now a need for non-core packages to
carry their own policy in a spec file.
Following the steps in
https://fedoraproject.org/wiki/SELinux/IndependentPolicy we are adding
the needed subpackage and files.
This policy DOES NOT REPLACE THE CORE POLICY in the selinux-policies
package. This is only a supplement that the nrpe package needs due to
changes from the older base policy.
Please report bugs as needed and we will try to get them fixed as soon
as possible.

114
nagios.fc Normal file
View file

@ -0,0 +1,114 @@
/etc/nagios(/.*)? gen_context(system_u:object_r:nagios_etc_t,s0)
/etc/icinga(/.*)? gen_context(system_u:object_r:nagios_etc_t,s0)
/etc/nagios/nrpe\.cfg -- gen_context(system_u:object_r:nrpe_etc_t,s0)
/etc/nrpe\.d(/.*)? gen_context(system_u:object_r:nrpe_etc_t,s0)
/etc/pnp4nagios(/.*)? gen_context(system_u:object_r:nagios_etc_t,s0)
/etc/rc\.d/init\.d/nagios -- gen_context(system_u:object_r:nagios_initrc_exec_t,s0)
/etc/rc\.d/init\.d/nrpe -- gen_context(system_u:object_r:nagios_initrc_exec_t,s0)
/usr/bin/nagios -- gen_context(system_u:object_r:nagios_exec_t,s0)
/usr/bin/icinga -- gen_context(system_u:object_r:nagios_exec_t,s0)
/usr/bin/nrpe -- gen_context(system_u:object_r:nrpe_exec_t,s0)
/usr/sbin/nagios -- gen_context(system_u:object_r:nagios_exec_t,s0)
/usr/sbin/icinga -- gen_context(system_u:object_r:nagios_exec_t,s0)
/usr/sbin/nrpe -- gen_context(system_u:object_r:nrpe_exec_t,s0)
/usr/lib/cgi-bin/netsaint(/.*)? gen_context(system_u:object_r:nagios_script_exec_t,s0)
/usr/lib/nagios/cgi(/.*)? gen_context(system_u:object_r:nagios_script_exec_t,s0)
/usr/lib/icinga/cgi(/.*)? gen_context(system_u:object_r:nagios_script_exec_t,s0)
/var/log/nagios(/.*)? gen_context(system_u:object_r:nagios_log_t,s0)
/var/log/icinga(/.*)? gen_context(system_u:object_r:nagios_log_t,s0)
/var/log/netsaint(/.*)? gen_context(system_u:object_r:nagios_log_t,s0)
/var/log/pnp4nagios(/.*)? gen_context(system_u:object_r:nagios_log_t,s0)
/var/lib/pnp4nagios(/.*)? gen_context(system_u:object_r:nagios_var_lib_t,s0)
/var/run/nagios.* gen_context(system_u:object_r:nagios_var_run_t,s0)
/var/spool/nagios(/.*)? gen_context(system_u:object_r:nagios_spool_t,s0)
/var/spool/icinga(/.*)? gen_context(system_u:object_r:nagios_spool_t,s0)
ifdef(`distro_debian',`
/usr/sbin/nagios -- gen_context(system_u:object_r:nagios_exec_t,s0)
')
/usr/lib/cgi-bin/nagios(/.+)? gen_context(system_u:object_r:nagios_script_exec_t,s0)
/usr/lib/nagios/cgi-bin(/.*)? gen_context(system_u:object_r:nagios_script_exec_t,s0)
# admin plugins
/usr/lib/nagios/plugins/check_file_age -- gen_context(system_u:object_r:nagios_admin_plugin_exec_t,s0)
# check disk plugins
/usr/lib/nagios/plugins/check_disk -- gen_context(system_u:object_r:nagios_checkdisk_plugin_exec_t,s0)
/usr/lib/nagios/plugins/check_disk_smb -- gen_context(system_u:object_r:nagios_checkdisk_plugin_exec_t,s0)
/usr/lib/nagios/plugins/check_ide_smart -- gen_context(system_u:object_r:nagios_checkdisk_plugin_exec_t,s0)
/usr/lib/nagios/plugins/check_linux_raid -- gen_context(system_u:object_r:nagios_checkdisk_plugin_exec_t,s0)
# mail plugins
/usr/lib/nagios/plugins/check_mailq -- gen_context(system_u:object_r:nagios_mail_plugin_exec_t,s0)
/usr/lib/pnp4nagios(/.*)? gen_context(system_u:object_r:nagios_var_lib_t,s0)
# system plugins
/usr/lib(64)?/nagios/plugins/check_breeze -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_dummy -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_flexlm -- gen_context(system_u:object_r:nagios_system_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_ifoperstatus -- gen_context(system_u:object_r:nagios_system_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_ifstatus -- gen_context(system_u:object_r:nagios_system_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_load -- gen_context(system_u:object_r:nagios_system_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_log -- gen_context(system_u:object_r:nagios_system_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_mrtg -- gen_context(system_u:object_r:nagios_system_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_mrtgtraf -- gen_context(system_u:object_r:nagios_system_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_nagios -- gen_context(system_u:object_r:nagios_system_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_nwstat -- gen_context(system_u:object_r:nagios_system_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_overcr -- gen_context(system_u:object_r:nagios_system_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_procs -- gen_context(system_u:object_r:nagios_system_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_sensors -- gen_context(system_u:object_r:nagios_system_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_swap -- gen_context(system_u:object_r:nagios_system_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_users -- gen_context(system_u:object_r:nagios_system_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_wave -- gen_context(system_u:object_r:nagios_system_plugin_exec_t,s0)
# services plugins
/usr/lib(64)?/nagios/plugins/check_cluster -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_dhcp -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_dig -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_dns -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_game -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_fping -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_hpjd -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_http -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_icmp -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_ircd -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_ldap -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_mysql -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_mysql_query -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_nrpe -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_nt -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_ntp.* -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_oracle -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_pgsql -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_ping -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_radius -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_real -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_rpc -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_tcp -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_time -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_sip -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_smtp -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_snmp.* -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_ssh -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
/usr/lib(64)?/nagios/plugins/check_ups -- gen_context(system_u:object_r:nagios_services_plugin_exec_t,s0)
# openshift plugins
/usr/lib64/nagios/plugins/check_node_accept_status -- gen_context(system_u:object_r:nagios_openshift_plugin_exec_t,s0)
/usr/lib64/nagios/plugins/check_number_openshift_apps -- gen_context(system_u:object_r:nagios_openshift_plugin_exec_t,s0)
# label all nagios plugin as unconfined by default
/usr/lib/nagios/plugins/.* -- gen_context(system_u:object_r:nagios_unconfined_plugin_exec_t,s0)
# eventhandlers
/usr/lib/nagios/plugins/eventhandlers(/.*) gen_context(system_u:object_r:nagios_eventhandler_plugin_exec_t,s0)
/usr/lib/icinga/plugins/eventhandlers(/.*) gen_context(system_u:object_r:nagios_eventhandler_plugin_exec_t,s0)

50
nagios.htaccess Normal file
View file

@ -0,0 +1,50 @@
ScriptAlias /nagios/cgi-bin/ /usr/lib/nagios/cgi-bin/
<Directory /usr/lib/nagios/cgi-bin/>
Options ExecCGI
order deny,allow
deny from all
allow from 127.0.0.1
AuthType Basic
AuthUserFile /etc/nagios/passwd
AuthName "nagios"
require valid-user
</Directory>
Alias /nagios/ /usr/share/nagios/html/
<Directory /usr/share/nagios/html/>
Options None
order deny,allow
deny from all
allow from 127.0.0.1
AuthType Basic
AuthUserFile /etc/nagios/passwd
AuthName "nagios"
require valid-user
</Directory>
# For SSL-servers
#<Directory /usr/lib/nagios/cgi-bin/>
# Options ExecCGI
# SSLRequireSSL
# order deny,allow
# deny from all
# allow from 127.0.0.1
# AuthType Basic
# AuthUserFile /etc/nagios/passwd
# AuthName "nagios"
# require valid-user
#</Directory>
#
#Alias /nagios/ /usr/share/nagios/html/
#<Directory /usr/share/nagios/html/>
# Options None
# SSLRequireSSL
# order deny,allow
# deny from all
# allow from 127.0.0.1
# AuthType Basic
# AuthUserFile /etc/nagios/passwd
# AuthName "nagios"
# require valid-user
#</Directory>

2
nagios.htpasswd Normal file
View file

@ -0,0 +1,2 @@
nagiosadmin:RbdO4ou4PNyMg

367
nagios.if Normal file
View file

@ -0,0 +1,367 @@
## <summary>Net Saint / NAGIOS - network monitoring server</summary>
########################################
## <summary>
## Create a set of derived types for various
## nagios plugins,
## </summary>
## <param name="plugins_group_name">
## <summary>
## The name to be used for deriving type names.
## </summary>
## </param>
#
template(`nagios_plugin_template',`
gen_require(`
attribute nagios_plugin_domain;
type nagios_t, nrpe_t;
')
type nagios_$1_plugin_t, nagios_plugin_domain;
type nagios_$1_plugin_exec_t;
application_domain(nagios_$1_plugin_t, nagios_$1_plugin_exec_t)
role system_r types nagios_$1_plugin_t;
domtrans_pattern(nrpe_t, nagios_$1_plugin_exec_t, nagios_$1_plugin_t)
allow nagios_t nagios_$1_plugin_exec_t:file ioctl;
# needed by command.cfg
domtrans_pattern(nagios_t, nagios_$1_plugin_exec_t, nagios_$1_plugin_t)
kernel_read_system_state(nagios_$1_plugin_t)
')
########################################
## <summary>
## Execute the nagios unconfined plugins with
## a domain transition.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`nagios_domtrans_unconfined_plugins',`
gen_require(`
type nagios_unconfined_plugin_t;
type nagios_unconfined_plugin_exec_t;
')
domtrans_pattern($1, nagios_unconfined_plugin_exec_t, nagios_unconfined_plugin_t)
')
########################################
## <summary>
## Do not audit attempts to read or write nagios
## unnamed pipes.
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
## </param>
#
interface(`nagios_dontaudit_rw_pipes',`
gen_require(`
type nagios_t;
')
dontaudit $1 nagios_t:fifo_file rw_fifo_file_perms;
')
########################################
## <summary>
## Allow the specified domain to read
## nagios configuration files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`nagios_read_config',`
gen_require(`
type nagios_etc_t;
')
allow $1 nagios_etc_t:dir list_dir_perms;
allow $1 nagios_etc_t:file read_file_perms;
files_search_etc($1)
')
######################################
## <summary>
## Read nagios lib files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`nagios_read_lib',`
gen_require(`
type nagios_var_lib_t;
')
files_search_var($1)
list_dirs_pattern($1, nagios_var_lib_t, nagios_var_lib_t)
read_files_pattern($1, nagios_var_lib_t, nagios_var_lib_t)
')
######################################
## <summary>
## Read nagios logs.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`nagios_read_log',`
gen_require(`
type nagios_log_t;
')
logging_search_logs($1)
read_files_pattern($1, nagios_log_t, nagios_log_t)
')
########################################
## <summary>
## Do not audit attempts to read or write nagios logs.
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
## </param>
#
interface(`nagios_dontaudit_rw_log',`
gen_require(`
type nagios_log_t;
')
dontaudit $1 nagios_log_t:file rw_file_perms;
')
########################################
## <summary>
## Search nagios spool directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`nagios_search_spool',`
gen_require(`
type nagios_spool_t;
')
allow $1 nagios_spool_t:dir search_dir_perms;
files_search_spool($1)
')
########################################
## <summary>
## Append nagios spool files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`nagios_append_spool',`
gen_require(`
type nagios_spool_t;
')
allow $1 nagios_spool_t:file append_file_perms;
files_search_spool($1)
')
########################################
## <summary>
## Allow the specified domain to read
## nagios temporary files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`nagios_read_tmp_files',`
gen_require(`
type nagios_tmp_t;
')
allow $1 nagios_tmp_t:file read_file_perms;
files_search_tmp($1)
')
########################################
## <summary>
## Allow the specified domain to read
## nagios temporary files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`nagios_rw_inerited_tmp_files',`
gen_require(`
type nagios_tmp_t;
')
allow $1 nagios_tmp_t:file rw_inherited_file_perms;
files_search_tmp($1)
')
########################################
## <summary>
## Execute the nagios NRPE with
## a domain transition.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`nagios_domtrans_nrpe',`
gen_require(`
type nrpe_t, nrpe_exec_t;
')
domtrans_pattern($1, nrpe_exec_t, nrpe_t)
')
######################################
## <summary>
## Do not audit attempts to write nrpe daemon unnamed pipes.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`nagios_dontaudit_write_pipes_nrpe',`
gen_require(`
type nrpe_t;
')
dontaudit $1 nrpe_t:fifo_file write;
')
########################################
## <summary>
## All of the rules required to administrate
## an nagios environment
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <param name="role">
## <summary>
## The role to be allowed to manage the nagios domain.
## </summary>
## </param>
## <rolecap/>
#
interface(`nagios_admin',`
gen_require(`
type nagios_t, nrpe_t, nagios_initrc_exec_t;
type nagios_tmp_t, nagios_log_t, nagios_var_run_t;
type nagios_etc_t, nrpe_etc_t, nagios_spool_t;
')
allow $1 nagios_t:process signal_perms;
ps_process_pattern($1, nagios_t)
tunable_policy(`deny_ptrace',`',`
allow $1 nagios_t:process ptrace;
')
init_labeled_script_domtrans($1, nagios_initrc_exec_t)
domain_system_change_exemption($1)
role_transition $2 nagios_initrc_exec_t system_r;
allow $2 system_r;
files_list_tmp($1)
admin_pattern($1, nagios_tmp_t)
logging_list_logs($1)
admin_pattern($1, nagios_log_t)
files_list_etc($1)
admin_pattern($1, nagios_etc_t)
files_list_spool($1)
admin_pattern($1, nagios_spool_t)
files_list_pids($1)
admin_pattern($1, nagios_var_run_t)
admin_pattern($1, nrpe_etc_t)
')
########################################
## <summary>
## Send a null signal to nagios_unconfined_plugin.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`nagios_unconfined_signull',`
gen_require(`
type nagios_unconfined_plugin_t;
')
allow $1 nagios_unconfined_plugin_t:process signull;
')
########################################
#
# Nagios interface compatibility blocks
#
# The following definitions ensure compatibility with distribution policy
# versions that do not contain given interfaces (epel, or older Fedora
# releases).
# Each block tests for existence of given interface and defines it if needed.
#
########################################
## <summary>
## Allow caller to signull sssd.
## Backport from RHEL8
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
ifndef(`sssd_signull',`
interface(`sssd_signull',`
gen_require(`
type sssd_t;
')
allow $1 sssd_t:process signull;
')
')

55
nagios.internet.cfg Normal file
View file

@ -0,0 +1,55 @@
##############################################################################
# internet.cfg - sample config file for Fedoras Nagios
#
# 2008-07-03 created Robert M. Albrecht
#
# NOTES: This config file is a sample for monitoring some internet hosts.
#
###############################################################################
define host{
name template-internet-host
use generic-host
register 0
max_check_attempts 5
contacts nagiosadmin
parents localhost
}
define host{
use template-internet-host
host_name Google
address www.google.com
notes Googles Website defined by sample config
notes_url http://www.google.com
action_url http://en.wikipedia.org/wiki/Google
}
define hostgroup{
hostgroup_name InternetHosts
alias Internet Hosts
members Google
}
define service{
use generic-service
hostgroup_name InternetHosts
service_description PING
check_command check_ping!200.0,20%!600.0,60%
}
define service{
use generic-service
hostgroup_name InternetHosts
service_description HTTP
check_command check_http
}
define servicegroup{
servicegroup_name WebSites
alias Internet Hosts
members Google,PING,Google,HTTP
}

15
nagios.logrotate Normal file
View file

@ -0,0 +1,15 @@
# Important! Nagios rotates its own logs. Only enable this logrotate if you
# know what you are doing!
# For more information please see "log_rotate_method" in:
# /etc/nagios/nagios.cfg
# ----- logrotate config -------------
#/var/log/nagios/*.log {
# missingok
# weekly
# notifempty
# nocompress
# create 644 nagios nagios
#}

1275
nagios.spec Normal file

File diff suppressed because it is too large Load diff

667
nagios.te Normal file
View file

@ -0,0 +1,667 @@
policy_module(nagios, 1.13.0)
########################################
#
# Declarations
#
## <desc>
## <p>
## Allow nagios/nrpe to call sudo from NRPE utils scripts.
## </p>
## </desc>
gen_tunable(nagios_run_sudo, false)
## <desc>
## <p>
## Allow nagios run in conjunction with PNP4Nagios.
## </p>
## </desc>
gen_tunable(nagios_run_pnp4nagios, false)
## <desc>
## <p>
## Determine whether Nagios, NRPE can
## access nfs file systems.
## </p>
## </desc>
gen_tunable(nagios_use_nfs, false)
gen_require(`
class passwd rootok;
class passwd passwd;
')
attribute nagios_plugin_domain;
type nagios_t;
type nagios_exec_t;
init_daemon_domain(nagios_t, nagios_exec_t)
type nagios_etc_t;
files_config_file(nagios_etc_t)
type nagios_initrc_exec_t;
init_script_file(nagios_initrc_exec_t)
type nagios_log_t;
logging_log_file(nagios_log_t)
type nagios_tmp_t;
files_tmp_file(nagios_tmp_t)
type nagios_var_run_t;
files_pid_file(nagios_var_run_t)
type nagios_spool_t;
files_spool_file(nagios_spool_t)
type nagios_var_lib_t;
files_type(nagios_var_lib_t)
nagios_plugin_template(admin)
nagios_plugin_template(checkdisk)
nagios_plugin_template(mail)
nagios_plugin_template(services)
nagios_plugin_template(system)
nagios_plugin_template(unconfined)
nagios_plugin_template(eventhandler)
nagios_plugin_template(openshift)
type nagios_eventhandler_plugin_tmp_t;
files_tmp_file(nagios_eventhandler_plugin_tmp_t)
type nagios_system_plugin_tmp_t;
files_tmp_file(nagios_system_plugin_tmp_t)
type nagios_openshift_plugin_tmp_t;
files_tmp_file(nagios_openshift_plugin_tmp_t)
type nrpe_t;
type nrpe_exec_t;
init_daemon_domain(nrpe_t, nrpe_exec_t)
type nrpe_etc_t;
files_config_file(nrpe_etc_t)
type nrpe_var_run_t;
files_pid_file(nrpe_var_run_t)
######################################
#
# Common plugin domain local policy
#
allow nagios_plugin_domain self:fifo_file rw_fifo_file_perms;
allow nrpe_t nagios_plugin_domain:process { sigkill signal };
allow nagios_t nagios_plugin_domain:process signal_perms;
allow nagios_plugin_domain nagios_t:process signal_perms;
# cjp: leaked file descriptor
dontaudit nagios_plugin_domain nrpe_t:tcp_socket { read write };
dontaudit nagios_plugin_domain nagios_log_t:file { read write };
dev_read_urand(nagios_plugin_domain)
dev_read_rand(nagios_plugin_domain)
dev_read_sysfs(nagios_plugin_domain)
userdom_use_inherited_user_ptys(nagios_plugin_domain)
userdom_use_inherited_user_ttys(nagios_plugin_domain)
########################################
#
# Nagios local policy
#
allow nagios_t self:capability { chown dac_read_search setgid setuid };
dontaudit nagios_t self:capability sys_tty_config;
allow nagios_t self:process { setpgid signal_perms };
allow nagios_t self:fifo_file rw_fifo_file_perms;
allow nagios_t self:tcp_socket { accept listen };
allow nagios_t self:unix_stream_socket { connectto };
allow nagios_t nagios_plugin_domain:process signal_perms;
allow nagios_t nagios_eventhandler_plugin_exec_t:dir list_dir_perms;
allow nagios_t nagios_etc_t:dir list_dir_perms;
allow nagios_t nagios_etc_t:file { map read_file_perms };
allow nagios_t nagios_etc_t:lnk_file read_lnk_file_perms;
#allow nagios_t nagios_log_t:dir setattr_dir_perms;
#append_files_pattern(nagios_t, nagios_log_t, nagios_log_t)
#create_files_pattern(nagios_t, nagios_log_t, nagios_log_t)
#setattr_files_pattern(nagios_t, nagios_log_t, nagios_log_t)
manage_files_pattern(nagios_t, nagios_log_t, nagios_log_t)
manage_dirs_pattern(nagios_t, nagios_log_t, nagios_log_t)
logging_log_filetrans(nagios_t, nagios_log_t, { dir file })
allow nagios_t nagios_log_t:file map;
manage_dirs_pattern(nagios_t, nagios_tmp_t, nagios_tmp_t)
manage_files_pattern(nagios_t, nagios_tmp_t, nagios_tmp_t)
files_tmp_filetrans(nagios_t, nagios_tmp_t, { dir file })
manage_files_pattern(nagios_t, nagios_var_run_t, nagios_var_run_t)
files_pid_filetrans(nagios_t, nagios_var_run_t, file)
manage_fifo_files_pattern(nagios_t, nagios_spool_t, nagios_spool_t)
manage_files_pattern(nagios_t, nagios_spool_t, nagios_spool_t)
manage_sock_files_pattern(nagios_t, nagios_spool_t, nagios_spool_t)
files_spool_filetrans(nagios_t, nagios_spool_t, { file fifo_file })
allow nagios_t nagios_spool_t:file map;
manage_files_pattern(nagios_t, nagios_var_lib_t, nagios_var_lib_t)
manage_fifo_files_pattern(nagios_t, nagios_var_lib_t, nagios_var_lib_t)
manage_dirs_pattern(nagios_t, nagios_var_lib_t, nagios_var_lib_t)
files_var_lib_filetrans(nagios_t, nagios_var_lib_t, { dir file fifo_file })
kernel_read_system_state(nagios_t)
kernel_read_kernel_sysctls(nagios_t)
kernel_read_software_raid_state(nagios_t)
corecmd_exec_bin(nagios_t)
corecmd_exec_shell(nagios_t)
corenet_all_recvfrom_netlabel(nagios_t)
corenet_tcp_sendrecv_generic_if(nagios_t)
corenet_tcp_sendrecv_generic_node(nagios_t)
corenet_sendrecv_all_client_packets(nagios_t)
corenet_tcp_connect_all_ports(nagios_t)
corenet_tcp_sendrecv_all_ports(nagios_t)
corenet_dontaudit_tcp_bind_all_reserved_ports(nagios_t)
corenet_dontaudit_udp_bind_all_reserved_ports(nagios_t)
dev_read_sysfs(nagios_t)
dev_read_urand(nagios_t)
domain_use_interactive_fds(nagios_t)
domain_read_all_domains_state(nagios_t)
files_read_etc_runtime_files(nagios_t)
files_read_kernel_symbol_table(nagios_t)
files_search_spool(nagios_t)
fs_getattr_all_fs(nagios_t)
fs_search_auto_mountpoints(nagios_t)
fs_search_cgroup_dirs(nagios_t)
hostname_exec(nagios_t)
auth_use_nsswitch(nagios_t)
logging_send_syslog_msg(nagios_t)
libs_exec_ldconfig(nagios_t)
userdom_dontaudit_use_unpriv_user_fds(nagios_t)
userdom_dontaudit_search_user_home_dirs(nagios_t)
mta_send_mail(nagios_t)
mta_signal_system_mail(nagios_t)
mta_kill_system_mail(nagios_t)
systemd_exec_systemctl(nagios_t)
tunable_policy(`nagios_run_sudo',`
allow nagios_t self:capability { chown setgid setuid sys_ptrace sys_resource };
allow nagios_t self:process { setrlimit setsched };
allow nagios_t self:key write;
allow nagios_t self:passwd { passwd rootok };
auth_rw_lastlog(nagios_t)
auth_rw_faillog(nagios_t)
auth_domtrans_chkpwd(nagios_t)
selinux_compute_access_vector(nagios_t)
systemd_write_inherited_logind_sessions_pipes(nagios_t)
systemd_dbus_chat_logind(nagios_t)
logging_send_audit_msgs(nagios_t)
')
optional_policy(`
apache_systemctl(nagios_t)
')
optional_policy(`
dbus_system_bus_client(nagios_t)
')
optional_policy(`
tunable_policy(`nagios_run_sudo',`
sudo_exec(nagios_t)
sudo_manage_db(nagios_t)
')
')
optional_policy(`
tunable_policy(`nagios_run_sudo',`
init_read_utmp(nagios_t)
')
')
tunable_policy(`nagios_run_pnp4nagios',`
allow nagios_t nagios_log_t:file execute;
')
tunable_policy(`nagios_use_nfs',`
fs_manage_nfs_files(nagios_t)
fs_manage_nfs_dirs(nagios_t)
fs_manage_nfs_symlinks(nagios_t)
')
optional_policy(`
netutils_kill_ping(nagios_t)
')
optional_policy(`
seutil_sigchld_newrole(nagios_t)
')
optional_policy(`
udev_read_db(nagios_t)
')
########################################
#
# CGI local policy
#
optional_policy(`
apache_content_template(nagios)
apache_content_alias_template(nagios, nagios)
typealias nagios_script_t alias nagios_cgi_t;
typealias nagios_script_exec_t alias nagios_cgi_exec_t;
allow nagios_script_t self:process signal_perms;
read_files_pattern(nagios_script_t, nagios_t, nagios_t)
read_lnk_files_pattern(nagios_script_t, nagios_t, nagios_t)
allow nagios_script_t nagios_etc_t:dir list_dir_perms;
allow nagios_script_t nagios_etc_t:file { map read_file_perms };
allow nagios_script_t nagios_etc_t:lnk_file read_lnk_file_perms;
files_search_spool(nagios_script_t)
rw_fifo_files_pattern(nagios_script_t, nagios_spool_t, nagios_spool_t)
read_files_pattern(nagios_script_t, nagios_spool_t, nagios_spool_t)
allow nagios_script_t nagios_spool_t:file map;
allow nagios_script_t nagios_log_t:dir list_dir_perms;
read_files_pattern(nagios_script_t, nagios_etc_t, nagios_log_t)
read_lnk_files_pattern(nagios_script_t, nagios_etc_t, nagios_log_t)
allow nagios_script_t nagios_log_t:file map;
kernel_read_system_state(nagios_script_t)
domain_dontaudit_read_all_domains_state(nagios_script_t)
files_read_etc_runtime_files(nagios_script_t)
files_read_kernel_symbol_table(nagios_script_t)
dev_list_sysfs(nagios_script_t)
logging_send_syslog_msg(nagios_script_t)
')
########################################
#
# Nrpe local policy
#
allow nrpe_t self:capability { kill setgid setuid };
dontaudit nrpe_t self:capability { sys_resource sys_tty_config };
allow nrpe_t self:process { setpgid setrlimit setsched signal_perms };
allow nrpe_t self:fifo_file rw_fifo_file_perms;
allow nrpe_t self:tcp_socket { accept listen };
allow nrpe_t nagios_plugin_domain:process { sigkill signal };
list_dirs_pattern(nrpe_t, nrpe_etc_t, nrpe_etc_t)
read_files_pattern(nrpe_t, nagios_etc_t, nrpe_etc_t)
manage_files_pattern(nrpe_t, nrpe_var_run_t, nrpe_var_run_t)
files_pid_filetrans(nrpe_t, nrpe_var_run_t, file)
domtrans_pattern(nrpe_t, nagios_checkdisk_plugin_exec_t, nagios_checkdisk_plugin_t)
kernel_read_system_state(nrpe_t)
kernel_read_kernel_sysctls(nrpe_t)
kernel_read_software_raid_state(nrpe_t)
kernel_read_fs_sysctls(nrpe_t)
can_exec(nagios_t, nagios_exec_t)
corecmd_exec_bin(nrpe_t)
corecmd_exec_shell(nrpe_t)
corenet_all_recvfrom_unlabeled(nrpe_t)
corenet_all_recvfrom_netlabel(nrpe_t)
corenet_tcp_sendrecv_generic_if(nrpe_t)
corenet_tcp_sendrecv_generic_node(nrpe_t)
corenet_tcp_bind_generic_node(nrpe_t)
corenet_sendrecv_inetd_child_server_packets(nrpe_t)
corenet_tcp_bind_inetd_child_port(nrpe_t)
corenet_tcp_sendrecv_inetd_child_port(nrpe_t)
dev_read_sysfs(nrpe_t)
dev_read_urand(nrpe_t)
dev_rw_lvm_control(nrpe_t)
domain_use_interactive_fds(nrpe_t)
domain_read_all_domains_state(nrpe_t)
files_list_var(nrpe_t)
files_read_etc_runtime_files(nrpe_t)
fs_getattr_all_fs(nrpe_t)
fs_search_auto_mountpoints(nrpe_t)
auth_use_nsswitch(nrpe_t)
logging_send_syslog_msg(nrpe_t)
userdom_dontaudit_use_unpriv_user_fds(nrpe_t)
tunable_policy(`nagios_run_sudo',`
allow nrpe_t self:capability { setgid setuid sys_ptrace sys_resource };
allow nrpe_t self:process { setrlimit setsched };
allow nrpe_t self:key write;
allow nrpe_t self:passwd { passwd rootok };
auth_rw_lastlog(nrpe_t)
auth_rw_faillog(nrpe_t)
auth_domtrans_chkpwd(nrpe_t)
init_read_utmp(nrpe_t)
selinux_compute_access_vector(nrpe_t)
systemd_write_inherited_logind_sessions_pipes(nrpe_t)
systemd_dbus_chat_logind(nrpe_t)
logging_send_audit_msgs(nrpe_t)
')
optional_policy(`
tunable_policy(`nagios_run_sudo',`
sudo_exec(nrpe_t)
sudo_manage_db(nrpe_t)
')
')
optional_policy(`
tunable_policy(`nagios_run_sudo',`
sssd_read_config(nrpe_t)
sssd_manage_lib_files(nrpe_t)
sssd_read_pid_files(nrpe_t)
sssd_signull(nrpe_t)
')
')
tunable_policy(`nagios_use_nfs',`
fs_manage_nfs_files(nrpe_t)
fs_manage_nfs_dirs(nrpe_t)
fs_manage_nfs_symlinks(nrpe_t)
')
optional_policy(`
dbus_system_bus_client(nrpe_t)
')
optional_policy(`
inetd_tcp_service_domain(nrpe_t, nrpe_exec_t)
')
optional_policy(`
lvm_read_metadata(nrpe_t)
')
optional_policy(`
mta_send_mail(nrpe_t)
')
optional_policy(`
seutil_sigchld_newrole(nrpe_t)
')
optional_policy(`
tcpd_wrapped_domain(nrpe_t, nrpe_exec_t)
')
optional_policy(`
udev_read_db(nrpe_t)
')
#####################################
#
# Admin local policy
#
corecmd_read_bin_files(nagios_admin_plugin_t)
corecmd_read_bin_symlinks(nagios_admin_plugin_t)
dev_getattr_all_chr_files(nagios_admin_plugin_t)
dev_getattr_all_blk_files(nagios_admin_plugin_t)
files_getattr_all_dirs(nagios_admin_plugin_t)
files_getattr_all_files(nagios_admin_plugin_t)
files_getattr_all_symlinks(nagios_admin_plugin_t)
files_getattr_all_pipes(nagios_admin_plugin_t)
files_getattr_all_sockets(nagios_admin_plugin_t)
files_getattr_all_file_type_fs(nagios_admin_plugin_t)
######################################
#
# Mail local policy
#
allow nagios_mail_plugin_t self:capability { dac_read_search setgid setuid };
allow nagios_mail_plugin_t self:netlink_route_socket r_netlink_socket_perms;
allow nagios_mail_plugin_t self:tcp_socket create_stream_socket_perms;
allow nagios_mail_plugin_t self:udp_socket create_socket_perms;
kernel_read_kernel_sysctls(nagios_mail_plugin_t)
corecmd_read_bin_files(nagios_mail_plugin_t)
corecmd_read_bin_symlinks(nagios_mail_plugin_t)
logging_send_syslog_msg(nagios_mail_plugin_t)
sysnet_dns_name_resolve(nagios_mail_plugin_t)
optional_policy(`
mta_send_mail(nagios_mail_plugin_t)
')
optional_policy(`
nscd_dontaudit_search_pid(nagios_mail_plugin_t)
')
optional_policy(`
postfix_stream_connect_master(nagios_mail_plugin_t)
postfix_exec_postqueue(nagios_mail_plugin_t)
')
######################################
#
# Disk local policy
#
allow nagios_checkdisk_plugin_t self:capability { sys_admin sys_rawio };
kernel_read_software_raid_state(nagios_checkdisk_plugin_t)
corecmd_exec_bin(nagios_checkdisk_plugin_t)
files_getattr_all_dirs(nagios_checkdisk_plugin_t)
files_getattr_all_mountpoints(nagios_checkdisk_plugin_t)
files_read_etc_runtime_files(nagios_checkdisk_plugin_t)
fs_read_configfs_files(nagios_checkdisk_plugin_t)
fs_read_configfs_dirs(nagios_checkdisk_plugin_t)
fs_getattr_all_fs(nagios_checkdisk_plugin_t)
storage_raw_read_fixed_disk(nagios_checkdisk_plugin_t)
#######################################
#
# Services local policy
#
allow nagios_services_plugin_t self:capability { net_bind_service net_raw setuid };
allow nagios_services_plugin_t self:process { sigkill signal };
allow nagios_services_plugin_t self:tcp_socket create_stream_socket_perms;
allow nagios_services_plugin_t self:udp_socket create_socket_perms;
allow nagios_services_plugin_t self:unix_dgram_socket create_socket_perms;
allow nagios_services_plugin_t self:rawip_socket create_socket_perms;
corecmd_exec_bin(nagios_services_plugin_t)
corenet_all_recvfrom_unlabeled(nagios_services_plugin_t)
corenet_all_recvfrom_netlabel(nagios_services_plugin_t)
corenet_tcp_sendrecv_generic_if(nagios_services_plugin_t)
corenet_udp_sendrecv_generic_if(nagios_services_plugin_t)
corenet_tcp_sendrecv_generic_node(nagios_services_plugin_t)
corenet_udp_sendrecv_generic_node(nagios_services_plugin_t)
corenet_udp_bind_generic_node(nagios_services_plugin_t)
corenet_sendrecv_all_client_packets(nagios_services_plugin_t)
corenet_tcp_connect_all_ports(nagios_services_plugin_t)
corenet_tcp_sendrecv_all_ports(nagios_services_plugin_t)
corenet_sendrecv_dhcpc_server_packets(nagios_services_plugin_t)
corenet_udp_bind_dhcpc_port(nagios_services_plugin_t)
corenet_udp_sendrecv_dhcpc_port(nagios_services_plugin_t)
auth_use_nsswitch(nagios_services_plugin_t)
domain_read_all_domains_state(nagios_services_plugin_t)
logging_send_syslog_msg(nagios_services_plugin_t)
optional_policy(`
netutils_domtrans_ping(nagios_services_plugin_t)
netutils_signal_ping(nagios_services_plugin_t)
netutils_kill_ping(nagios_services_plugin_t)
')
optional_policy(`
mysql_stream_connect(nagios_services_plugin_t)
mysql_read_config(nagios_services_plugin_t)
')
optional_policy(`
postgresql_stream_connect(nagios_services_plugin_t)
')
optional_policy(`
snmp_read_snmp_var_lib_files(nagios_services_plugin_t)
')
######################################
#
# System local policy
#
allow nagios_system_plugin_t self:capability { dac_read_search };
dontaudit nagios_system_plugin_t self:capability { setgid setuid };
allow nagios_system_plugin_t nrpe_exec_t:file read_file_perms;
allow nagios_system_plugin_t nagios_exec_t:file read_file_perms;
read_files_pattern(nagios_system_plugin_t, nagios_log_t, nagios_log_t)
read_files_pattern(nagios_system_plugin_t, nagios_spool_t, nagios_spool_t)
manage_files_pattern(nagios_system_plugin_t, nagios_system_plugin_tmp_t, nagios_system_plugin_tmp_t)
manage_dirs_pattern(nagios_system_plugin_t, nagios_system_plugin_tmp_t, nagios_system_plugin_tmp_t)
files_tmp_filetrans(nagios_system_plugin_t, nagios_system_plugin_tmp_t, { dir file })
kernel_read_system_state(nagios_system_plugin_t)
kernel_read_kernel_sysctls(nagios_system_plugin_t)
corecmd_exec_bin(nagios_system_plugin_t)
corecmd_exec_shell(nagios_system_plugin_t)
corecmd_getattr_all_executables(nagios_system_plugin_t)
dev_read_sysfs(nagios_system_plugin_t)
domain_read_all_domains_state(nagios_system_plugin_t)
fs_getattr_all_fs(nagios_system_plugin_t)
auth_read_passwd(nagios_system_plugin_t)
optional_policy(`
init_read_utmp(nagios_system_plugin_t)
')
optional_policy(`
mrtg_read_lib_files(nagios_system_plugin_t)
')
#######################################
#
# Event local policy
#
manage_files_pattern(nagios_eventhandler_plugin_t, nagios_eventhandler_plugin_tmp_t, nagios_eventhandler_plugin_tmp_t)
manage_dirs_pattern(nagios_eventhandler_plugin_t, nagios_eventhandler_plugin_tmp_t, nagios_eventhandler_plugin_tmp_t)
files_tmp_filetrans(nagios_eventhandler_plugin_t, nagios_eventhandler_plugin_tmp_t, { dir file })
corecmd_exec_bin(nagios_eventhandler_plugin_t)
corecmd_exec_shell(nagios_eventhandler_plugin_t)
init_domtrans_script(nagios_eventhandler_plugin_t)
systemd_exec_systemctl(nagios_eventhandler_plugin_t)
allow nagios_t nagios_eventhandler_plugin_exec_t:dir list_dir_perms;
optional_policy(`
unconfined_domain(nagios_eventhandler_plugin_t)
')
########################################
#
# nagios openshift plugin policy
#
allow nagios_openshift_plugin_t self:capability sys_ptrace;
manage_dirs_pattern(nagios_openshift_plugin_t, nagios_openshift_plugin_tmp_t, nagios_openshift_plugin_tmp_t)
manage_files_pattern(nagios_openshift_plugin_t, nagios_openshift_plugin_tmp_t, nagios_openshift_plugin_tmp_t)
files_tmp_filetrans(nagios_openshift_plugin_t, nagios_openshift_plugin_tmp_t, { file dir })
corecmd_exec_bin(nagios_openshift_plugin_t)
corecmd_exec_shell(nagios_openshift_plugin_t)
domain_read_all_domains_state(nagios_openshift_plugin_t)
fs_getattr_all_fs(nagios_openshift_plugin_t)
optional_policy(`
apache_read_config(nagios_openshift_plugin_t)
')
######################################
#
# nagios plugin domain policy
#
optional_policy(`
unconfined_domain(nagios_unconfined_plugin_t)
')
optional_policy(`
systemd_dbus_chat_logind(nagios_unconfined_plugin_t)
')

1
nagios.tmpfiles.conf Normal file
View file

@ -0,0 +1 @@
D /run/nagios 0755 nagios nagios -

View file

@ -0,0 +1,22 @@
Nagios v4 Upgrade Considerations
================================
This applies if you are upgrading from Nagios v2 or v3.
The Nagios v2 or v3 nagios.cfg is will not pass a Nagios v4 syntax check without modification. Also note that Nagios Core v4 has more strict host/service definition requirements.
The following attributes from Nagios v2 or v3 are incompatible with Nagios v4 and will generate an error.
use_embedded_perl_implicitly
sleep_time
p1_file
external_command_buffer_slots
enable_embedded_perl
command_check_interval
In order to force a Nagios v2 or v3 nagios.cfg file to run with Nagios v4 simply commment out these nagios.cfg lines.
The included script UpgradeToVersion4.sh will do this automatically for the file
/etc/nagios/nagios.cfg (the standard location for the nagios.cfg file)
This is a work-around and you should consider implementing the new nagios.cfg file.

45
nagios.upgrade_to_v4.sh Normal file
View file

@ -0,0 +1,45 @@
#!/bin/sh
# this script checks the nagios.cfg file and comments out several lines in accordance with the README.
# You will want to migrate to the Nagios v4 nagios.cfg file as soon as possible to take advantage of new features.
# this is the nagios.cfg file we will modify
nagios_cfg=/etc/nagios/nagios.cfg
tmp1=`mktemp /tmp/nagios.cfg.XXXXXXXX`
cat $nagios_cfg > $tmp1
# search for and replace the check_result_buffer_slots attribute into a temporary file
sed -i --regexp-extended -e "s/^(\s*check_result_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g" \
-e 's/^(\s*use_embedded_perl_implicitly\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
-e 's/^(\s*sleep_time\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
-e 's/^(\s*p1_file\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
-e 's/^(\s*external_command_buffer_slots\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
-e 's/^(\s*enable_embedded_perl\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
-e 's/^(\s*command_check_interval\s*=\s*)/# Line Commented out for Nagios v4 Compatibility\n#\1/g' \
-e 's|^(\s*#?query_socket\s*=\s*/var/log/nagios/rw/nagios.qh)|query_socket=/var/spool/nagios/cmd/nagios.qh|' $tmp1
# add query_socket if none exist
grep -q -F 'query_socket' $tmp1 || echo 'query_socket=/var/spool/nagios/cmd/nagios.qh' >> $tmp1
# check the diff
diff_output=`diff -u $nagios_cfg $tmp1`
diff_exit=$?
# Decide whether or not to replace the file
if [ "$diff_exit" = "0" ]; then
echo "No changes were made to the Nagios Config file: $nagios_cfg"
elif [ "$diff_exit" = "1" ]; then
echo "The following changes were made to the Nagios Config file: $nagios_cfg"
echo "previous config has been saved to $nagios_cfg.oldrpm"
echo "$diff_output"
# since changes were made, move the temp file into place
cp $nagios_cfg $nagios_cfg.oldrpm
cat $tmp1 > $nagios_cfg
else
echo "ERROR: Unexpected exit code from diff. No changes made to file: $nagios_cfg"
fi
rm -f $tmp1

0
nagios_epel.fc Normal file
View file

39
nagios_epel6.te Normal file
View file

@ -0,0 +1,39 @@
module nagios_epel 1.1;
require {
type devlog_t;
type hostname_exec_t;
type kernel_t;
type ldconfig_exec_t;
type initrc_tmp_t;
type nagios_exec_t;
type httpd_nagios_script_t;
type nagios_services_plugin_t;
type nagios_spool_t;
type nagios_system_plugin_t;
type nagios_t;
class capability chown;
class file { execute execute_no_trans getattr open read };
class sock_file { write create unlink };
class unix_dgram_socket { connect create sendto };
class unix_stream_socket connectto;
}
#============= nagios_services_plugin_t ==============
allow nagios_services_plugin_t devlog_t:sock_file write;
allow nagios_services_plugin_t kernel_t:unix_dgram_socket sendto;
allow nagios_services_plugin_t self:unix_dgram_socket { connect create };
#============= nagios_t ==============
allow nagios_t hostname_exec_t:file { read getattr open execute execute_no_trans };
allow nagios_t ldconfig_exec_t:file { execute execute_no_trans open read };
allow nagios_t nagios_exec_t:file execute_no_trans;
allow nagios_t nagios_spool_t:sock_file { write create unlink };
allow nagios_t self:capability chown;
allow nagios_t self:unix_stream_socket connectto;
#============= httpd_nagios_script_t ==============
allow httpd_nagios_script_t nagios_spool_t:file { getattr open read };
#============= nagios_system_plugin_t ==============
allow nagios_system_plugin_t nagios_spool_t:file { getattr open read };

39
nagios_epel7.te Normal file
View file

@ -0,0 +1,39 @@
module nagios_epel 1.1;
require {
type devlog_t;
type hostname_exec_t;
type kernel_t;
type ldconfig_exec_t;
type initrc_tmp_t;
type nagios_exec_t;
type nagios_script_t;
type nagios_services_plugin_t;
type nagios_spool_t;
type nagios_system_plugin_t;
type nagios_t;
class capability chown;
class file { execute execute_no_trans getattr open read };
class sock_file { write create unlink };
class unix_dgram_socket { connect create sendto };
class unix_stream_socket connectto;
}
#============= nagios_services_plugin_t ==============
allow nagios_services_plugin_t devlog_t:sock_file write;
allow nagios_services_plugin_t kernel_t:unix_dgram_socket sendto;
allow nagios_services_plugin_t self:unix_dgram_socket { connect create };
#============= nagios_t ==============
allow nagios_t hostname_exec_t:file { read getattr open execute execute_no_trans };
allow nagios_t ldconfig_exec_t:file { execute execute_no_trans open read };
allow nagios_t nagios_exec_t:file execute_no_trans;
allow nagios_t nagios_spool_t:sock_file { write create unlink };
allow nagios_t self:capability chown;
allow nagios_t self:unix_stream_socket connectto;
#============= nagios_script_t ==============
allow nagios_script_t nagios_spool_t:file { getattr open read };
#============= nagios_system_plugin_t ==============
allow nagios_system_plugin_t nagios_spool_t:file { getattr open read };

BIN
printer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
router.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

1
sources Normal file
View file

@ -0,0 +1 @@
SHA512 (nagioscore-nagios-4.5.9.tar.gz) = 90bd71f772b6686b32fbe5f543468938f0dfc9c5bade1d41c27d63b1971d5000d16d6ca843b3eccab5550daa1bc649f16e8d68890052149126601a060ac9230d

BIN
switch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

41
tests/tests-DSP.yml Normal file
View file

@ -0,0 +1,41 @@
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
repositories:
- repo: https://pagure.io/DSP_test.git
dest: DSP_test
version: master
tests:
- DSP_test
environment:
# RPM package containing the policy module
TEST_RPM: nagios-selinux
# policy module name
TEST_POLICY: nagios
# policy sources will be extracted from corresponding .src.rpm
# policy tar filename regexp (e.g. "usbguard-selinux*.tar.gz")
# or empty string if policy sources are not inside a tar archive
POLICY_TAR: ''
# path to policy sources (in of the tar archive) -- <POLICY_TAR>/<POLICY_PATH>/<TEST_POLICY>.(te|if|fc)
# or path in the src.rpm if there is no tar archive -- <src.rpm>/<POLICY_PATH>/<TEST_POLICY>.(te|if|fc)
# can contain wildcards (e.g. for versions etc.)
POLICY_PATH: .
# allow rules ignored by "Unsound/dangerous policy practices" test
IGNORE_RULES: >-
nagios_script_t:system_map_t:file
nagios_script_t:boot_t:dir
required_packages:
- policycoreutils
- selinux-policy
- selinux-policy-targeted
- setools-console
- libselinux-utils
- rpm
- tar
- git
- nagios-selinux