Summary(pl.UTF-8): Program do monitorowania serwerów/usług/sieci
Summary(pt_BR.UTF-8): Programa para monitoração de máquinas e serviços
Name: nagios
-Version: 3.1.2
-Release: 3
+Version: 3.2.1
+Release: 1
License: GPL v2
Group: Networking
-Source0: http://dl.sourceforge.net/nagios/%{name}-%{version}.tar.gz
-# Source0-md5: f3c60428cba14264c709749182b8d93e
+Source0: http://downloads.sourceforge.net/nagios/%{name}-%{version}.tar.gz
+# Source0-md5: d4655ee8c95c9679fd4fd53dac34bbe3
Source1: %{name}-apache.conf
Source2: %{name}.init
Source3: %{name}.sysconfig
-Source4: http://www.nagios.org/images/favicon.ico
-# Source4-md5: 1c4201c7da53d6c7e48251d3a9680449
-Source5: %{name}-config-20090803.tar.bz2
-# Source5-md5: e4c42ebadecef32cfe14cc3085f5bae4
-Source6: %{name}-lighttpd.conf
+Source4: %{name}-config-20090914.tar.bz2
+# Source4-md5: 605f1cd28c00db961dad6f529d849f16
+Source5: %{name}-lighttpd.conf
+Source6: http://www.google.com/mapfiles/shadow50.png
+# Source6-md5: eff99f302f21b95a900d321743fce72b
+Source7: http://www.google.com/mapfiles/marker.png
+# Source7-md5: edefef4bdfc29e1c953694651f05b466
+Source8: googlemap.js
Patch0: %{name}-resources.patch
Patch1: %{name}-iconv-in-libc.patch
Patch2: %{name}-webapps.patch
Patch3: %{name}-cgi-http_charset.patch
Patch4: %{name}-cmd-typo.patch
Patch5: config.patch
+Patch6: %{name}-googlemap.patch
URL: http://www.nagios.org/
BuildRequires: autoconf
BuildRequires: automake
%endif
BuildRequires: rpmbuild(macros) >= 1.268
BuildRequires: sed >= 4.0
-BuildRequires: tar >= 1:1.15.1
Requires(post,preun): /sbin/chkconfig
-Requires(triggerpostun): sed >= 4.0
Requires: %{name}-common = %{version}-%{release}
-Requires: /bin/mail
-Requires: nagios-notify
Requires: rc-scripts
Requires: sh-utils
+Suggests: nagios-notify >= 0.13
+Suggests: nagios-plugin-check_load
+Suggests: nagios-plugin-check_ping
+Suggests: nagios-plugins
Provides: nagios-core
Obsoletes: netsaint
Conflicts: iputils-ping < 1:ss020124
Requires(pre): /usr/sbin/groupmod
Requires(pre): /usr/sbin/useradd
Requires(pre): /usr/sbin/usermod
+Provides: group(nagcmd)
Provides: group(nagios)
-Provides: group(nagios-data)
Provides: user(nagios)
%description common
Summary: CGI webinterface for Nagios
Summary(pl.UTF-8): Interfejs WWW/CGI dla Nagiosa
Group: Applications/WWW
-# for dirs... and accessing local logs.
+# for dirs... and accessing local logs, nagios config
Requires: %{name} = %{version}-%{release}
Requires: %{name}-imagepaks
Requires: %{name}-theme
Requires: webserver(auth)
Requires: webserver(cgi)
Requires: webserver(indexfile)
+Suggests: %{name}-doc
%description cgi
CGI webinterface for Nagios.
%description cgi -l pl.UTF-8
Interfejs CGI dla Nagiosa.
+%package doc
+Summary: HTML Documentation for Nagios
+Group: Documentation
+# does not require base
+
+%description doc
+HTML Documentation for Nagios.
+
%package theme-default
Summary: Default Nagios theme
Summary(pl.UTF-8): Domyślny motyw Nagiosa
aplicativos para o Nagios.
%prep
-%setup -q -a5
+%setup -q -a4
%patch0 -p0
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
+%patch6 -p1
-find -name .cvsignore | xargs rm
+find -name .cvsignore -o -name .gitignore | xargs rm
mv nagios-config-*/objects/*.cfg sample-config/template-object
mv nagios-config-*/*.cfg sample-config
+# cleanup backups after patching
+find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
+
sed -i -e '
s,".*/var/rw/nagios.cmd,"%{_localstatedir}/rw/nagios.cmd,
s,".*/libexec/eventhandlers,"%{_libdir}/%{name}/eventhandlers,
' $(find contrib/eventhandlers -type f)
sed -e 's,%{_prefix}/lib/,%{_libdir}/,' %{SOURCE1} > apache.conf
-sed -e 's,%{_prefix}/lib/,%{_libdir}/,' %{SOURCE6} > lighttpd.conf
+sed -e 's,%{_prefix}/lib/,%{_libdir}/,' %{SOURCE5} > lighttpd.conf
# fixup cgi config
%{__sed} -i -e '
%{__aclocal}
%{__autoconf}
%configure \
- --datarootdir=%{_datadir} \
+ CFLAGS="%{rpmcflags} %{rpmcppflags}" \
--with-nagios-user=%{name} \
--with-nagios-grp=%{name} \
--with-command-user=%{name} \
--with-command-grp=%{name} \
--with-lockfile=%{_localstatedir}/%{name}.pid \
+ --with-checkresult-dir=%{_var}/spool/%{name}/checkresults \
--with-ping_command='/bin/ping -n %%s -c %%d' \
%{!?with_gd:--disable-statusmap --disable-trends} \
%{?with_tests:--enable-libtap} \
%endif
install -d $RPM_BUILD_ROOT%{_includedir}/%{name}
-install include/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
+cp -a include/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
%{__make} install-unstripped \
DESTDIR=$RPM_BUILD_ROOT \
INIT_OPTS="" \
COMMAND_OPTS=""
-install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
-install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
-install %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}
+install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
# install templated configuration files
for a in nagios.cfg resource.cfg commands.cfg contactgroups.cfg contacts.cfg templates.cfg timeperiods.cfg; do
done
# webserver files
-install apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
-install apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
-install lighttpd.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/lighttpd.conf
+cp -a apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
+cp -a apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
+cp -a lighttpd.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/lighttpd.conf
cp -a sample-config/cgi.cfg $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
+cp -a %{SOURCE6} $RPM_BUILD_ROOT%{_datadir}/images
+cp -a %{SOURCE7} $RPM_BUILD_ROOT%{_datadir}/images
+cp -a %{SOURCE8} $RPM_BUILD_ROOT%{_datadir}/images
> $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/passwd
echo 'nagios:' > $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/group
find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name '*.in' | xargs rm
# Object data/cache files
-for i in {objects.cache,{comments,downtime,retention,status}.dat,nagios.tmp}; do
+for i in {objects.{cache,precache},{comments,downtime,retention,status}.dat,nagios.tmp}; do
> $RPM_BUILD_ROOT%{_localstatedir}/$i
done
> $RPM_BUILD_ROOT%{_localstatedir}/rw/nagios.cmd
+install -d $RPM_BUILD_ROOT%{_docdir}/%{name}
+mv $RPM_BUILD_ROOT{%{_datadir}/docs/*,%{_docdir}/%{name}}
+
%clean
rm -rf $RPM_BUILD_ROOT
%post
-for i in %{_localstatedir}/{objects.cache,{comments,downtime,retention,status}.dat}; do
+for i in %{_localstatedir}/{objects.{cache,precache},{comments,downtime,retention,status}.dat}; do
[ ! -f $i ] && touch $i
chown root:nagios $i
chmod 664 $i
fi
%pre common
-if [ "`getgid netsaint 2>/dev/null`" = "72" ]; then
+# rename group netsaint -> nagios
+if [ "$(getgid netsaint 2>/dev/null)" = "72" ]; then
/usr/sbin/groupmod -n nagios netsaint
fi
+# rename group nagios-data -> nagcmd
+if [ "$(getgid nagios-data 2>/dev/null)" = "147" ]; then
+ /usr/sbin/groupmod -n nagcmd nagios-data
+fi
%groupadd -g 72 nagios
-%groupadd -g 147 -f nagios-data
-if [ -n "`id -u netsaint 2>/dev/null`" ] && [ "`id -u netsaint`" = "72" ]; then
- /usr/sbin/usermod -d %{_libdir}/nagios -l nagios -c "Nagios Daemon" -G nagios-data netsaint
+%groupadd -g 147 -f nagcmd
+if [ -n "$(id -u netsaint 2>/dev/null)" ] && [ "$(id -u netsaint)" = "72" ]; then
+ /usr/sbin/usermod -d %{_libdir}/nagios -l nagios -c "Nagios Daemon" -G nagcmd netsaint
fi
-%useradd -u 72 -d %{_libdir}/nagios -s /bin/false -c "Nagios Daemon" -g nagios -G nagios-data nagios
+%useradd -u 72 -d %{_libdir}/nagios -s /bin/false -c "Nagios Daemon" -g nagios -G nagcmd nagios
%postun common
if [ "$1" = "0" ]; then
%userremove nagios
%groupremove nagios
- %groupremove nagios-data
+ %groupremove nagcmd
fi
%post cgi
fi
%triggerin cgi -- apache1 < 1.3.37-3, apache1-base
-%addusertogroup http nagios-data
+%addusertogroup http nagcmd
%webapp_register apache %{_webapp}
%triggerun cgi -- apache1 < 1.3.37-3, apache1-base
%webapp_unregister apache %{_webapp}
%triggerin cgi -- apache < 2.2.0, apache-base
-%addusertogroup http nagios-data
+%addusertogroup http nagcmd
%webapp_register httpd %{_webapp}
%triggerun cgi -- apache < 2.2.0, apache-base
%webapp_unregister httpd %{_webapp}
%triggerin cgi -- lighttpd
-%addusertogroup lighttpd nagios-data
+%addusertogroup lighttpd nagcmd
%webapp_register lighttpd %{_webapp}
%triggerun cgi -- lighttpd
%triggerpostun -- nagios-cgi < 2.0-0.b3.21
chown root:http %{_sysconfdir}/cgi.cfg
-%triggerpostun -- nagios < 3.1.2-3
+%triggerpostun -- nagios < 3.1.2-4
# restore lost files
-for a in services.cfg serviceextinfo.cfg hosts.cfg hostgroups.cfg hostextinfo.cfg escalations.cfg checkcommands.cfg misccommands.cfg; do
+for a in dependencies.cfg services.cfg serviceextinfo.cfg hosts.cfg hostgroups.cfg hostextinfo.cfg escalations.cfg checkcommands.cfg misccommands.cfg; do
if [ -f %{_sysconfdir}/$a.rpmsave -a ! -f %{_sysconfdir}/$a ]; then
mv -f %{_sysconfdir}/$a{.rpmsave,}
fi
done
+%{__sed} -i -e 's,^check_result_path=.*,check_result_path=%{_var}/spool/%{name}/checkresults,' %{_sysconfdir}/nagios.cfg
%files
%defattr(644,root,root,755)
%doc Changelog README* UPGRADING INSTALLING LICENSE
-%attr(640,root,nagios-data) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nagios.cfg
-%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/[!n]*.cfg
+%attr(750,root,nagios) %dir %{_sysconfdir}/objects
+
+# leave main nagios config readable for -cgi.
+%attr(640,root,nagcmd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nagios.cfg
+
+%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commands.cfg
+%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/contactgroups.cfg
+%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/contacts.cfg
+%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/resource.cfg
+%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/templates.cfg
+%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/timeperiods.cfg
%attr(754,root,root) /etc/rc.d/init.d/%{name}
%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
%attr(755,root,root) %{_bindir}/%{name}
%attr(755,root,root) %{_bindir}/nagiostats
-%attr(770,root,nagios-data) %dir %{_var}/log/%{name}
-%attr(770,root,nagios-data) %dir %{_var}/log/%{name}/archives
+%attr(770,root,nagcmd) %dir %{_var}/log/%{name}
+%attr(770,root,nagcmd) %dir %{_var}/log/%{name}/archives
-%attr(770,root,nagios-data) %dir %{_localstatedir}
-%attr(2770,root,nagios-data) %dir %{_localstatedir}/rw
-%attr(660,nagios,nagios-data) %ghost %{_localstatedir}/rw/nagios.cmd
-%attr(2770,root,nagios-data) %dir %{_localstatedir}/spool
-%attr(2770,root,nagios-data) %dir %{_localstatedir}/spool/checkresults
+%attr(770,root,nagcmd) %dir %{_localstatedir}
+%attr(2770,root,nagcmd) %dir %{_localstatedir}/rw
+%attr(660,nagios,nagcmd) %ghost %{_localstatedir}/rw/nagios.cmd
%attr(664,root,nagios) %ghost %{_localstatedir}/objects.cache
+%attr(664,root,nagios) %ghost %{_localstatedir}/objects.precache
%attr(664,root,nagios) %ghost %{_localstatedir}/*.dat
%attr(664,root,nagios) %ghost %{_localstatedir}/%{name}.tmp
+%dir %{_var}/spool
+%attr(770,root,nagios) %dir %{_var}/spool/%{name}
+%attr(770,root,nagios) %dir %{_var}/spool/%{name}/checkresults
+
%{_examplesdir}/%{name}-%{version}
%files common
%defattr(644,root,root,755)
-%attr(750,root,nagios-data) %dir %{_sysconfdir}
-%attr(2750,root,nagios) %dir %{_sysconfdir}/plugins
-%attr(2750,root,nagios) %dir %{_sysconfdir}/objects
+%attr(750,root,nagcmd) %dir %{_sysconfdir}
+%attr(750,root,nagios) %dir %{_sysconfdir}/plugins
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/plugins
%dir %{_libdir}/%{name}/eventhandlers
%dir %{_prefix}/lib/%{name}/eventhandlers
%endif
+%files doc
+%defattr(644,root,root,755)
+%{_docdir}/%{name}
+
%files cgi
%defattr(644,root,root,755)
%dir %attr(750,root,http) %{_webapps}/%{_webapp}
%dir %{_datadir}/includes
%dir %{_datadir}/images
%dir %{_datadir}/stylesheets
-%{_datadir}/favicon.ico
%{_datadir}/robots.txt
%{_datadir}/contexthelp
-%{_datadir}/docs
%{_datadir}/media
%{_datadir}/ssi
+%{_datadir}/images/favicon.ico
+%{_datadir}/images/marker.png
+%{_datadir}/images/shadow50.png
%files theme-default
%defattr(644,root,root,755)
%{_datadir}/*.php
%{_datadir}/includes/*
%{_datadir}/images/*
+%exclude %{_datadir}/images/favicon.ico
+%exclude %{_datadir}/images/marker.png
+%exclude %{_datadir}/images/shadow50.png
%{_datadir}/stylesheets/*
%files devel