3 %bcond_with pgsql # enable pgsql support
4 %bcond_with mysql # enable MySQL support
5 %bcond_without gd # without statusmap and trends, which require gd library
8 # - remove *-sample from /etc - move it to %doc or place without "-sample" suffix
9 Summary: Host/service/network monitoring program
10 Summary(pl): Program do monitorowania serwerów/us³ug/sieci
11 Summary(pt_BR): Programa para monitoração de máquinas e serviços
17 Source0: http://dl.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
18 # Source0-md5: 414d70e5269d5b8d7c21bf3ee129309f
19 Source1: %{name}-apache.conf
21 Source3: http://dl.sf.net/nagios/imagepak-base.tar.gz
22 Patch0: %{name}-pgsql.patch
23 Patch1: %{name}-resources.patch
24 Patch2: %{name}-iconv-in-libc.patch
25 URL: http://www.nagios.org/
26 BuildRequires: autoconf
27 BuildRequires: automake
29 BuildRequires: gd-devel
30 BuildRequires: libjpeg-devel
31 BuildRequires: libpng-devel
33 %{?with_mysql:BuildRequires: mysql-devel}
34 %{?with_pgsql:BuildRequires: postgresql-devel}
35 BuildRequires: rpmbuild(macros) >= 1.159
38 Requires(pre): /usr/bin/getgid
39 Requires(pre): /bin/id
40 Requires(pre): /usr/sbin/groupadd
41 Requires(pre): /usr/sbin/groupmod
42 Requires(pre): /usr/sbin/useradd
43 Requires(pre): /usr/sbin/usermod
44 Requires(post,postun): /sbin/chkconfig
45 Requires(postun): /usr/sbin/groupdel
46 Requires(postun): /usr/sbin/userdel
47 Provides: user(nagios)
48 Provides: group(nagios)
49 Conflicts: iputils-ping < 1:ss020124
51 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53 %define _sysconfdir /etc/%{name}
54 %define _bindir %{_prefix}/sbin
55 %define _sbindir %{_libdir}/%{name}/cgi
56 %define _datadir %{_prefix}/share/%{name}
57 %define _localstatedir /var/lib/%{name}
60 Nagios is a program that will monitor hosts and services on your
61 network. It has the ability to email or page you when a problem arises
62 and when a problem is resolved. Nagios is written in C and is designed
63 to run under Linux (and some other *NIX variants) as a background
64 process, intermittently running checks on various services that you
67 The actual service checks are performed by separate "plugin" programs
68 which return the status of the checks to Nagios. The plugins are
69 available in nagios-plugins packages.
71 Nagios is successor to NetSaint.
74 Nagios to program, który monitoruje serwery oraz us³ugi w naszej
75 sieci. Posiada on mo¿liwo¶æ wysy³ania informacji o wyst±pieniu oraz
76 rozwi±zaniu problemu. Nagios zosta³ napisany w C oraz jest
77 zaprojektowany do pracy pod Linuksem (i niektórymi innymi uniksami)
78 jako proces pracuj±cy w tle i bezustannie wykonuj±cy pewne operacje
81 W³a¶ciwe sprawdzanie jest wykonywane przez osobne programy
82 ("wtyczki"), które zwracaj± informacje o statusie do Nagiosa. Wtyczki
83 s± dostêpne na stronie w pakietach nagios-plugins.
85 Nagios jest nastêpc± NetSainta.
88 O Nagios é um programa que monitora máquinas e serviços na sua rede.
89 Ele pode enviar um email ou um aviso de pager para o administrador
90 quando surgir um problema e quando ele for resolvido. Nagios é escrito
91 em C e foi desenvolvido para rodar em plataformas Linux (e algumas
92 variações de *NIX) como um processo em segundo plano, periodicamente
93 executando checagens nos diversos serviços que forem especificados.
96 Summary: CGI webinterface for Nagios
97 Summary(pl): Interfejs WWW/CGI dla Nagiosa
99 # for dirs... and accessing local logs(?)
100 Requires: %{name} = %{version}-%{release}
104 CGI webinterface for Nagios.
106 %description cgi -l pl
107 Interfejs CGI dla Nagiosa.
110 Summary: Include files that Netsaint-related applications may compile against
111 Summary(pl): Pliki nag³ówkowe, wykorzystywane przez aplikacje nagiosa
112 Summary(pt_BR): Arquivos de cabeçalho necessários para desenvolvimento de aplicativos para o Nagios
113 Group: Development/Libraries
114 # doesn't require base
117 This package provides include files that Netsaint-related applications
120 %description devel -l pl
121 Ten pakiet dostarcza pliki nag³ówkowe, które mog± byæ wykorzystywane
122 przez aplikacje zwi±zane z nagiosem podczas kompilacji.
124 %description devel -l pt_BR
125 Este pacote contém arquivos de cabeçalho usados no desenvolvimento de
126 aplicativos para o Nagios.
130 %{?with_pgsql:%patch0 -p1}
138 --with-nagios-user=%{name} \
139 --with-nagios-grp=%{name} \
140 --with-command-user=nobody \
141 --with-command-grp=nobody \
142 --with-lockfile=/var/run/%{name}.pid \
143 --with-ping_command='/bin/ping -n %%s -c %%d' \
144 %{?with_mysql:--with-mysql-xdata --with-mysql-status --with-mysql-comments --with-mysql-extinfo --with-mysql-retention --with-mysql-downtime --with-mysql-lib=%{_libdir} --with-mysql-inc=%{_includedir}/mysql} \
145 %{?with_pgsql:--with-pgsql-xdata --with-pgsql-status --with-pgsql-comments --with-pgsql-extinfo --with-pgsql-retention --with-pgsql-downtime--with-pgsql-lib=%{_libdir} --with-pgsql-inc=%{_includedir}/postgresql} \
146 %{!?with_gd:--disable-statusmap --disable-trends}
151 rm -rf $RPM_BUILD_ROOT
152 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,httpd},%{_includedir}/%{name},%{_libdir}/%{name}/plugins} \
153 $RPM_BUILD_ROOT{%{_var}/log/%{name},%{_localstatedir}}
155 install common/locations.h $RPM_BUILD_ROOT%{_includedir}/%{name}
157 %{__make} install install-html install-config install-init install-commandmode fullinstall \
158 DESTDIR=$RPM_BUILD_ROOT \
163 install %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
164 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
167 tar -xvz -C $RPM_BUILD_ROOT%{_datadir}/images/logos -f %{SOURCE3}
171 rm -rf $RPM_BUILD_ROOT
174 if [ -n "`getgid nagios`" ]; then
175 if [ "`getgid nagios`" != "72" ]; then
176 echo "Error: group nagios doesn't have gid=72. Correct this before installing %{name}." 1>&2
180 if [ -n "`getgid netsaint`" -a "`getgid netsaint`" = "72" ]; then
181 /usr/sbin/groupmod -n nagios netsaint
183 /usr/sbin/groupadd -g 72 -f nagios
186 if [ -n "`id -u nagios 2>/dev/null`" ]; then
187 if [ "`id -u nagios`" != "72" ]; then
188 echo "Error: user nagios doesn't have uid=72. Correct this before installing %{name}." 1>&2
192 if [ -n "`id -u netsaint 2>/dev/null`" -a "`id -u netsaint`" = "72" ]; then
193 /usr/sbin/usermod -d /tmp -l nagios netsaint
195 /usr/sbin/useradd -u 72 -d %{_libdir}/nagios -s /bin/false -c "%{name} User" -g nagios nagios 1>&2
200 /sbin/chkconfig --add %{name}
201 if [ -f /var/lock/subsys/%{name} ]; then
202 /etc/rc.d/init.d/%{name} restart 1>&2
206 if [ "$1" = "0" ] ; then
207 if [ -f /var/lock/subsys/%{name} ]; then
208 /etc/rc.d/init.d/%{name} stop 1>&2
210 /sbin/chkconfig --del %{name}
214 if [ "$1" = "0" ]; then
220 %defattr(644,root,root,755)
221 %doc Changelog README* UPGRADING contrib/database
222 %attr(754,root,root) /etc/rc.d/init.d/%{name}
223 %attr(751,root,nagios) %dir %{_sysconfdir}
224 %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/[!c]*
225 %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/c[!g]*
226 %dir %{_libdir}/%{name}
227 %dir %{_libdir}/%{name}/plugins
228 %attr(755,root,root) %{_bindir}/%{name}
229 %attr(771,nagios,http) %{_var}/log/%{name}
230 %attr(775,nagios,nagios) %dir %{_localstatedir}
231 %attr(775,nagios,nagios) %dir %{_localstatedir}/archives
232 %attr(2775,nagios,http) %dir %{_localstatedir}/rw
235 %defattr(644,root,root,755)
236 %attr(640,root,http) %config(noreplace) %verify(not size mtime md5) /etc/httpd/%{name}.conf
237 %attr(644,root,http) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/cgi.cfg-sample
238 %dir %{_libdir}/%{name}/cgi
239 %attr(755,root,root) %{_libdir}/%{name}/cgi/*.cgi
243 %defattr(644,root,root,755)
244 %dir %{_includedir}/%{name}
245 %{_includedir}/%{name}/*.h