# # _with_pgsql - enable pgsql support # _with_mysql - enable mysql support # _without_gd - without statusmap and trends, which require gd library Summary: Host/service/network monitoring program Summary(pl): Program do monitorowania serwerów/usług/sieci Summary(pt_BR): Programa para monitoraçăo de máquinas e serviços Name: nagios Version: 1.0 Release: 1 License: GPL v2 Group: Networking Source0: ftp://ftp.sourceforge.net/pub/sourceforge/%{name}/%{name}-%{version}.tar.gz Source1: %{name}-apache.conf Source2: %{name}.init Patch0: %{name}-pgsql.patch URL: http://www.nagios.org/ %{!?_without_gd:BuildRequires: gd-devel} %{?_with_pgsql:BuildRequires: postgresql-devel} %{?_with_mysql:BuildRequires: mysql-devel} PreReq: rc-scripts PreReq: sh-utils Requires(pre): /usr/bin/getgid Requires(pre): /bin/id Requires(pre): /usr/sbin/groupadd Requires(pre): /usr/sbin/useradd Requires(post,postun): /sbin/chkconfig Conflicts: iputils-ping < 1:ss020124 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) Obsoletes: netsaint %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 in nagios-plugins packages. Nagios is successor to NetSaint. %description -l pl Nagios to program, który monitoruje serwery oraz usługi w naszej sieci. Posiada on możliwość wysyłania informacji o wystąpieniu oraz rozwiązaniu problemu. Nagios został napisany w C oraz jest zaprojektowany do pracy pod Linuksem (i niektórymi innymi uniksami) jako proces pracujący w tle i bezustannie wykonujący pewne operacje sprawdzające. Właściwe sprawdzanie jest wykonywane przez osobne programy ("wtyczki"), które zwracają informacje o statusie do Nagiosa. Wtyczki są dostępne na stronie w pakietach nagios-plugins. Nagios jest następcą NetSainta. %description -l pt_BR O Nagios é um programa que monitora máquinas e serviços na sua rede. Ele pode enviar um email ou um aviso de pager para o administrador quando surgir um problema e quando ele for resolvido. Nagios é escrito em C e foi desenvolvido para rodar em plataformas Linux (e algumas variaçőes de *NIX) como um processo em segundo plano, periodicamente executando checagens nos diversos serviços que forem especificados. %package cgi Summary: CGI webinterface for Nagios Summary(pl): Interfejs WWW/CGI dla Nagiosa Group: Networking Requires: apache %description cgi CGI webinterface for Nagios. %description cgi -l pl Interfejs CGI dla Nagiosa. %package devel Summary: Include files that Netsaint-related applications may compile against Summary(pl): Pliki nagłówkowe, wykorzystywane przez aplikacje nagiosa Summary(pt_BR): Arquivos de cabeçalho necessários para desenvolvimento de aplicativos para o Nagios Group: Development/Libraries %description devel This package provides include files that Netsaint-related applications may compile against. %description devel -l pl Ten pakiet dostarcza pliki nagłówkowe, które mogą być wykorzystywane przez aplikacje związane z nagiosem podczas kompilacji. %description devel -l pt_BR Este pacote contém arquivos de cabeçalho usados no desenvolvimento de aplicativos para o Nagios. %prep %setup -q -n %{name}-%{version} %patch -p1 %build %configure2_13 \ --with-nagios-user=%{name} \ --with-nagios-grp=%{name} \ --with-command-user=nobody \ --with-command-grp=nobody \ --with-init-dir=/etc/rc.d/init.d \ --with-lockfile=/var/run/%{name}.pid \ --with-gd-lib=%{_libdir} \ --with-gd-inc=%{_includedir} \ --with-cgiurl=/nagios/cgi-bin \ --with-htmurl=/nagios \ --with-ping_command='/bin/ping -n %%s -c %%d' \ %{?_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} \ %{?_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} \ %{?_without_gd:--disable-statusmap --disable-trends} \ --exec-prefix=%{_sbindir} \ --bindir=%{_sbindir} \ --sbindir=%{_libdir}/%{name}/cgi \ --libexecdir=%{_libdir}/%{name}/plugins \ --datadir=%{_datadir}/%{name} \ --sysconfdir=%{_sysconfdir}/nagios \ --localstatedir=/var/lib/%{name} %{__make} all %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,httpd} install -d $RPM_BUILD_ROOT%{_includedir}/%{name} install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins install -d $RPM_BUILD_ROOT%{_var}/log/%{name} install common/locations.h $RPM_BUILD_ROOT%{_includedir}/%{name} %{__make} install install-html install-config install-init install-commandmode fullinstall \ DESTDIR=$RPM_BUILD_ROOT \ INSTALL_OPTS="" \ INIT_OPTS="" \ COMMAND_OPTS="" install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/%{name}.conf install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name} rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}command.cfg %clean rm -rf $RPM_BUILD_ROOT %pre if [ -n "`getgid %{name}`" ]; then if [ "`getgid %{name}`" != "72" ]; then echo "Error: group %{name} doesn't have gid=72. Correct this before installing %{name}." 1>&2 exit 1 fi else /usr/sbin/groupadd -g 72 -f %{name} fi if [ -n "`id -u %{name} 2>/dev/null`" ]; then if [ "`id -u %{name}`" != "72" ]; then echo "Error: user %{name} doesn't have uid=72. Correct this before installing %{name}." 1>&2 exit 1 fi else /usr/sbin/useradd -u 72 -d %{_libdir}/%{name} -s /bin/false -c "%{name} User" -g %{name} %{name} 1>&2 fi %post /sbin/chkconfig --add %{name} if [ -f /var/lock/subsys/%{name} ]; then /etc/rc.d/init.d/%{name} restart 1>&2 fi %preun if [ "$1" = "0" ] ; then if [ -f /var/lock/subsys/%{name} ]; then /etc/rc.d/init.d/%{name} stop 1>&2 fi /sbin/chkconfig --del %{name} fi %postun if [ "$1" = "0" ]; then /usr/sbin/userdel %{name} /usr/sbin/groupdel %{name} fi %files %defattr(644,root,root,755) %doc Changelog README* UPGRADING contrib/database %attr(754,root,root) %{_sysconfdir}/rc.d/init.d/%{name} %attr(751,root,nagios) %dir %{_sysconfdir}/%{name} %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/nagios.cfg-sample %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/checkcommands.cfg-sample %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/contactgroups.cfg-sample %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/contacts.cfg-sample %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/dependencies.cfg-sample %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/escalations.cfg-sample %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/hostgroups.cfg-sample %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/hosts.cfg-sample %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/misccommands.cfg-sample %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/resource.cfg-sample %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/services.cfg-sample %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/timeperiods.cfg-sample %dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/plugins %attr(755,root,root) %{_sbindir}/%{name} %attr(771,nagios,http) %{_var}/log/%{name} %files cgi %defattr(644,root,root,755) %attr(640,root,http) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd/%{name}.conf %attr(644,root,http) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/cgi.cfg-sample %dir %{_libdir}/%{name}/cgi %attr(755,root,root) %{_libdir}/%{name}/cgi/*.cgi %{_datadir}/%{name} %files devel %defattr(644,root,root,755) %dir %{_includedir}/%{name} %{_includedir}/%{name}/*.h