%define icinga_uid 64300 %define icinga_gid 64300 %define icingacmd_gid 64301 Summary: Open Source host, service and network monitoring program Name: icinga Version: 1.10.0 Release: 1 License: GPL Group: Applications/System URL: http://www.icinga.org/ Packager: Michael Perzl Vendor: Michael Perzl Source0: http://dl.sf.net/icinga/%{name}-%{version}.tar.gz Source1: http://dl.sf.net/icinga/%{name}-%{version}.tar.gz.md5 Source2: %{name}.aix.init Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: gd-devel >= 2.0.35-5 BuildRequires: httpd-devel >= 2.2.16-1 BuildRequires: libdbi-devel >= 0.8.4-1 BuildRequires: libtool-ltdl-devel >= 1.5.26-1 BuildRequires: openssl-devel >= 1.0.1 BuildRequires: perl >= 5.8.8 Requires: httpd >= 2.2.16-1 Requires: libdbi >= 0.8.4-1 Requires: libtool-ltdl >= 1.5.26-1 Requires: openssl >= 1.0.1 Requires: perl >= 5.8.8 %define logdir /var/log/%{name} %define apacheconfdir %{_sysconfdir}/httpd/conf/extra %define apacheuser apache %define apachegroup apache %description Icinga is an application, system and network monitoring application. It can escalate problems by email, pager or any other medium. It is also useful for incident or SLA reporting. Icinga is written in C and is designed 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 Icinga. Icinga is a fork of the nagios project. %package gui Summary: Web content for %{name} Group: Applications/System Requires: %{name} = %{version}-%{release} Requires: httpd Requires: %{name}-doc Requires: gd >= 2.0.35-5 %description gui This package contains the webgui (html,css,cgi etc.) for %{name}. %package idoutils Summary: Database broker module for %{name} Group: Applications/System Requires: %{name} = %{version}-%{release} %description idoutils This package contains the idoutils broker module for %{name} which provides database storage via libdbi. %package doc Summary: Documentation for %{name} Group: Applications/System %description doc This package provides the online documentation for %{name}. %prep %setup -q %patch0 %build export PATH=/opt/freeware/bin:$PATH export CC="xlc_r" export PERL="/opt/freeware/bin/perl" ./configure \ --prefix=%{_prefix} \ --sysconfdir="/etc/%{name}" \ --localstatedir="/var/%{name}" \ --datadir="%{_datadir}/%{name}" \ --datarootdir="%{_datadir}/%{name}" \ --libdir="%{_libdir}/%{name}" \ --libexecdir="%{_libdir}/%{name}/plugins" \ --sbindir="%{_libdir}/%{name}/cgi" \ --enable-nanosleep \ --enable-event-broker \ --enable-idoutils \ --enable-embedded-perl \ --enable-ssl \ --with-icinga-user="%{name}" \ --with-icinga-group="%{name}" \ --with-command-user="%{name}" \ --with-command-group="icingcmd" \ --with-web-user="%{apacheuser}" \ --with-web-group="%{apachegroup}" \ --with-mail="/usr/bin/mail" \ --with-httpd-conf=%{apacheconfdir} \ --with-checkresult-dir="/var/%{name}/checkresults" \ --with-temp-dir="/tmp" \ --with-log-dir="%{logdir}" \ --with-cgi-log-dir="%{logdir}/gui" \ --with-p1-file-dir="%{_libdir}/%{name}" \ --with-init-dir=/etc/rc.d/init.d \ --with-lockfile="/var/%{name}/%{name}.pid" \ --with-gd-lib="%{_libdir}" \ --with-gd-inc="%{_includedir}" \ --with-cgiurl="/%{name}/cgi-bin" \ --with-htmurl="/%{name}" \ --with-dbi-lib="%{_libdir}" \ --with-dbi-inc="%{_includedir}" \ --with-ssl-inc="%{_prefix}" \ --with-ssl-lib="%{_libdir}" \ --with-kerberos-inc="%{_includedir}" # need to patch and re-run config.status as our perl (compiled with GCC) # pulls in some GCC compile options that IBM XLC/C++ doesn't like cat config.status | \ sed 's|-pipe||g' | \ sed 's|-fno-strict-aliasing||g' | \ sed 's|-Xlinker||g' > config.tmp mv config.tmp config.status chmod 0755 config.status ./config.status gmake %{?_smp_mflags} all gmake %{?_smp_mflags} idoutils %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT}%{apacheconfdir} gmake install \ install-init \ install-commandmode \ install-idoutils \ install-config \ install-webconf \ DESTDIR=${RPM_BUILD_ROOT} \ INSTALL_OPTS="" \ INSTALL_OPTS_WEB="" \ COMMAND_OPTS="" \ INIT_OPTS="" /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || : mkdir -p ${RPM_BUILD_ROOT}/etc/%{name}/conf.d # fix log-paths /opt/freeware/bin/perl -pi -e ' s|log_file.*|log_file=%{logdir}/%{name}.log|; s|log_archive_path=.*|log_archive_path=%{logdir}/archives|; s|debug_file=.*|debug_file=%{logdir}/%{name}.debug|; ' ${RPM_BUILD_ROOT}/etc/%{name}/%{name}.cfg # make logdirs mkdir -p ${RPM_BUILD_ROOT}%{logdir}/archives # make checkresults directory mkdir -p ${RPM_BUILD_ROOT}/var/%{name}/checkresults # move idoutils sample configs to final name mv ${RPM_BUILD_ROOT}/etc/%{name}/ido2db.cfg-sample ${RPM_BUILD_ROOT}/etc/%{name}/ido2db.cfg mv ${RPM_BUILD_ROOT}/etc/%{name}/idomod.cfg-sample ${RPM_BUILD_ROOT}/etc/%{name}/idomod.cfg # copy idutils db-script cp -r module/idoutils/db ${RPM_BUILD_ROOT}/etc/%{name}/idoutils # remove icinga-api %{__rm} -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/icinga-api # move icinga sample config for idoutils to final name mv ${RPM_BUILD_ROOT}/etc/%{name}/modules/idoutils.cfg-sample ${RPM_BUILD_ROOT}/etc/%{name}/modules/idoutils.cfg cp %{SOURCE2} ${RPM_BUILD_ROOT}/etc/rc.d/init.d/%{name} chmod 0755 ${RPM_BUILD_ROOT}/etc/rc.d/init.d/%{name} mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/ mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/ ln -sf '../init.d/icinga' ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/S%{name} ln -sf '../init.d/icinga' ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/K%{name} ln -sf '../init.d/icinga' ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/S%{name} ln -sf '../init.d/icinga' ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/K%{name} ln -sf '../init.d/ido2db' ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/Sido2db ln -sf '../init.d/ido2db' ${RPM_BUILD_ROOT}/etc/rc.d/rc2.d/Kido2db ln -sf '../init.d/ido2db' ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/Sido2db ln -sf '../init.d/ido2db' ${RPM_BUILD_ROOT}/etc/rc.d/rc3.d/Kido2db %pre # add the "icinga" group only if it does not yet exist result=`/usr/sbin/lsgroup icinga | /usr/bin/awk '{ print $1 }' 2>/dev/null` if [[ "${result}" != "icinga" ]] ; then /usr/bin/mkgroup -A id=%{icinga_gid} icinga 2> /dev/null || : fi # add the "icingcmd" group only if it does not yet exist result=`/usr/sbin/lsgroup icingacmd | /usr/bin/awk '{ print $1 }' 2>/dev/null` if [[ "${result}" != "icingacmd" ]] ; then /usr/bin/mkgroup -A id=%{icingacmd_gid} icingcmd 2> /dev/null || : fi # add the "icinga" user only if it does not yet exist result=`/usr/sbin/lsuser icinga | /usr/bin/awk '{ print $1 }' 2>/dev/null` if [[ "${result}" != "icinga" ]] ; then /usr/bin/mkuser id=%{icinga_uid} pgrp='icinga' groups='icingcmd' \ home='/var/icinga' gecos='Icinga User' \ login='false' rlogin='false' icinga 2> /dev/null || : fi %preun if [ $1 -eq 0 ]; then /etc/rc.d/init.d/%{name} stop &>/dev/null || : fi %postun if [ "$1" = "0" ]; then # remove "icinga" user and "icinga" and "icingcmd" groups /usr/sbin/rmuser -p icinga || : /usr/sbin/rmgroup icinga || : /usr/sbin/rmgroup icingcmd || : fi %pre gui # add apacheuser to the icingcmd group /usr/bin/chuser groups='icingcmd' %{apacheuser} %preun gui if [ "$1" = 0 ]; then cat %{_sysconfdir}/httpd/conf/httpd.conf | \ grep -v "# Icinga settings" | \ grep -v "Include conf/extra/%{name}.conf" \ > %{_sysconfdir}/httpd/conf/tmp_httpd.conf mv -f %{_sysconfdir}/httpd/conf/tmp_httpd.conf %{_sysconfdir}/httpd/conf/httpd.conf echo "Please restart your web server using: '/opt/freeware/sbin/apachectl restart'" fi %post gui cat %{_sysconfdir}/httpd/conf/httpd.conf | \ grep -v "# Icinga settings" | \ grep -v "Include conf/extra/%{name}.conf" \ > %{_sysconfdir}/httpd/conf/tmp_httpd.conf mv -f %{_sysconfdir}/httpd/conf/tmp_httpd.conf %{_sysconfdir}/httpd/conf/httpd.conf echo "# Icinga settings" >> %{_sysconfdir}/httpd/conf/httpd.conf echo "Include conf/extra/icinga.conf" >> %{_sysconfdir}/httpd/conf/httpd.conf echo "Please restart your web server using: '/opt/freeware/sbin/apachectl restart'" %preun idoutils if [ $1 -eq 0 ]; then /etc/rc.d/init.d/ido2db stop &>/dev/null || : fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,icinga,icinga,-) %attr(755,root,system) /etc/rc.d/init.d/%{name} /etc/rc.d/rc2.d/S%{name} /etc/rc.d/rc2.d/K%{name} /etc/rc.d/rc3.d/S%{name} /etc/rc.d/rc3.d/K%{name} %dir /etc/%{name} %dir /etc/%{name}/conf.d %config(noreplace) /etc/%{name}/icinga.cfg %dir /etc/%{name}/modules %dir /etc/%{name}/objects %config(noreplace) /etc/%{name}/objects/commands.cfg %config(noreplace) /etc/%{name}/objects/contacts.cfg %config(noreplace) /etc/%{name}/objects/localhost.cfg %config(noreplace) /etc/%{name}/objects/notifications.cfg %config(noreplace) /etc/%{name}/objects/printer.cfg %config(noreplace) /etc/%{name}/objects/switch.cfg %config(noreplace) /etc/%{name}/objects/templates.cfg %config(noreplace) /etc/%{name}/objects/timeperiods.cfg %config(noreplace) /etc/%{name}/objects/windows.cfg %config(noreplace) /etc/%{name}/resource.cfg %{_bindir}/icinga %{_bindir}/icingastats %dir %{_libdir}/%{name} %{_libdir}/%{name}/p1.pl %dir /var/%{name} %attr(2755,icinga,icingcmd) %dir /var/%{name}/checkresults %attr(2755,icinga,icingcmd) /var/%{name}/rw %dir %{logdir} %dir %{logdir}/archives %files doc %defattr(-,icinga,icinga,-) %{_datadir}/%{name}/docs %files gui %defattr(-,icinga,icinga,-) %config(noreplace) %attr(-,root,system) %{apacheconfdir}/%{name}.conf %config(noreplace) /etc/%{name}/cgi.cfg %config(noreplace) /etc/%{name}/cgiauth.cfg %dir %{_libdir}/%{name}/cgi %{_libdir}/%{name}/cgi/* %dir %{_datadir}/%{name} %{_datadir}/%{name}/images %{_datadir}/%{name}/index.html %{_datadir}/%{name}/jquery-ui %{_datadir}/%{name}/js %{_datadir}/%{name}/main.html %{_datadir}/%{name}/media %{_datadir}/%{name}/menu.html %{_datadir}/%{name}/robots.txt %{_datadir}/%{name}/ssi %{_datadir}/%{name}/stylesheets %attr(2775,icinga,icingcmd) %dir %{logdir}/gui %attr(664,icinga,icingcmd) %{logdir}/gui/index.htm %attr(664,icinga,icingcmd) %{logdir}/gui/.htaccess %files idoutils %defattr(-,icinga,icinga,-) %attr(755,root,system) /etc/rc.d/init.d/ido2db /etc/rc.d/rc2.d/Sido2db /etc/rc.d/rc2.d/Kido2db /etc/rc.d/rc3.d/Sido2db /etc/rc.d/rc3.d/Kido2db %config(noreplace) /etc/%{name}/ido2db.cfg %config(noreplace) /etc/%{name}/idomod.cfg %config(noreplace) /etc/%{name}/modules/idoutils.cfg %config(noreplace) /etc/%{name}/objects/ido2db_check_proc.cfg /etc/%{name}/idoutils %{_bindir}/ido2db %{_bindir}/log2ido %{_libdir}/%{name}/idomod.so %changelog * Wed Dec 04 2013 Michael Perzl - 1.10.0-1 - updated to version 1.10.0 * Wed Dec 04 2013 Michael Perzl - 1.9.3-1 - updated to version 1.9.3 * Mon Jul 01 2013 Michael Perzl - 1.9.2-1 - updated to version 1.9.2 * Thu Jun 20 2013 Michael Perzl - 1.9.1-1 - updated to version 1.9.1 * Thu Jun 20 2013 Michael Perzl - 1.9.0-1 - updated to version 1.9.0 * Thu Jun 20 2013 Michael Perzl - 1.8.4-1 - updated to version 1.8.4 * Thu Jun 20 2013 Michael Perzl - 1.8.3-1 - updated to version 1.8.3 * Thu Jun 20 2013 Michael Perzl - 1.8.1-1 - updated to version 1.8.1 - fixed the %preun scripts during upgrades - fixed the lists of included files - recompiled against latest version of OpenSSL * Tue Oct 30 2012 Michael Perzl - 1.7.2-1 - updated to version 1.7.2 * Wed Jun 20 2012 Michael Perzl - 1.7.1-1 - updated to version 1.7.1 * Tue Feb 06 2012 Michael Perzl - 1.6.1-1 - updated to version 1.6.1 - drop api package as this is now deprecated and not shipped anymore * Tue Feb 06 2012 Michael Perzl - 1.5.1-1 - updated to version 1.5.1 * Thu Jun 30 2011 Michael Perzl - 1.4.2-1 - updated to version 1.4.2 * Fri May 20 2011 Michael Perzl - 1.3.1-1 - updated to version 1.3.1 * Thu Nov 11 2010 Michael Perzl - 1.2.1-1 - first version for AIX V5.1 and higher