Hello community,
here is the log from the commit of package nagios.2698 for openSUSE:12.3:Update checked in at 2014-04-11 15:03:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.3:Update/nagios.2698 (Old)
and /work/SRC/openSUSE:12.3:Update/.nagios.2698.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nagios.2698"
Changes:
--------
New Changes file:
--- /dev/null 2014-02-13 01:09:38.344032506 +0100
+++ /work/SRC/openSUSE:12.3:Update/.nagios.2698.new/nagios.changes 2014-04-11 15:03:03.000000000 +0200
@@ -0,0 +1,1155 @@
+-------------------------------------------------------------------
+Fri Mar 28 21:06:03 UTC 2014 - lars@linux-schulserver.de
+
+- fix stack-based buffer overflow in the cmd_submitf function
+ in cgi/cmd.c - CVE-2014-1878 (bnc#864843)
+ nagios-CVE-2014-1878.patch
+
+-------------------------------------------------------------------
+Fri Dec 27 14:15:14 UTC 2013 - lrupp@suse.de
+
+- Fix possible denial of service in CGI executables:
+ * nagios-CVE-2013-7108.patch (bnc#856837)
+
+-------------------------------------------------------------------
+Fri Jun 28 08:24:42 UTC 2013 - lars@linux-schulserver.de
+
+- added nagios-CVE-2013-2214.patch fixing unauthorized host/service
+ views displayed in servicegroup view (bnc#827020)
+
+-------------------------------------------------------------------
+Sun Mar 17 21:22:07 UTC 2013 - lars@linux-schulserver.de
+
+- adapt static html pages to reflect the current version
+
+-------------------------------------------------------------------
+Sat Mar 16 15:37:12 UTC 2013 - schneemann@b1-systems.de
+
+- update to 3.5.0:
+ + Fixed bug #403: The "configuration" page of the webui doesn't use
+ entity encoding when displaying the "command expansion" item (Eric
+ Stanley, Phil Randal)
+ + Fixed bug #424: Nagios Core 3.4.4 seg fault (core dump) on restart
+ after removing config for running service (Eric Stanley)
+ + Updated CGI utility functions to support UTF-8 characters (Eric Stanley)
+ + Fixed bug where selecting Command Expansion from Configuration CGI
+ page would display commands instead (Eric Stanley)
+ + Fixed bug #369: status.cgi crashes with segfault when there are german
+ ulauts (äöüß) in the hostname or the servicename (Eric Stanley)
+ + Fixed bug #418: Scheduled Downtime Notifications Resent On Nagios
+ Restart/reload (Eric Stanley
+
+-------------------------------------------------------------------
+Wed Mar 13 15:51:51 UTC 2013 - lars@linux-schulserver.de
+
+- general update for 12.1, 12.2 and 12.3 for bnc#809180
+
+-------------------------------------------------------------------
+Thu Feb 14 09:50:37 UTC 2013 - lars@linux-schulserver.de
+
+- provide 'monitoring_daemon' in the init script to allow other
+ init scripts to depend on it
+
+-------------------------------------------------------------------
+Sat Jan 12 18:25:49 UTC 2013 - lars@linux-schulserver.de
+
+- update to 3.4.4:
+ + Fixed bug #408: service checks get duplicated on reload (Eric Stanley)
+ + Added NULL pointer checks to CGI code. (Eric Stanley)
+ + Fixed buffer overflow vulnerability in CGI code. Thanks to Neohapsis
+ for finding this. (Eric Stanley)
+- refreshed patches
+
+-------------------------------------------------------------------
+Wed Jan 9 11:10:21 CET 2013 - lars@linux-schulserver.de
+
+- added new subpackage nagios-www-dch (don't call home):
+ + add plain html pages to allow users to disable PHP and
+ loading of external references
+ + re-added documentation (no external link any more)
+
+-------------------------------------------------------------------
+Tue Jan 1 15:02:49 UTC 2013 - lars@linux-schulserver.de
+
+- use new rpm macros for basic user-/groupadd commands:
+ %%nagios_user_group_add
+ %%nagios_command_user_group_add
+
+-------------------------------------------------------------------
+Mon Dec 17 10:29:13 UTC 2012 - lars@linux-schulserver.de
+
+- update to 3.4.3:
+ * Applied fix for pagination and sorting on status.cgi #381
+ (Phil Randal)
+ * Fixed issue where deleting a downtime could cause Nagios to crash
+ (Eric Stanley)
+ * Corrected logic so that end times for flexible downtimes are
+ calculated from the downtime start rather than the current time
+ in the case where Nagios is restarted (Eric Stanley)
+ * Fixed issue introduced by fix for bug #124 where flexible
+ downtimes are not taken into account on Nagios restart.
+ (Scott Wilkerson, Eric Stanley)
+ * Fixed bug #247: If a service reports no performance data, the
+ perfdata log file has no line indicating the test.
+ (omnikron@free.fr)
+ * Fixed link for unhandled unreachable host problems on tactical
+ overview page (Rudolf Cejka)
+ * Fixed bug #345 with wild card searches not paging properly
+ on status.cgi (Phil Randal)
+ * Fixed bug #343 on status.cgi where Service Group Summary can
+ potentially show wrong totals (Mark Ziesemer)
+ * Fixed memory leaks on SIGHUP (Carlos Velasco)
+- refreshed patches
+- just require php not php5 to allow a switch to php53
+- do not compress logfiles per default to allow searching via
+ webinterface
+- init script now uses daemonchk.cgi to check for status (if present)
+
+-------------------------------------------------------------------
+Mon Nov 26 11:35:24 UTC 2012 - aeszter@gwdg.de
+
+- Use usermod instead of groupmod when suse_version > 1220 due to
+ pwdutils/shadow switch.
+
+-------------------------------------------------------------------
+Tue Nov 20 07:53:48 UTC 2012 - dimstar@opensuse.org
+
+- Fix useradd invocation: -o is useless without -u and newer
+ versions of pwdutils/shadowutils fail on this now.
+
+-------------------------------------------------------------------
+Thu Oct 11 12:24:39 UTC 2012 - lars@linux-schulserver.de
+
+- add virtual provides 'monitoring_daemon' and
+ 'monitoring_webfrontend' to allow 3rd party packages to run also
+ with compatible solutions like icinga
+
+-------------------------------------------------------------------
+Sun Jun 10 16:09:54 UTC 2012 - lars@linux-schulserver.de
+
+- remove checks.c-declare-temp_buffer.patch again as this is
+ fixed with the latest version
+- added manpages for {new,}mini_epn and convertcfg
+
+-------------------------------------------------------------------
+Mon Jun 4 00:20:17 CEST 2012 - ro@suse.de
+
+- update to 3.4.1
+ * Double quotes in check_command definition break functionality
+ (#332, reverts #86)
+
+-------------------------------------------------------------------
+Wed May 23 10:44:57 UTC 2012 - lars@linux-schulserver.de
+
+- run config check first before restart (init script)
+- ignore subsys-unsupported rpmlint check as the init script just
+ removes it
+
+-------------------------------------------------------------------
+Mon May 7 16:57:36 UTC 2012 - schneemann@b1-systems.de
+
+- update to 3.4.0
+ * Use execv() to execute active check commands (#86 - Ton Voon, dnsmichi)
+ * Added service_check_timeout_state configuration variable (Bill McGonigle)
+ * Permanently remove sleep on run_event == FALSE in main loop (Max
+ )
+ * Reduce notification load by moving notification viability check into
+ notification list creation (Opsview Team)
+ * Added code to apply allow_empty_hostgroup_assignment flag to host and
+ service dependencies (Daniel Wittenberg)
+ * Users can now see hostgroups and servicegroups that contain at least
+ one host or service they are authorized for, instead of having to be
+ authorized for them all (Ethan Galstad)
+ * RSS feed boxes fallback if an error occurs (Ethan Galstad)
+ * RSS feeds no longer block main page load (Mike Guthrie)
+
+ FIXES
+ * Fix $NOTIFICATIONRECIPIENTS$ macro to contain all contacts assigned to
+ host|service, not only notified contacts (Bug #98 Matt Harrington)
+ * Scheduled Downtime Notifications Resent On Nagios Restart/reload (Bug
+ #124 - ricardo)
+ * NOTIFICATIONTYPE MACRO never became CUSTOM (Bug #168 - Alexey
+ Dvoryanchikov)
+ * Plugged minor memory leaks in notification logic
+
+-------------------------------------------------------------------
+Wed Dec 7 14:04:52 UTC 2011 - chris@computersalat.de
+
+- fix p1.pl
+ * remove "^M" (antidos ;))
+
+-------------------------------------------------------------------
+Tue Nov 1 13:02:02 UTC 2011 - lars@linux-schulserver.de
+
+- skip fdupes call and ignore that we might save 4k on the disk
+ => fixes bnc #721346
+- fix file permissions in docudir
+- use nagios-rpm-macros
+
+-------------------------------------------------------------------
+Fri Oct 7 18:37:43 UTC 2011 - lars@linux-schulserver.de
+
+- also check (and fix) the ownership of the directory where
+ $status_file lives - Nagios uses this directory for temporary
+ files
+
+-------------------------------------------------------------------
+Mon Aug 1 18:43:41 UTC 2011 - schneemann@b1-systems.de
++++ 958 more lines (skipped)
++++ between /dev/null
++++ and /work/SRC/openSUSE:12.3:Update/.nagios.2698.new/nagios.changes
New:
----
convertcfg.8
mini_epn.8
nagios-3.0.6-docs.tar.bz2
nagios-3.5.0.tar.bz2
nagios-CVE-2013-2214.patch
nagios-CVE-2013-7108.patch
nagios-CVE-2014-1878.patch
nagios-README.SuSE
nagios-disable_phone_home.patch
nagios-fix_encoding_trends.cgi.patch
nagios-fix_spurious_dollar_signs_added_to_command_lines.patch
nagios-html-pages.tar.bz2
nagios-htpasswd.users
nagios-p1.pl-location.patch
nagios-rpmlintrc
nagios.8
nagios.changes
nagios.spec
nagios.sysconfig
nagiosstats.8
new_mini_epn.8
rcnagios
suse.de-nagios
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nagios.spec ++++++
#
# spec file for package nagios
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: nagios
Summary: The Nagios Network Monitor
License: GPL-2.0+
Group: System/Monitoring
Version: 3.5.0
Release: 0
Url: http://www.nagios.org/
Source0: %{name}-%{version}.tar.bz2
Source1: rc%{name}
Source2: convertcfg.8
Source3: %{name}.sysconfig
Source4: suse.de-nagios
Source5: nagios.8
Source6: nagiosstats.8
Source7: nagios-htpasswd.users
Source8: mini_epn.8
Source9: new_mini_epn.8
#
Source10: %{name}-README.SuSE
Source11: %{name}-html-pages.tar.bz2
Source12: %{name}-3.0.6-docs.tar.bz2
Source20: %{name}-rpmlintrc
# PATCH-FIX-UPSTREAM Fixes the output of spurious $ signs in commandoutput (deb#480001)
Patch2: nagios-fix_spurious_dollar_signs_added_to_command_lines.patch
# PATCH-FIX-UPSTREAM unescape hex characters in CGI input - avoid addional '+'
Patch3: nagios-fix_encoding_trends.cgi.patch
# PATCH-FIX-OPENSUSE openSUSE uses a special location for p1.pl
Patch10: nagios-p1.pl-location.patch
# PATCH-FIX-OPENSUSE disable Nagios online update checks for distributed packages
Patch11: nagios-disable_phone_home.patch
# PATCH-FIX-UPSTREAM fix CVE-2013-2214
Patch12: nagios-CVE-2013-2214.patch
# PATCH-FIX-UPSTREAM fix CVE-2013-7108
Patch13: nagios-CVE-2013-7108.patch
# PATCH-FIX-UPSTREAM fix CVE-2014-1878
Patch14: nagios-CVE-2014-1878.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: monitoring_daemon
PreReq: %fillup_prereq
PreReq: %insserv_prereq
PreReq: /bin/logger
PreReq: coreutils
PreReq: grep
PreReq: pwdutils
PreReq: sed
BuildRequires: apache2-devel
BuildRequires: freetype2-devel
BuildRequires: gd-devel
BuildRequires: iputils
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: mailx
BuildRequires: nagios-rpm-macros
BuildRequires: net-tools
BuildRequires: openssl-devel
BuildRequires: pcre-devel
BuildRequires: zlib-devel
%if 0%{?suse_version} < 1010
BuildRequires: XFree86-devel
BuildRequires: XFree86-libs
BuildRequires: libapr0
Requires: cron
%else
BuildRequires: libapr-util1-devel
BuildRequires: xorg-x11-devel
Recommends: cron
Recommends: %{name}-www
# we enable nagios embedded perl, but if people disable it...
Recommends: perl = %{perl_version}
%endif
%if 0%{?suse_version} > 1020
Recommends: %{name}-plugins
%else
Requires: %{name}-plugins
%endif
Requires: mailx
%define nslockfile_dir /var/run/%{name}
%define nslockfile %nslockfile_dir/%{name}.pid
%define apache2_sysconfdir %(/usr/sbin/apxs2 -q SYSCONFDIR)/conf.d
# Macro that print mesages to syslog at package (un)install time
%define nnmmsg logger -t %{name}/rpm
%description
Nagios is a program that will monitor hosts and services on your
network. It has the ability to email or page you when a problem arises
and when a problem is resolved. Nagios is written in C and is designed
to run under Linux (and some other *NIX variants) as a background
process, intermittently running checks on various services that you
specify.
The actual service checks are performed by separate "plugin" programs
which return the status of the checks to Nagios. The plugins are
available at http://sourceforge.net/projects/nagiosplug
This package provides core programs for Nagios. The web interface,
documentation, and development files are built as separate packages
%package www
Summary: Provides the HTML and CGI files for the Nagios web interface
Group: System/Monitoring
Provides: monitoring_webfrontend
PreReq: /bin/logger
PreReq: apache2
PreReq: coreutils
PreReq: gawk
PreReq: grep
PreReq: pwdutils
PreReq: sed
Requires: %{name} = %{version}
Requires: gd
Requires: mod_php_any
Requires: php
%description www
Nagios is a program that will monitor hosts and services on your
network. It has the ability to email or page you when a problem arises
and when a problem is resolved. Nagios is written in C and is designed
to run under Linux (and some other *NIX variants) as a background
process, intermittently running checks on various services that you
specify.
Several CGI programs are included with Nagios in order to allow you to
view the current service status, problem history, notification history,
and log file via the web. This package provides the HTML and CGI files
for the Nagios web interface. In addition, HTML documentation is
included in this package.
%package www-dch
Summary: HTML and CGI files that do not call home
Group: System/Monitoring
Requires: %{name}-www = %{version}
%description www-dch
Several CGI programs are included with Nagios in order to allow you to
view the current service status, problem history, notification history,
and log file via the web.
Since Version 3.1, some of those CGI files and the Nagios process itself
try to detect the latest version and fetching news feeds from the upstream
server www.nagios.org.
This additional package provides simply HTML files that do not "call
home" and also allow to run the web interface without PHP support.
There is also an offline version of the documentation included in this
package.
Please enable the flag "NAGIOSDCH" in the apache configuration.
Note: The HTML pages use 'side' and 'main' and frame targets.
%package devel
Summary: Development files for Nagios
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
Requires: gcc
%description devel
Nagios is a program that will monitor hosts and services on your
network. It has the ability to email or page you when a problem arises
and when a problem is resolved. Nagios is written in C and is designed
to run under Linux (and some other *NIX variants) as a background
process, intermittently running checks on various services that you
specify.
This package provides include files that Nagios-related applications
may compile against.
%prep
%setup -q -n %{name}
%patch2 -p0
%patch3 -p0
%patch10 -p0
%patch11 -p0
%patch12 -p1
%patch13 -p1
%patch14 -p1
find -name ".gitignore" | xargs rm
# fix p1.pl [dos]
perl -p -i -e 's|\r\n|\n|' contrib/p1.pl
# fix p1.pl pathname of mini_epn
sed -i 's|p1.pl|%{nagios_libdir}/p1.pl|g' contrib/mini_epn.c
sed -i 's|p1.pl|%{nagios_libdir}/p1.pl|g' contrib/new_mini_epn.c
# fix file permissions
chmod -x Changelog LEGAL LICENSE README
%build
# if the following command fails, then apache dependencies are not met
/usr/sbin/apxs2 -q DATADIR >/dev/null
%configure \
--prefix=%{_prefix} \
--exec-prefix=%{_sbindir} \
--bindir=%{_sbindir} \
--sbindir=%{nagios_cgidir} \
--libexecdir=%{nagios_plugindir} \
--datadir=%{nagios_datadir} \
--sysconfdir=%{nagios_sysconfdir} \
--with-init-dir=%{_sysconfdir}/init.d \
--localstatedir=%{nagios_localstatedir} \
--with-cgiurl=/%{name}/cgi-bin \
--with-htmurl=/%{name} \
--with-httpd-conf=%{apache2_sysconfdir} \
--with-checkresult-dir=%{nagios_spooldir} \
--with-lockfile=%{nslockfile} \
--with-nagios-user=%{nagios_user} \
--with-nagios-group=%{nagios_group} \
--with-command-user=%{nagios_command_user} \
--with-command-group=%{nagios_command_group} \
--with-gd-lib=%{_libdir} \
--with-gd-inc=%{_includedir} \
--with-template-objects \
--with-template-extinfo \
--with-perlcache \
--enable-event-broker \
--enable-embedded-perl
#
# /usr/bin/p1.pl is not a good place for a perl-_module_!
#
sed -i 's#@p1pldir@#%{nagios_libdir}#g' Makefile include/locations.h sample-config/nagios.cfg
#
# fix p1.pl debug-path
#
sed -i 's#/usr/local/nagios/var/#/var/log/%{name}/#g' p1.pl
# make rpmlint happy: add shebang to p1.pl
echo "#!/usr/bin/perl" > p1.pl.new
cat p1.pl >> p1.pl.new
mv p1.pl.new p1.pl
#
# make daemonchk.cgi and event handlers
#
make %{?jobs:-j%jobs} all
make %{?jobs:-j%jobs} -C contrib
pushd contrib/eventhandlers 1>/dev/null
for f in `find . -type f` ; do
F=`mktemp temp.XXXXXX`
sed "s=/usr/local/nagios/var/rw/=%{nagios_spooldir}/=; \
s=NscaBin\=\"/usr/local/nagios/libexec/send_nsca\"=NscaBin\=/usr/bin/send_nsca=; \
s=/usr/local/nagios/libexec/eventhandlers/=%{nagios_eventhandlerdir}/=; \
s=/usr/local/nagios/libexec/=%{nagios_plugindir}/=; \
s=/usr/local/nagios/etc/=%{nagios_sysconfdir}/=; \
s=/usr/local/nagios/test/var=%{nagios_logdir}/=" ${f} > ${F}
mv ${F} ${f}
done
popd 1>/dev/null
%install
mkdir -p %{buildroot}/%{nagios_logdir}/archives
mkdir -p %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%apache2_sysconfdir/
mkdir -p %{buildroot}%nslockfile_dir
%{__make} install install-commandmode install-config install-webconf install-classicui\
DESTDIR=%{buildroot} \
INSTALL_OPTS="" \
COMMAND_OPTS="" \
CGICFGDIR="%{nagios_sysconfdir}" \
INIT_OPTS=""
%{__make} install -C contrib \
DESTDIR=%{buildroot} \
INSTALL_OPTS=""
# install event handlers
%{__install} -d -m0755 %{buildroot}/%{nagios_eventhandlerdir}
%{__cp} -afpv contrib/eventhandlers/* %{buildroot}%{nagios_eventhandlerdir}/
find %{buildroot}%{nagios_eventhandlerdir}/ -type f -exec chmod +x {} \;
# install directory for event brokers like ndoutils
%{__install} -d -m0755 %{buildroot}%{nagios_localstatedir}/brokers
# install headers for development package
%{__install} -d -m0755 %{buildroot}%{_includedir}/%{name}/
pushd include
for file in *.h; do
if test "x${file}" != "xconfig.h" -a "x${file}" != "xsnprintf.h" -a "x${file}" != "xcgiutils.h" ; then
install -m 644 $file %{buildroot}%{_includedir}/%{name}/
fi;
done
popd
#
# cleanup sample-conf dir for including in docdir
#
find sample-config/ -name "*.in" -exec rm {} \;
find sample-config/ -name "*.in.orig" -exec rm {} \;
sed -e 's|command_file=.*|command_file=%{nagios_command_file}|g' \
-e 's|log_file=/var/lib/nagios/nagios.log|log_file=%{nagios_logdir}/nagios.log|g' \
-e 's|log_archive_path=/var/lib/nagios/archives|log_archive_path=%{nagios_logdir}/archives|g' \
-e 's|^lock_file=.*|lock_file=%nslockfile|g' \
%{buildroot}/%{nagios_sysconfdir}/nagios.cfg > %{buildroot}%{_sysconfdir}/%{name}/nagios.cfg.tmp
mv %{buildroot}/%{nagios_sysconfdir}/nagios.cfg.tmp %{buildroot}%{_sysconfdir}/%{name}/nagios.cfg
#
# install SuSE specials
#
# README.SuSE file
sed -e 's@DATADIR@%{_datadir}/%{name}@g' -e 's@SYSCONFDIR@%{nagios_sysconfdir}@g' %{S:10} > %_builddir/%{name}/README.SuSE
# init-script
%{__install} -D -m 0755 %{S:1} %{buildroot}%{_sysconfdir}/init.d/%{name}
ln -sf ../../etc/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
# sysconfig script
%{__install} -D -m 0644 %{S:3} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}
# install cronjob (gzip' the logfiles)
%{__install} -D -m 0755 %{S:4} %{buildroot}%{_sysconfdir}/cron.weekly/%{name}
# install htpasswd file
%{__install} -m 0640 %{S:7} %{buildroot}%{_sysconfdir}/%{name}/htpasswd.users
# important ghost files
touch %{buildroot}%{nagios_state_retention_file}
touch %{buildroot}%{nagios_status_file}
touch %{buildroot}%{nagios_logdir}/config.err
touch %{buildroot}%{nslockfile}
# install manpages
install -Dm644 %{S:5} %{buildroot}%{_mandir}/man8/%{name}.8
install -Dm644 %{S:6} %{buildroot}%{_mandir}/man8/nagiostats.8
install -Dm644 %{S:8} %{buildroot}%{_mandir}/man8/mini_epn.8
install -Dm644 %{S:9} %{buildroot}%{_mandir}/man8/new_mini_epn.8
install -Dm644 %{S:2} %{buildroot}%{_mandir}/man8/convertcfg.8
# fixing permissions the dirty way....
for file in "README sample-config/README sample-config/template-object/README"; do
chmod 644 $RPM_BUILD_DIR/%{name}/$file
done
# we use nagios_spooldir for this
test -d %{buildroot}%{nagios_localstatedir}/rw && rmdir %{buildroot}%{nagios_localstatedir}/rw
# install plain html files to allow users to use Nagios without internet connection
# and without PHP at all
pushd %{buildroot}%{nagios_datadir} >/dev/null
tar -xf %{SOURCE11}
tar -xf %{SOURCE12}
sed -i "s|Version 3.4.3|Version %{version}|g; \
s|version=3.4.3|version=%{version}|g" main.html
# jip: ugly at the moment
#LINES=$(echo $(wc -l %%{buildroot}%%{apache2_sysconfdir}/%%{name}.conf | awk '" " { print $1}')-2 | bc)
LINES=40
head -n $LINES %{buildroot}%{apache2_sysconfdir}/%{name}.conf > %{buildroot}%{apache2_sysconfdir}/%{name}.conf.in
cat >> %{buildroot}%{apache2_sysconfdir}/%{name}.conf.in << EOF
<IfDefine KOHANA2>
DirectoryIndex index.html index.php
</IfDefine>
</Directory>
EOF
mv -f %{buildroot}%{apache2_sysconfdir}/%{name}.conf.in %{buildroot}%{apache2_sysconfdir}/%{name}.conf
popd >/dev/null
%clean
%{__rm} -rf %{buildroot}
%pre
# Create user and group on the system if necessary
%nagios_user_group_add
%nagios_command_user_group_add
# update?
if [ ${1:-0} -gt 1 ]; then
# in the past, group www was used as nagios_command_group - now we use the default: nagcmd
if id -Gn %{nagios_user} 2>/dev/null | grep -q %{nagios_command_group} >/dev/null 2>&1 ; then
: # %%{nagios_user} is already in %%nagios_command_group group
else
# Add %%{nagios_user} to %%nagios_command_group.
%if 0%{?suse_version} > 1220
usermod -a -G %{nagios_command_group} %{nagios_user}
%else
groupmod -A %{nagios_user} %{nagios_command_group} 2>/dev/null
%endif
%{nnmmsg} "Added %{nagios_user} to %{nagios_command_group}"
fi
fi
%post
# Update ?
if [ ${1:-0} -gt 1 ]; then
if [ -f '%{nagios_sysconfdir}/nagios.cfg' ]; then
DATE=$(date "+%Y-%m-%d-%H:%M")
TMPFILE=$(mktemp /tmp/%{name}-XXXXXX)
NAGIOS_CFG='%{nagios_sysconfdir}/nagios.cfg'
cp -f $NAGIOS_CFG ${NAGIOS_CFG}_${DATE}
if ! grep -q ^lock_file=%{nslockfile} "$NAGIOS_CFG" ; then
echo "- updating pid lock_file= to %{nslockfile} in $NAGIOS_CFG" >> $TMPFILE
sed -i "s@^lock_file=.*@lock_file=%{nslockfile}@" "$NAGIOS_CFG"
fi
if grep -q ^service_reaper_frequency "$NAGIOS_CFG" ; then
echo "- renaming service_reaper_frequency to check_result_reaper_frequency in $NAGIOS_CFG" >> $TMPFILE
sed -i "s@service_reaper_frequency@check_result_reaper_frequency@" "$NAGIOS_CFG"
fi
if grep -q ^aggregate_status_updates "$NAGIOS_CFG" ; then
echo "- aggregate_status_updates option has been removed from $NAGIOS_CFG" >> $TMPFILE
sed -i "s@^aggregate_status_updates@# aggregate_status_updates@" "$NAGIOS_CFG"
fi
if grep -q ^downtime_file "$NAGIOS_CFG" ; then
set -- $(grep ^downtime_file "$NAGIOS_CFG" | sed 's@=@ @')
shift
file=$(echo $*)
if [ -n "$file" ]; then
if [ -f "$file" ]; then
set -- $(grep ^state_retention_file "$NAGIOS_CFG" | sed 's@=@ @')
shift
state_retention_file=$(echo $*)
echo "- adding the content of of $file to $state_retention_file" >> $TMPFILE
cat "$file" >> "$state_retention_file"
fi
fi
echo "- removing downtime_file variable (no longer supported) in $NAGIOS_CFG" >> $TMPFILE
sed -i "s@^downtime_file@# downtime_file@" "$NAGIOS_CFG"
fi
if grep -q ^comment_file "$NAGIOS_CFG" ; then
set -- $(grep ^comment_file "$NAGIOS_CFG" | sed 's@=@ @')
shift
file=$(echo $*)
if [ -n "$file" ]; then
if [ -f "$file" ]; then
echo "- adding the content of $file to $state_retention_file" >> $TMPFILE
cat "$file" >> "$state_retention_file"
fi
fi
echo "- removing comment_file variable (no longer supported) in $NAGIOS_CFG" >> $TMPFILE
sed -i "s@^comment_file@# comment_file@" "$NAGIOS_CFG"
fi
#{nnmmsg} $(cat $TMPFILE)
rm $TMPFILE
fi
else
# First installation: create an alias for the default nagiosadmin user
if [ -r etc/aliases ]; then
if ! grep -q "^nagiosadmin:" etc/aliases; then
echo -e "nagiosadmin:\troot" >> etc/aliases
%{nnmmsg} "Added alias for user nagiosadmin to /etc/aliases"
if [ -x usr/bin/newaliases ]; then
usr/bin/newaliases &>/dev/null || true
fi
fi
fi
fi
%{fillup_and_insserv nagios}
%preun
%stop_on_removal %{name}
%postun
%restart_on_update %{name}
%{insserv_cleanup}
%post www
wwwusr=%{nagios_command_user}
if [ -f etc/apache2/uid.conf ]; then
# If apache is installed, and we can find the apache user, set a shell var
wwwusr=$(awk '/^[ \t]*User[ \t]+[a-zA-Z0-9]+/ {print $2}' etc/apache2/uid.conf)
fi
# if apache user is not in nagios_command_group, add it
if id -Gn $wwwusr 2>/dev/null | grep -q %{nagios_command_group} >/dev/null 2>&1 ; then
: # $wwwusr (default: %%nagios_command_user) is already in Nagios cmd group
else
# modify apache user, adding it to nagios_command_group
%if 0%{?suse_version} > 1220
usermod -a -G %{nagios_command_group} $wwwusr
%else
groupmod -A $wwwusr %{nagios_command_group} 2>/dev/null
%endif
%{nnmmsg} "User $wwwusr added to group %{nagios_command_group} so sending commands to Nagios from the CGI is possible."
fi
# Update ?
if [ ${1:-0} -eq 1 ]; then
if [ -x %{_sbindir}/a2enmod ]; then
# enable authentification in apache config
%{_sbindir}/a2enmod authn_file >/dev/null
%{_sbindir}/a2enmod auth_basic >/dev/null
%{_sbindir}/a2enmod authz_user >/dev/null
# enable php5 in apache config
%{_sbindir}/a2enmod php5
fi
fi
%restart_on_update apache2
%post www-dch
# Update ?
if [ ${1:-0} -eq 1 ]; then
if [ -x %{_sbindir}/a2enflag ]; then
# enable NAGIOSDCH flag in apache configuration
%{_sbindir}/a2enflag NAGIOSDCH >/dev/null
fi
fi
%restart_on_update apache2
%preun www
%restart_on_update apache2
%files
%defattr(-,root,root)
%doc Changelog LEGAL LICENSE README README.SuSE sample-config/
%{_mandir}/man8/convertcfg*
%{_mandir}/man8/%{name}*
%{_mandir}/man8/*mini_epn*
%_sysconfdir/init.d/%name
%ghost %config(missingok,noreplace) %{nagios_logdir}/config.err
%config(noreplace) %{nagios_sysconfdir}/*.cfg
%config(noreplace) %{nagios_sysconfdir}/objects/*.cfg
%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}
%{_sysconfdir}/cron.weekly/*
%{nagios_localstatedir}
%attr(0755,root,root) %{nagios_libdir}/p1.pl
%exclude %{nagios_cgidir}/*
%{_sbindir}/convertcfg
%{_sbindir}/mini_epn
%{_sbindir}/new_mini_epn
%{_sbindir}/rc%name
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%dir %{nagios_eventhandlerdir}
%{nagios_eventhandlerdir}/*
# defattr change
%defattr(-,%{nagios_user},%{nagios_command_group})
%dir %{nagios_sysconfdir}
%dir %{nagios_sysconfdir}/objects
%dir %{nagios_spooldir}
# defattr change
%defattr(-,%{nagios_user},%nagios_group)
%dir %{nagios_localstatedir}
%dir %{nagios_logdir}
%dir %{nagios_logdir}/archives
%ghost %dir %nslockfile_dir
%attr(0644,%nagios_user,%nagios_group) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{nslockfile}
%attr(0600,%nagios_user,%nagios_group) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{nagios_state_retention_file}
%attr(0664,%nagios_user,%nagios_group) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{nagios_status_file}
%attr(0750,root,%{nagios_command_group}) %{_sbindir}/%{name}
%attr(0750,root,%{nagios_command_group}) %{_sbindir}/nagiostats
%files www
%defattr(755,root,root)
%dir %{nagios_cgidir}
%{nagios_cgidir}/*
# defattr change
%defattr(-,root,root)
%{nagios_datadir}
%config(noreplace) %{apache2_sysconfdir}/%{name}.conf
%attr(0640,root,%nagios_command_group) %config(missingok,noreplace) %{_sysconfdir}/%{name}/htpasswd.users
%exclude %{nagios_datadir}/*.html
%exclude %{nagios_datadir}/docs/*
%files www-dch
%defattr(-,root,root)
%{nagios_datadir}/*.html
%dir %{nagios_datadir}/docs
%{nagios_datadir}/docs/*
%files devel
%defattr(-,root,root)
%{_includedir}/%{name}/
%changelog
++++++ convertcfg.8 ++++++
'\" t
.\" Title: convertcfg
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 http://docbook.sf.net/
.\" Date: 06/10/2012
.\" Manual: convertcfg
.\" Source: Nagios
.\" Language: English
.\"
.TH "CONVERTCFG" "8" "06/10/2012" "Nagios" "convertcfg"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
convertcfg \- Nagios Config File Converter
.SH "SYNOPSIS"
.sp
\fBconvertcfg <config file> <object type>\fR
.SH "DESCRIPTION"
.sp
Nagios Config File Converter, written by Ethan Galstad (egalstad@nagios\&.org)\&.
.sp
This utility is designed to aide you in converting your old 'host' config file(s) to the new template-based config file style\&. It is also capable of converting extended host and service information definitions in your old CGI config file\&.
.sp
Supply the name of your old 'host' config file (or your old CGI config file if you're converting extended host/service definitions) on the command line, along with the type of object you would like to produce a new config file for\&. Your old config file is not overwritten - new configuration data is printed to standard output, so you can redirect it wherever you like\&.
.sp
Please note that you can only specify one type of object at a time on the command line\&.
.sp
IMPORTANT: This utility will generate Nagios 1\&..x compliant config files\&. However, the config files are not totally compatible with Nagios 2\&.x, so you will have to do some manual tweaking\&.
.SH "Valid object types:"
.sp
.if n \{\
.RS 4
.\}
.nf
timeperiods
commands
contacts
contactgroups
hosts
hostgroups
hostgroupescalations
services
servicedependencies
serviceescalations
hostextinfo
serviceextinfo
.fi
.if n \{\
.RE
.\}
.SH "AUTHOR"
.sp
This manpage was written by Lars Vogdt and is based on the help text of convertcfg\&.
++++++ mini_epn.8 ++++++
'\" t
.\" Title: mini_epn
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 http://docbook.sf.net/
.\" Date: 09/19/2009
.\" Manual: mini_epn
.\" Source: Nagios
.\" Language: English
.\"
.TH "MINI_EPN" "8" "09/19/2009" "Nagios" "mini_epn"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
mini_epn \- run nagiosplugins inside of an embedded perl interpreter
.SH "SYNOPSIS"
.sp
\fBmini_epn\fR
.SH "DESCRIPTION"
.sp
After calling \fBmini_epn\fR an embedded perl interpreter gets started and asks for you a script to execute under the interpreter\&. To exit the interpreter loop press ^d at the prompt\&. Please note that the maximal input length is 1024 characters.
.SH "EXAMPLES"
.sp
.if n \{\
.RS 4
.\}
.nf
# mini_epn
Enter file name: /usr/lib/nagios/plugins/check_linux_raid.pl
embedded perl plugin return code and output was: 0 & \'OK md0 status=[UU]\&. md1 status=[UU]\&.
.fi
.if n \{\
.RE
.\}
.SH "AUTHOR"
.sp
This manpage was written by Alexander Wirt for the Debian Distribution and adapted for openSUSE by Lars Vogdt\&.
++++++ nagios-CVE-2013-2214.patch ++++++
Index: nagios/cgi/status.c
===================================================================
--- nagios.orig/cgi/status.c
+++ nagios/cgi/status.c
@@ -2547,6 +2547,10 @@ void show_servicegroup_overview(serviceg
if(temp_host == NULL)
continue;
+ /* make sure user has rights to view this host */
+ if(is_authorized_for_host(temp_host, ¤t_authdata) == FALSE)
+ continue;
+
/* skip this if it isn't a new host... */
if(temp_host == last_host)
continue;
@@ -2752,6 +2756,10 @@ void show_servicegroup_host_totals_summa
if(temp_host == NULL)
continue;
+ /* make sure user has rights to view this host */
+ if(is_authorized_for_host(temp_host, ¤t_authdata) == FALSE)
+ continue;
+
/* skip this if it isn't a new host... */
if(temp_host == last_host)
continue;
@@ -2931,6 +2939,10 @@ void show_servicegroup_service_totals_su
temp_service = find_service(temp_member->host_name, temp_member->service_description);
if(temp_service == NULL)
continue;
+
+ /* make sure user has rights to view this service */
+ if(is_authorized_for_service(temp_service, ¤t_authdata) == FALSE)
+ continue;
/* skip this if it isn't a new service... */
if(temp_service == last_service)
@@ -3290,6 +3302,10 @@ void show_servicegroup_grid(servicegroup
if(temp_host == NULL)
continue;
+ /* make sure user has rights to view this host */
+ if(is_authorized_for_host(temp_host, ¤t_authdata) == FALSE)
+ continue;
+
/* get the status of the host */
temp_hoststatus = find_hoststatus(temp_host->name);
if(temp_hoststatus == NULL)
++++++ nagios-CVE-2013-7108.patch ++++++
Index: nagios/cgi/avail.c
===================================================================
--- nagios.orig/cgi/avail.c
+++ nagios/cgi/avail.c
@@ -1141,7 +1141,6 @@ int process_cgivars(void) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
- x++;
continue;
}
Index: nagios/cgi/config.c
===================================================================
--- nagios.orig/cgi/config.c
+++ nagios/cgi/config.c
@@ -386,7 +386,6 @@ int process_cgivars(void) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
- x++;
continue;
}
Index: nagios/cgi/extinfo.c
===================================================================
--- nagios.orig/cgi/extinfo.c
+++ nagios/cgi/extinfo.c
@@ -651,7 +651,6 @@ int process_cgivars(void) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
- x++;
continue;
}
Index: nagios/cgi/histogram.c
===================================================================
--- nagios.orig/cgi/histogram.c
+++ nagios/cgi/histogram.c
@@ -1069,7 +1069,6 @@ int process_cgivars(void) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
- x++;
continue;
}
Index: nagios/cgi/notifications.c
===================================================================
--- nagios.orig/cgi/notifications.c
+++ nagios/cgi/notifications.c
@@ -358,7 +358,6 @@ int process_cgivars(void) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
- x++;
continue;
}
Index: nagios/cgi/outages.c
===================================================================
--- nagios.orig/cgi/outages.c
+++ nagios/cgi/outages.c
@@ -269,7 +269,6 @@ int process_cgivars(void) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
- x++;
continue;
}
Index: nagios/cgi/status.c
===================================================================
--- nagios.orig/cgi/status.c
+++ nagios/cgi/status.c
@@ -600,7 +600,6 @@ int process_cgivars(void) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
- x++;
continue;
}
Index: nagios/cgi/statusmap.c
===================================================================
--- nagios.orig/cgi/statusmap.c
+++ nagios/cgi/statusmap.c
@@ -407,7 +407,6 @@ int process_cgivars(void) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
- x++;
continue;
}
Index: nagios/cgi/statuswml.c
===================================================================
--- nagios.orig/cgi/statuswml.c
+++ nagios/cgi/statuswml.c
@@ -235,8 +235,13 @@ int process_cgivars(void) {
for(x = 0; variables[x] != NULL; x++) {
+ /* do some basic length checking on the variable identifier to prevent buffer overflows */
+ if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
+ continue;
+ }
+
/* we found the hostgroup argument */
- if(!strcmp(variables[x], "hostgroup")) {
+ else if(!strcmp(variables[x], "hostgroup")) {
display_type = DISPLAY_HOSTGROUP;
x++;
if(variables[x] == NULL) {
Index: nagios/cgi/summary.c
===================================================================
--- nagios.orig/cgi/summary.c
+++ nagios/cgi/summary.c
@@ -761,7 +761,6 @@ int process_cgivars(void) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
- x++;
continue;
}
Index: nagios/cgi/trends.c
===================================================================
--- nagios.orig/cgi/trends.c
+++ nagios/cgi/trends.c
@@ -1271,7 +1271,6 @@ int process_cgivars(void) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
- x++;
continue;
}
Index: nagios/contrib/daemonchk.c
===================================================================
--- nagios.orig/contrib/daemonchk.c
+++ nagios/contrib/daemonchk.c
@@ -174,7 +174,6 @@ static int process_cgivars(void) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
- x++;
continue;
}
}
++++++ nagios-CVE-2014-1878.patch ++++++
Index: nagios/cgi/cmd.c
===================================================================
--- nagios.orig/cgi/cmd.c
+++ nagios/cgi/cmd.c
@@ -1923,14 +1923,14 @@ static int cmd_submitf(int id, const cha
return ERROR;
len = snprintf(cmd, sizeof(cmd) - 1, "[%lu] %s;", time(NULL), command);
- if(len < 0)
+ if(len < 0 || len >= sizeof(cmd))
return ERROR;
if(fmt) {
va_start(ap, fmt);
len2 = vsnprintf(&cmd[len], sizeof(cmd) - len - 1, fmt, ap);
va_end(ap);
- if(len2 < 0)
+ if(len2 < 0 || len2 >= sizeof(cmd) - len)
return ERROR;
}
++++++ nagios-README.SuSE ++++++
Nagios Documentation
--------------------
1) Quickstart
A quickstart installation guide can now be found in the
package nagios-www. You can find the quickstart guide
(quickstart.html) in the following subdirectory:
DATADIR/docs/
The quickstart covers all the basic steps you need to follow
to install Nagios, the Nagios plugins, and start out monitoring
the machine that Nagios is installed on.
******************************************************************
* Remember to create a htpasswd.users file in SYSCONFDIR:
* htpasswd2 -c SYSCONFDIR/htpasswd.users nagiosadmin
* And set the correct rights for this file:
* chmod 640 SYSCONFDIR/htpasswd.users
* chown root:www SYSCONFDIR/htpasswd.users
*
* You should also add a mail alias for the nagiosadmin to your
* /etc/aliases file like:
* nagiosadmin: root
* and afterwards update the database with "newaliases"
* Note: the RPM tries to do this automatically
******************************************************************
2) Upgrading
The HTML documentation covers what you need to know in order
to upgrade from Nagios 2.x You can find the documentation in
the package nagios-www in the following subdirectory:
DATADIR/docs/
Make sure to read the following sections:
- "What's New" (whatsnew.html)
- "Upgrading Nagios" (upgrading.html)
The SuSE RPM package will try to do the necessary steps automatically
during an upgrade. But you should check the resulting nagios.conf
against the backup version in the /etc/nagios directory (it contains
the update date).
++++++ nagios-disable_phone_home.patch ++++++
---
base/utils.c | 129 -----------------------------------------------------------
1 file changed, 1 insertion(+), 128 deletions(-)
Index: base/utils.c
===================================================================
--- base/utils.c.orig
+++ base/utils.c
@@ -3935,138 +3935,11 @@ int check_for_nagios_updates(int force,
/* checks for updates at api.nagios.org */
int query_update_api(void) {
- char *api_server = "api.nagios.org";
- char *api_path = "/versioncheck/";
- char *api_query = NULL;
- char *api_query_opts = NULL;
- char *buf = NULL;
- char recv_buf[1024];
- int report_install = FALSE;
- int result = OK;
- char *ptr = NULL;
- int current_line = 0;
- int buf_index = 0;
- int in_header = TRUE;
- char *var = NULL;
- char *val = NULL;
- int sd = 0;
- int send_len = 0;
- int recv_len = 0;
- int update_check_succeeded = FALSE;
-
- /* report a new install, upgrade, or rollback */
- /* Nagios monitors the world and we monitor Nagios taking over the world. :-) */
- if(last_update_check == (time_t)0L)
- report_install = TRUE;
- if(last_program_version == NULL || strcmp(PROGRAM_VERSION, last_program_version))
- report_install = TRUE;
- if(report_install == TRUE) {
- asprintf(&api_query_opts, "&firstcheck=1");
- if(last_program_version != NULL) {
- char *qopts2 = NULL;
- asprintf(&qopts2, "%s&last_version=%s", api_query_opts, last_program_version);
- my_free(api_query_opts);
- api_query_opts = qopts2;
- }
- }
-
- /* generate the query */
- asprintf(&api_query, "v=1&product=nagios&tinycheck=1&stableonly=1&uid=%lu", update_uid);
- if(bare_update_check == FALSE) {
- char *api_query2 = NULL;
- asprintf(&api_query2, "%s&version=%s%s", api_query, PROGRAM_VERSION, (api_query_opts == NULL) ? "" : api_query_opts);
- my_free(api_query);
- api_query = api_query2;
- }
-
- /* generate the HTTP request */
- asprintf(&buf,
- "POST %s HTTP/1.0\r\nUser-Agent: Nagios/%s\r\n"
- "Connection: close\r\nHost: %s\r\n"
- "Content-Type: application/x-www-form-urlencoded\r\n"
- "Content-Length: %zd\r\n\r\n%s",
- api_path, PROGRAM_VERSION, api_server,
- strlen(api_query), api_query);
-
- /*
- printf("SENDING...\n");
- printf("==========\n");
- printf("%s",buf);
- printf("\n");
- */
-
-
- result = my_tcp_connect(api_server, 80, &sd, 2);
- /*printf("CONN RESULT: %d, SD: %d\n",result,sd);*/
- if(sd > 0) {
-
- /* send request */
- send_len = strlen(buf);
- result = my_sendall(sd, buf, &send_len, 2);
- /*printf("SEND RESULT: %d, SENT: %d\n",result,send_len);*/
-
- /* get response */
- recv_len = sizeof(recv_buf);
- result = my_recvall(sd, recv_buf, &recv_len, 2);
- recv_buf[sizeof(recv_buf) - 1] = '\x0';
- /*printf("RECV RESULT: %d, RECEIVED: %d\n",result,recv_len);*/
-
- /*
- printf("\n");
- printf("RECEIVED...\n");
- printf("===========\n");
- printf("%s",recv_buf);
- printf("\n");
- */
-
- /* close connection */
- close(sd);
-
- /* parse the result */
- in_header = TRUE;
- while((ptr = get_next_string_from_buf(recv_buf, &buf_index, sizeof(recv_buf)))) {
-
- strip(ptr);
- current_line++;
-
- if(!strcmp(ptr, "")) {
- in_header = FALSE;
- continue;
- }
- if(in_header == TRUE)
- continue;
-
- var = strtok(ptr, "=");
- val = strtok(NULL, "\n");
- /*printf("VAR: %s, VAL: %s\n",var,val);*/
-
- if(!strcmp(var, "UPDATE_AVAILABLE")) {
- update_available = atoi(val);
- /* we were successful */
- update_check_succeeded = TRUE;
- }
- else if(!strcmp(var, "UPDATE_VERSION")) {
- if(new_program_version)
- my_free(new_program_version);
- new_program_version = strdup(val);
- }
- else if(!strcmp(var, "UPDATE_RELEASEDATE")) {
- }
- }
- }
-
- /* cleanup */
- my_free(buf);
- my_free(api_query);
- my_free(api_query_opts);
-
/* we were successful! */
+ int update_check_succeeded = TRUE;
if(update_check_succeeded == TRUE) {
time(&last_update_check);
- if(last_program_version)
- free(last_program_version);
- last_program_version = (char *)strdup(PROGRAM_VERSION);
}
return OK;
++++++ nagios-fix_encoding_trends.cgi.patch ++++++
---
cgi/getcgi.c | 3 +++
1 file changed, 3 insertions(+)
Index: cgi/getcgi.c
===================================================================
--- cgi/getcgi.c.orig
+++ cgi/getcgi.c
@@ -96,6 +96,9 @@ void unescape_cgi_input(char *input) {
break;
else if(input[x] == '%') {
input[y] = hex_to_char(&input[x + 1]);
+ if (input[y] == '+') {
+ input[y] = ' ';
+ }
x += 2;
}
else
++++++ nagios-fix_spurious_dollar_signs_added_to_command_lines.patch ++++++
---
common/macros.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: common/macros.c
===================================================================
--- common/macros.c.orig
+++ common/macros.c
@@ -221,7 +221,8 @@ int process_macros_r(nagios_macros *mac,
*output_buffer = (char *)realloc(*output_buffer, strlen(*output_buffer) + strlen(temp_buffer) + 3);
strcat(*output_buffer, "$");
strcat(*output_buffer, temp_buffer);
- strcat(*output_buffer, "$");
+ if (buf_ptr != NULL)
+ strcat(*output_buffer, "$");
}
/* insert macro */
++++++ nagios-htpasswd.users ++++++
nagiosadmin:OIEGHgNTsb3HQ
++++++ nagios-p1.pl-location.patch ++++++
Index: Makefile.in
===================================================================
--- Makefile.in.orig
+++ Makefile.in
@@ -25,6 +25,7 @@ exec_prefix=@exec_prefix@
LOGDIR=@localstatedir@
CHECKRESULTDIR=@CHECKRESULTDIR@
CFGDIR=@sysconfdir@
+P1PLDIR=@p1pldir@
BINDIR=@bindir@
CGIDIR=@sbindir@
LIBEXECDIR=@libexecdir@
@@ -239,7 +240,7 @@ install-basic:
$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(LOGDIR)/archives
$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CHECKRESULTDIR)
if [ $(INSTALLPERLSTUFF) = yes ]; then \
- $(INSTALL) -m 664 $(INSTALL_OPTS) p1.pl $(DESTDIR)$(BINDIR); \
+ $(INSTALL) -m 664 $(INSTALL_OPTS) p1.pl $(DESTDIR)$(P1PLDIR); \
fi;
@echo ""
Index: configure.in
===================================================================
--- configure.in.orig
+++ configure.in
@@ -16,6 +16,7 @@ PKG_REL_DATE="01-12-2013"
dnl Figure out how to invoke "install" and what install options to use.
AC_PROG_INSTALL
AC_SUBST(INSTALL)
+AC_SUBST(P1PLDIR)
dnl What OS are we running?
AC_CANONICAL_HOST
Index: include/locations.h.in
===================================================================
--- include/locations.h.in.orig
+++ include/locations.h.in
@@ -39,5 +39,5 @@
#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_P1_FILE "@bindir@/p1.pl" /**** EMBEDDED PERL ****/
+#define DEFAULT_P1_FILE "@p1pldir@/p1.pl" /**** EMBEDDED PERL ****/
#define DEFAULT_AUTH_FILE "" /**** EMBEDDED PERL - IS THIS USED? ****/
Index: sample-config/nagios.cfg.in
===================================================================
--- sample-config/nagios.cfg.in.orig
+++ sample-config/nagios.cfg.in
@@ -1142,7 +1142,7 @@ date_format=us
# embedded Perl interpreter) is located. If you didn't compile
# Nagios with embedded Perl support, this option has no effect.
-p1_file=@bindir@/p1.pl
+p1_file=@p1pldir@/p1.pl
++++++ nagios-rpmlintrc ++++++
# common.css is used in cgi - and can be expanded by user
addFilter("zero-length.*/usr/share/nagios/stylesheets/common.css");
# we need xntp for SLES9
addFilter("init-script-non-var-dependency.*/etc/init.d/nagios xntpd");
addFilter("subsys-unsupported.*/etc/init.d/nagios");
# nagios comes with embedded perl
addFilter("no-dependency-on.*perl")
# The name of that package is used since years - no need to change it for this new 'policy'
addFilter("name-repeated-in-summary.*Nagios")
# avoid FollowSymlinks in apache configuration
addFilter("files-duplicated-waste");
addFilter("files-duplicate.*/usr/share/nagios/.*");
++++++ nagios.8 ++++++
.TH nagios "8" "February 2006, May 2010" "sean finney, Lars Vogdt" "Nagios"
.SH NAME
Nagios \- network/systems status monitoring daemon
.SH SYNOPSIS
.B nagios [\-h] [\-v] [\-s] [\-d]
.br
.SH DESCRIPTION
.B nagios
is a daemon program that monitors the status of various network
accessible systems, devices, and more. For more information, please
consult the online documentation available at http://www.nagios.org,
or on your nagios server's web page.
.SH OPTIONS
.TP
main_config_file
The main configuration file. On openSUSE systems this defaults to
/etc/nagios/nagios.cfg
.TP
\fB\-h\fR
A helpful usage message
.TP
\fB\-v\fR
Reads all data in the configuration files and performs a basic
verification/sanity check. Always make sure you verify your
config data before (re)starting Nagios. You can also use the Nagios
init script to verify your configuration - try: rcnagios check_verbose
.TP
\fB\-s\fR
Shows projected/recommended check scheduling information based
on the current data in the configuration files.
.TP
\fB\-d\fR
Starts Nagios in daemon mode (instead of as a foreground process).
.SH FILES
.TP
.IP /etc/nagios
Default configuration directory for nagios
.SH AUTHOR
Nagios is written and maintained by Ethan Galstad . This
manual page was written by sean finney for the
Debian GNU/Linux operating system (but it may be freely used, modified,
and redistributed by others) and adapted by Lars Vogdt for openSUSE.
++++++ nagios.sysconfig ++++++
## Path: Network/Monitors/Nagios
## Description: Nagios startup parameters
## Type: integer
## Default: 10
#
# Timeout during server shutdown (seconds) and start.
# The start script kills Nagios after this timeout in double-seconds with SIGTERM
# If you enabled external commands, the start script also waits for this
# time and tries to setup the system so external commands can be executed.
#
# Increase it, if you use nagios in an big environment (>100 monitoring hosts)!
#
NAGIOS_TIMEOUT="10"
## Type: integer
## Default: 0
#
# Nice level of running Nagios daemon.
#
NAGIOS_NICELEVEL="0"
## Type: boolean
## Default: true
#
# Compress old Nagios logfiles in /var/log/nagios/archive.
#
# Nagios comes with his own logrotate scripts, so you can configure Nagios
# to rotate his logfile in /etc/nagios/nagios.cfg
# To save disk space, you can enable a cron job which compress the old
# logfiles once a week.
NAGIOS_COMPRESS_LOGFILES="false"
++++++ nagiosstats.8 ++++++
.TH nagiosstats "8" "February 2006, May 2010" "sean finney, Lars Vogdt " "nagios"
.SH NAME
nagiosstats \- report statistics information from the Nagios system
.SH SYNOPSIS
.B nagiosstats [\-hVL] [\-c config] [\-m] [\-d]
.br
.SH DESCRIPTION
.B nagiosstats
is a program designed to provide information on the running Nagios
system. It can provide a brief summary of information, or it can
be used to export specific information about the Nagios system
into an MRTG-compatible format.
For more information please consult the Nagios online documentation
available at http://www.nagios.org or the documentation available
with your Nagios server's web page.
.SH OPTIONS
.TP
\fB\-c\fR|\-\-config=FILE
The main configuration file. On openSUSE systems this defaults to
/etc/nagios/nagios.cfg
.TP
\fB\-m\fR|\-\-mrtg
Print output in MRTG-compatible format. For more details run
nagiosstats with \-\-help
.TP
\fB\-d\fR|\-\-data=VARS
Comma-seperated list of variables to output in MRTG format. For
more details run nagiosstats with \-\-help.
.TP
\fB\-h\fR|\-\-help
A helpful usage message
.TP
\fB\-V\fR|\-\-version
Print version information
.TP
\fB\-L\fR|\-\-license
Print license details
.SH FILES
.TP
.IP /etc/nagios
Default configuration directory for Nagios
.SH AUTHOR
Nagios is written and maintained by Ethan Galstad . This
manual page was written by sean finney for the
Debian GNU/Linux operating system (but it may be freely used, modified,
and redistributed by others) and adapted for openSUSE by Lars Vogdt.
++++++ new_mini_epn.8 ++++++
'\" t
.\" Title: new_mini_epn
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 http://docbook.sf.net/
.\" Date: 09/19/2009
.\" Manual: mini_epn
.\" Source: Nagios
.\" Language: English
.\"
.TH "NEW_MINI_EPN" "8" "06/10/2012" "Nagios" "new_mini_epn"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
new_mini_epn \- run nagiosplugins inside of an embedded perl interpreter
.SH "SYNOPSIS"
.sp
\fBnew_mini_epn\fR
.SH "DESCRIPTION"
.sp
After calling \fBnew_mini_epn\fR an embedded perl interpreter gets started and asks for you a script to execute under the interpreter\&. To exit the interpreter loop press ^d at the prompt\&.
.SH "EXAMPLES"
.sp
.if n \{\
.RS 4
.\}
.nf
# new_mini_epn
plugin command line: /usr/lib/nagios/plugins/check_mailq -w 10 -c 20
embedded perl plugin return code and output was: 0 & OK: mailq is empty|unsent=0;10;20;0
.fi
.if n \{\
.RE
.\}
.SH "AUTHOR"
.sp
This manpage was written by Lars Vogdt for the openSUSE Distribution based on the mini_epn manpage written by Alexander Wirt for the Debian Distribution\&.
++++++ rcnagios ++++++
#! /bin/sh
# Copyright (c) 1995-2001 SuSE GmbH Nuernberg, Germany.
# 2002 SuSE Linux AG Nuernberg, Germany.
# 2007 SuSE Linux GmbH Nuernberg, Germany.
# 2010-2012 SUSE LINUX Products GmbH, Nuernberg, Germany
#
# Author: Wolfgang Rosenauer, Lars Vogdt
#
#
# /etc/init.d/nagios
#
# and symbolic its link
#
# /usr/sbin/rcnagios
#
# System startup script for nagios
#
### BEGIN INIT INFO
# Provides: nagios monitoring_daemon
# Required-Start: $local_fs $remote_fs $syslog $network
# Required-Stop: $local_fs $remote_fs $syslog $network
# Should-Start: $time sendmail httpd2 xntpd $named cron ndo2db
# Should-Stop: sendmail ndo2db
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Network monitor Nagios
# Description: Starts and stops the Nagios monitor
# used to provide network services status for hosts,
# services and networks.
### END INIT INFO
. /etc/rc.status
NAGIOS_BIN='/usr/sbin/nagios'
NAGIOS_CFG='/etc/nagios/nagios.cfg'
NAGIOS_PIDFILE='/var/run/nagios/nagios.pid'
NAGIOS_SYSCONFIG='/etc/sysconfig/nagios'
NAGIOS_CFG_ERR_LOG='/var/log/nagios/config.err'
NAGIOS_DAEMONCHK='/usr/lib/nagios/cgi/daemonchk.cgi'
# Read config and log errors in logfile
function config_check () {
case "$1" in
verbose)
$NAGIOS_BIN -v "$NAGIOS_CFG" >"$NAGIOS_CFG_ERR_LOG" 2>&1
if [ $? -eq 0 ]; then
return 0
else
return 1
fi
;;
*)
$NAGIOS_BIN -v "$NAGIOS_CFG" >/dev/null 2>&1
if [ $? -eq 0 ]; then
return 0
else
$NAGIOS_BIN -v "$NAGIOS_CFG" >"$NAGIOS_CFG_ERR_LOG" 2>&1
return 1
fi
;;
esac
}
# grab a config option
function get_var() {
if [ -n "$2" ]; then
set -- `grep ^$1 $2 | sed 's@=@ @' | tr -d '[:cntrl:]'`
else
set -- `grep ^$1 "$NAGIOS_CFG" | sed 's@=@ @' | tr -d '[:cntrl:]'`
fi
shift # remove first ARG => search-string
echo $*
}
# check some default files and directories
function check_files() {
# remove some perhaps left over files
for file in "$command_file" "$lock_file" "$status_file" "$temp_file" "/var/lock/subsys/nagios"; do
test -f "$file" && rm -f "$file"
done
# set default access rights for files and directories
for file in "$log_file" "$state_retention_file" "$status_file"; do
if [ ! -e "$file" ]; then
touch "$file"
fi
chown $nagios_user:$nagios_cmdgrp "$file"
done
for dir in "$check_result_path" $(dirname $status_file); do
if [ ! -d "$dir" ]; then
mkdir -p "$dir"
fi
chown $nagios_user:$nagios_cmdgrp "$dir"
done
chmod 660 "$resource_file"
chown $nagios_user:$nagios_cmdgrp "$resource_file"
}
function check_lock_file() {
PIDDIR=$(dirname $lock_file)
case "$PIDDIR" in
/var/run)
if [ x"$nagios_user" != x"root" ]; then
DATESTRING=`date +"%Y%m%d"`
mv -f "$NAGIOS_CFG" "$NAGIOS_CFG-$DATESTRING"
sed -e "s|^lock_file.*|pid_file=$NAGIOS_PIDFILE|g" "$NAGIOS_CFG-$DATESTRING" > "$NAGIOS_CFG"
/bin/logger -t rcnagios "Configured $lock_file in $NAGIOS_CFG moved to $NAGIOS_PIDFILE. Backup is $NAGIOS_CFG-$DATESTRING"
test -f "$lock_file" && rm -f "$lock_file"
install -d -m755 -o$nagios_user -g$nagios_cmdgrp $(dirname "$NAGIOS_PIDFILE")
else
test -d "$PIDDIR" || mkdir -p "$PIDDIR"
fi
;;
*)
install -d -m755 -o$nagios_user -g$nagios_cmdgrp $(dirname "$NAGIOS_PIDFILE")
esac
}
# Check for missing binaries (stale symlinks should not happen)
# Note: Special treatment of stop for LSB conformance
test -x "$NAGIOS_BIN" || { echo "$NAGIOS_BIN not installed or not executable.";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
# Check for existence of needed config file
test -r "$NAGIOS_CFG" || { echo "$NAGIOS_CFG not existing or readable.";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
# Check for existence of sysconfig file and read it
test -r "$NAGIOS_SYSCONFIG" || { echo "$NAGIOS_SYSCONFIG not existing or readable.";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
. "$NAGIOS_SYSCONFIG"
# set values for sysconfig vars
if [ -n "$NAGIOS_NICELEVEL" ]; then
NICELEVEL="-n $NAGIOS_NICELEVEL"
else
NICELEVEL="-n 0"
fi
if [ -z "$NAGIOS_TIMEOUT" ]; then
NAGIOS_TIMEOUT=10
fi
#
# get variables from config file
#
nagios_user="$(get_var nagios_user)"
lock_file="$(get_var lock_file)"
status_file="$(get_var status_file)"
log_file="$(get_var log_file)"
temp_file="$(get_var temp_file)"
state_retention_file="$(get_var state_retention_file)"
command_file="$(get_var command_file)"
resource_file="$(get_var resource_file)"
object_cache_file="$(get_var object_cache_file)"
check_result_path="$(get_var check_result_path)"
check_external_commands="$(get_var check_external_commands)"
#
# use default values if above check doesn't work
#
: ${nagios_user:=nagios}
: ${nagios_cmdgrp:=nagcmd}
: ${resource_file:=/etc/nagios/resource.cfg}
# check ownership files
: ${check_result_path:=/var/spool/nagios}
: ${log_file:=/var/log/nagios/nagios.log}
: ${state_retention_file:=/var/log/nagios/retention.dat}
: ${status_file:=/var/log/nagios/status.dat}
: ${check_external_commands:=0}
# files to remove
: ${command_file:=/var/spool/nagios/nagios.cmd}
: ${lock_file:=/var/run/nagios/nagios.pid}
: ${object_cache_file:=/var/lib/nagios/objects.cache}
: ${temp_file:=/var/log/nagios/nagios.tmp}
# Reset status of this service
rc_reset
case "$1" in
start)
echo -n "Starting Nagios "
config_check
if [ $? -eq 0 ]; then
# check if nagios is already running
NAGPID=$(pidof "$NAGIOS_BIN")
if [ -n "$NAGPID" ]; then
echo "- Error: looks like Nagios is still running with PID $NAGPID"
echo -n "- trying to kill previous Nagios process"
kill -9 $NAGPID
sleep 2
fi
check_files
check_lock_file
startproc $NICELEVEL -p "$lock_file" "$NAGIOS_BIN" -d "$NAGIOS_CFG"
if [ "$check_external_commands" != 0 ]; then
while [ ! -e "$command_file" ] && [ $NAGIOS_TIMEOUT -gt 0 ]; do
sleep 1
NAGIOS_TIMEOUT=$[$NAGIOS_TIMEOUT-1]
done
chgrp $nagios_cmdgrp "$command_file"
chown $nagios_user:$nagios_cmdgrp "$check_result_path"
fi
else
echo "Error in configuration - please read $NAGIOS_CFG_ERR_LOG"
rc_failed
fi
rc_status -v
;;
stop)
echo -n "Shutting down Nagios "
# we have to wait for nagios to exit and remove its
# own Lockfile, otherwise a following "start" could
# happen, and then the exiting nagios will remove the
# new Lockfile, allowing multiple nagios daemons
# to (sooner or later) run - John Sellens
if checkproc "$NAGIOS_BIN" ; then
killproc -p "$lock_file" -TERM "$NAGIOS_BIN"
sleep 1
if [ -e "$lock_file" ]; then
echo "Warning - Nagios did not exit in a timely manner. Waiting..."
while [ -e "$lock_file" ] && [ $NAGIOS_TIMEOUT -gt 0 ] ; do
sleep 1
NAGIOS_TIMEOUT=$[$NAGIOS_TIMEOUT-1]
echo -n '.'
[ $NAGIOS_TIMEOUT -eq 41 ] && echo
done
fi
if checkproc "$NAGIOS_BIN" ; then
killproc -p "$lock_file" -SIGKILL "$NAGIOS_BIN"
echo -n "Warning: Nagios killed"
fi
else
echo -n "Nagios not running"
rc_failed 7
fi
check_files
rc_reset
rc_status -v
;;
try-restart)
## Do a restart only if the service was active before.
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
rc_status
;;
restart)
$0 check
$0 stop
$0 start
rc_status
;;
reload|force-reload)
echo -n "Reload service Nagios "
config_check
if [ $? -eq 0 ]; then
echo -n "Passed configuration check - reloading..."
killproc -HUP -p "$lock_file" "$NAGIOS_BIN"
else
echo "- Error in configuration files"
echo -n "- aborting reload - please read $NAGIOS_CFG_ERR_LOG"
rc_failed
fi
rc_status -v
;;
status)
echo -n "Checking for Nagios: "
if [ -x "$NAGIOS_DAEMONCHK" ]; then
if "$NAGIOS_DAEMONCHK" -l "$lock_file"; then
rc_failed 0
else
rc_failed 1
fi
else
checkproc -p "$lock_file" "$NAGIOS_BIN"
fi
rc_status -v
;;
check)
echo -n "Starting configuration check "
config_check
if [ $? -eq 0 ]; then
echo "- passed configuration check"
test -f $NAGIOS_CFG_ERR_LOG && rm $NAGIOS_CFG_ERR_LOG
rc_reset
else
echo "- detected Error in configuration files"
echo "Please read $NAGIOS_CFG_ERR_LOG"
rc_failed
fi
rc_status -v
;;
check_verbose)
echo "Running verbose configuration check..."
config_check verbose
exitcode=$?
cat "$NAGIOS_CFG_ERR_LOG"
rc_failed $exitcode
rc_status -v
rc_exit
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|reload|check|check_verbose}"
exit 1
;;
esac
rc_exit
++++++ suse.de-nagios ++++++
#!/usr/bin/env bash
#
# Compress old nagios logfiles in /var/log/nagios/archives/
# once a week, if sysconfig variable is set to true
#
if [[ -r /etc/sysconfig/nagios ]]; then
. /etc/sysconfig/nagios
else
echo "/etc/sysconfig/nagios not found or not readable." >&2
exit 1
fi
if [[ $NAGIOS_COMPRESS_LOGFILES = "true" ]]; then
for f in /var/log/nagios/archives/*.log ; do
if [[ -r $f ]] ; then
/usr/bin/bzip2 "$f"
fi
done
fi
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org