commit 95ff8a04c2cb09f13a2283f45fe514fa013211ec
Author: Xavier Bachelot <xavier(a)bachelot.org>
Date: Mon Aug 12 15:48:50 2019 +0200
Update to 2.0.6
nrdp-config.inc.php | 145 +++++++++++++++++++++++++++++++++++++++++++---------
nrdp.spec | 33 ++++++------
2 files changed, 137 insertions(+), 41 deletions(-)
---
diff --git a/nrdp-config.inc.php b/nrdp-config.inc.php
index 7095255..b22cf6c 100644
--- a/nrdp-config.inc.php
+++ b/nrdp-config.inc.php
@@ -1,76 +1,171 @@
<?php
+/*****************************************************************************
+ *
+ *
+ * NRDP Configuration file
+ *
+ *
+ * Copyright (c) 2008-2018 - Nagios Enterprises, LLC. All rights reserved.
+ *
+ * License: GNU General Public License version 3
+ *
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <
https://www.gnu.org/licenses/>.
+ *
+ *****************************************************************************/
+
+
+
+/////////////////////////////////////////////////////////////
//
-// NRDP Config File
+// authorized_tokens
//
-// Copyright (c) 2010-2017 - Nagios Enterprises, LLC.
-// License: Nagios Open Software License <
http://www.nagios.com/legal/licenses>
-//
-
// An array of one or more tokens that are valid for this NRDP install
// a client request must contain a valid token in order for the NRDP to response or honor
the request
// NOTE: Tokens are just alphanumeric strings - make them hard to guess!
-$cfg['authorized_tokens'] = array(
- //"mysecrettoken", // <-- not a good token
- //"90dfs7jwn3", // <-- a better token (don't use this exact one,
make your own)
+
+$cfg["authorized_tokens"] = array(
+ // "mysecrettoken", // <-- not a good token
+ // "90dfs7jwn3", // <-- a better token (don't use this exact
one, make your own)
);
+
+
+/////////////////////////////////////////////////////////////
+//
+// external_commands_deny_tokens
+//
// By default, all authorized tokens are allowed to submit any
// external command (unless it's disable below)
// This is a deny mapping in the form of COMMAND => TOKEN or TOKENS
// You can specify a whole command, or use * as a wildcard
-// Or you can specify 'all' to stop any token from using any external command
+// Or you can specify "all" to stop any token from using any external command
// the tokens specified can either be a string with 1 token, or an array of 1 or more
tokens
-$cfg['external_commands_deny_tokens'] = array(
-// "ACKNOWLEDGE_HOST_PROBLEM" => array("mysecrettoken",
"myothertoken"),
-// "ACKNOWLEDGE_SVC_PROBLEM" => "mysecrettoken",
-// "all" => array("mysecrettoken", "myothertoken"),
-// "ACKNOWLEDGE_*" => "mysecrettoken",
-// "*_HOST_*" => array("mysecrettoken",
"myothertoken"),
+
+$cfg["external_commands_deny_tokens"] = array(
+ // "ACKNOWLEDGE_HOST_PROBLEM" => array("mysecrettoken",
"myothertoken"),
+ // "ACKNOWLEDGE_SVC_PROBLEM" => "mysecrettoken",
+ // "all" => array("mysecrettoken",
"myothertoken"),
+ // "ACKNOWLEDGE_*" => "mysecrettoken",
+ // "*_HOST_*" => array("mysecrettoken",
"myothertoken"),
);
-
+
+
+/////////////////////////////////////////////////////////////
+//
+// require_https
+//
// Do we require that HTTPS be used to access NRDP?
-// set this value to 'false' to disable HTTPS requirement
+// set this value to false to disable HTTPS requirement
+
$cfg["require_https"] = false;
+
+
+/////////////////////////////////////////////////////////////
+//
+// require_basic_auth
+//
// Do we require that basic authentication be used to access NRDP?
-// set this value to 'false' to disable basic auth requirement
+// set this value to false to disable basic auth requirement
+
$cfg["require_basic_auth"] = false;
+
+
+/////////////////////////////////////////////////////////////
+//
+// valid_basic_auth_users
+//
// What basic authentication users are allowed to access NRDP?
// comment this variable out to allow all authenticated users access to the NRDP
+
$cfg["valid_basic_auth_users"] = array(
"nrdpuser"
);
-
+
+
+
+/////////////////////////////////////////////////////////////
+//
+// nagios_command_group
+//
// The name of the system group that has write permissions to the external command file
// this group is also used to set file permissions when writing bulk commands or passive
check results
// NOTE: both the Apache and Nagios users must be a member of this group
+
$cfg["nagios_command_group"] = "nagios";
+
+
+/////////////////////////////////////////////////////////////
+//
+// command_file
+//
// Full path to Nagios external command file
+
$cfg["command_file"] = "/var/spool/nagios/cmd/nagios.cmd";
+
+
+/////////////////////////////////////////////////////////////
+//
+// check_results_dir
+//
// Full path to check results spool directory
+
$cfg["check_results_dir"] = "/var/log/nagios/spool/checkresults";
+
+
+/////////////////////////////////////////////////////////////
+//
+// disable_external_commands
+//
// Should we allow external commands? Set to true or false (Boolean, not a string)
+
$cfg["disable_external_commands"] = false;
+
+
+/////////////////////////////////////////////////////////////
+//
+// allow_old_results
+//
// Allows Nagios XI to send old check results directly into NDO if configured
+
$cfg["allow_old_results"] = false;
+
+
+/////////////////////////////////////////////////////////////
+//
+// debug
+//
// Enable debug logging
-$cfg["debug"] = false;
-// Where should the logs go?
-$cfg["debug_log"] = "/usr/local/nrdp/server/debug.log";
+$cfg["debug"] = false;
-///////// DONT MODIFY ANYTHING BELOW THIS LINE /////////
-$cfg['product_name'] = 'nrdp';
-$cfg['product_version'] = '1.5.0'
+/////////////////////////////////////////////////////////////
+//
+// debug_log
+//
+// Where should the logs go?
+$cfg["debug_log"] = "/usr/local/nrdp/server/debug.log";
?>
diff --git a/nrdp.spec b/nrdp.spec
index 47116e7..7552301 100644
--- a/nrdp.spec
+++ b/nrdp.spec
@@ -1,16 +1,17 @@
-# TODO: unbundle JS from server/includes
-# - jquery 3.2.1
-# - bootstrap 4.0.0-beta2
+# TODO: Unbundle JS from server/includes
+# - jquery 3.6.0 (Done for Fedora)
+# - bootstrap 4.6.0
+
+%global unbundle_jquery 0%{?fedora}%{?el8}%{?el9}%{?el10}
Name: nrdp
-Version: 1.5.2
-Release: 14%{?dist}
+Version: 2.0.6
+Release: 1%{?dist}
Summary: Nagios Remote Data Processor
-# NRDP php client is BSD
# Bundled jquery and boostrap are MIT
-# Everything else is Nagios Open Software License (which is non-free)
-License: Nagios Open Software License and BSD and MIT
+# Everything else is GPLv3
+License: GPL-3.0-only and MIT
URL:
https://github.com/NagiosEnterprises/nrdp
Source0:
https://github.com/NagiosEnterprises/%{name}/archive/%{version}/%{name}-%...
Source1: %{name}-httpd.conf
@@ -27,8 +28,8 @@ Requires: php(httpd)
Requires: mod_php
%endif
-Provides: bundled(js-jquery) = 3.2.1
-Provides: bundled(js-bootstrap) = 4.0.0
+Provides: bundled(js-jquery) = 3.6.0
+Provides: bundled(js-bootstrap) = 4.6.0
%description
@@ -46,7 +47,6 @@ A shell script to send NRDP data to a Nagios server.
%package client-php
Summary: Send NRDP php script for Nagios
-License: BSD
%description client-php
A php script to send NRDP data to a Nagios server.
@@ -59,11 +59,12 @@ A python script to send NRDP data to a Nagios server.
%prep
%setup -q
# Fix perms
-chmod a-x server/includes/bootstrap.bundle.min.js
-chmod a-x server/includes/bootstrap.min.css
-chmod a-x server/includes/jquery-3.2.1.min.js
+chmod a-x server/includes/bootstrap-4.6.0.bundle.min.js
+chmod a-x server/includes/bootstrap-4.6.0.min.css
+chmod a-x server/includes/jquery-3.6.0.min.js
# Fix shebang
-sed -i -e '1d;2i#!/usr/bin/python2' clients/send_nrdp.py
+sed -i -e '1d;2i#!/usr/bin/python3' clients/send_nrdp.py
+sed -i -e '1d;2i#!/usr/bin/python2' clients/send_nrdp_py2.py
# Fix EOL
sed -i "s|\r||g" clients/send_nrdp.php
@@ -78,7 +79,7 @@ mkdir -p %{buildroot}%{_datadir}/%{name}/
rm -f server/config.inc.php
cp -pr server/* %{buildroot}%{_datadir}/%{name}/
ln -s %{_sysconfdir}/%{name}/config.inc.php \
- ${RPM_BUILD_ROOT}%{_datadir}/%{name}/config.inc.php
+ %{buildroot}%{_datadir}/%{name}/config.inc.php
# Server conf file
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/
install -m 0644 -D -p %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}/config.inc.php