Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.3
icinga
icinga.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File icinga.spec of Package icinga
# # spec file for package icinga # # Copyright (c) 2013 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: icinga Version: 1.8.4 Release: 0 Summary: Host/service/network monitoring program License: GPL-2.0 Group: System/Monitoring Url: http://www.icinga.org/ Source0: %{name}-%{version}.tar.gz Source1: rc%{name} Source2: rcido2db Source3: %{name}.sysconfig Source4: suse.de-%{name} Source5: icinga-rpmlintrc Source6: icinga.8 Source7: icingastats.8 Source8: ido2db.8 Source9: mini_epn_icinga.8 Source10: README.SUSE Source11: README.SUSE.idoutils Source12: update_icinga_paths.sh Source13: convertcfg.8 Source14: new_mini_epn.8 Source15: mini_epn.8 # PATCH-FIX-OPENSUSE icinga-add-ifdefine-to-apache.patch Patch0: icinga-add-ifdefine-to-apache.patch Provides: monitoring_daemon BuildRequires: apache2-devel BuildRequires: nagios-rpm-macros >= 0.05 %if 0%{?suse_version} >= 1110 BuildRequires: fdupes %endif BuildRequires: freetype2-devel BuildRequires: gd-devel > 1.8 BuildRequires: iputils BuildRequires: krb5-devel BuildRequires: libdbi-devel BuildRequires: libjpeg-devel BuildRequires: libopenssl-devel BuildRequires: libpng-devel BuildRequires: mailx BuildRequires: net-snmp-devel BuildRequires: net-tools BuildRequires: openssl BuildRequires: pcre-devel BuildRequires: zlib-devel Requires: net-tools Requires(pre): %fillup_prereq Requires(pre): %insserv_prereq Requires(pre): /bin/logger Requires(pre): fileutils Requires(pre): gawk Requires(pre): grep Requires(pre): pwdutils Requires(pre): sed %if 0%{?suse_version} < 1140 Requires: perl = %{perl_version} %else %{perl_requires} %endif Requires: mailx Recommends: %{name}-plugins-eventhandlers Recommends: %{name}-www Recommends: cron Recommends: logrotate Recommends: nagios-plugins Recommends: net-snmp Recommends: openssl BuildRoot: %{_tmppath}/%{name}-%{version}-build %define apacheconfdir %{_sysconfdir}/apache2/conf.d %define apachegroup www # Macro that print mesages to syslog at package (un)install time %define logmsg logger -t %{name}/rpm %description Icinga 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. Icinga 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 Icinga. The plugins are available at http://sourceforge.net/projects/icingaplug This package provide core programs for icinga. The web interface, documentation, and development files are built as separate packages %package www Summary: Provides the HTML and CGI files for the Icinga web interface Group: System/Monitoring Provides: monitoring_webfrontend Requires: %{name} = %{version} Recommends: %{name}-doc = %{version} Requires(pre): apache2 %description www Icinga 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. Icinga 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 Icinga 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 Icinga web interface. In addition, HTML documentation is included in this package %package devel Summary: Provides include files that Icinga-related applications may compile against Group: Development/Libraries/C and C++ Requires: %{name} = %{version} %description devel Icinga 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. Icinga 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 Icinga-related applications may compile against. %package idoutils Summary: Provides the IDOUtils functionality for Icinga Group: System/Monitoring Requires: %{name}-idoutils-drivers-dbd >= %{version} Requires(pre): %{name} = %{version} %description idoutils Icinga 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. Icinga 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 the IDOUtils extensions for Icinga %package idoutils-mysql Summary: IDOUtils drivers for MySQL Group: System/Monitoring Requires: %{name}-idoutils = %{version} Requires: libdbi-drivers-dbd-mysql Requires: perl(DBD::mysql) Recommends: mysql Recommends: mysql-client Provides: %{name}-idoutils-drivers-dbd = %{version} Conflicts: idoutils-oracle Conflicts: idoutils-pgsql %description idoutils-mysql This package requires all needed packages for using IDOUtils with MySQL. %package idoutils-oracle Summary: IDOUtils drivers for Oracle Group: System/Monitoring Requires: %{name}-idoutils = %{version} Recommends: oracle-client Provides: %{name}-idoutils-drivers-dbd = %{version} Conflicts: idoutils-pgsql Conflicts: idoutils-mysql %description idoutils-oracle This package requires all needed packages for using IDOUtils with OracleDB. %package idoutils-pgsql Summary: IDOUtils drivers for PostgreSQL Group: System/Monitoring Requires: %{name}-idoutils = %{version} Requires: libdbi-drivers-dbd-pgsql Recommends: postgresql Recommends: postgresql-libs Provides: %{name}-idoutils-drivers-dbd = %{version} Conflicts: idoutils-mysql Conflicts: idoutils-oracle %description idoutils-pgsql This package requires all needed packages for using IDOUtils with PostgreSQL. %package doc Summary: Online documentation for %{name} Group: System/Monitoring Recommends: %{name}-web = %{version} %description doc This package provides the online documentation for %{name}. %package plugins-eventhandlers Summary: Eventhandlers for %{name} Group: System/Monitoring Recommends: %{name} = %{version} %description plugins-eventhandlers Eventhandlers for %{name}. Providing different scripts for distributed monitoring, redundancy and disabling and enabling service checks and notifications. %package plugins-downtimes Summary: Recurring Downtimes Management for %{name} Group: System/Monitoring Requires: %{name} = %{version} Requires: perl-Date-Calc %description plugins-downtimes Provides scripts to manage recurring downtimes for %{name}. http://docs.icinga.org/latest/en/recurring_downtimes.html %prep %setup -q %patch0 -p1 # remove GPLv3+ source files which are not needed for this package rm "t-tap/"*.c %build export PATH_TO_TRACEROUTE="%{_sbindir}/traceroute" %configure \ --prefix="%{icinga_datadir}" \ --exec-prefix="%{_sbindir}" \ --bindir="%{_sbindir}" \ --datadir="%{icinga_datadir}" \ --datarootdir="%{icinga_datadir}" \ --libexecdir="%{icinga_plugindir}" \ --localstatedir="%{icinga_localstatedir}" \ --libdir="%{icinga_libdir}" \ --sbindir="%{icinga_cgidir}" \ --sysconfdir="%{icinga_sysconfdir}" \ --with-command-user="%{icinga_command_user}" \ --with-command-group="%{icinga_command_group}" \ --with-gd-lib="%{_libdir}" \ --with-gd-inc="%{_includedir}" \ --with-htmurl="/%{name}" \ --with-cgiurl="/%{name}/cgi-bin" \ --with-mainurl="/%{name}/cgi-bin/status.cgi?host=all&type=detail&servicestatustypes=29" \ --with-init-dir="%{_initrddir}" \ --with-lockfile="%{icinga_lockfile}" \ --with-icinga-user="%{icinga_user}" \ --with-icinga-group="%{icinga_group}" \ --with-httpd-conf="%{apacheconfdir}" \ --with-log-dir="%{icinga_logdir}" \ --with-perlcache \ --enable-cgi-log \ --enable-event-broker \ --enable-embedded-perl \ --enable-idoutils \ --enable-ssl \ --with-cgi-log-dir="%{icinga_cgi_logdir}" \ --with-plugin-dir="%{icinga_plugindir}" \ --with-eventhandler-dir="%{icinga_eventhandlerdir}" \ --with-p1-file-dir="%{icinga_datadir}" \ --with-checkresult-dir="%{icinga_checkresultdir}" \ --with-ext-cmd-file-dir="%{icinga_cmd_filedir}" \ --with-http-auth-file="%{icinga_http_authfile}" \ --with-icinga-chkfile="%{icinga_chkfile}" \ --with-ido2db-lockfile="%{icinga_ido2db_lockfile}" \ --with-ido-sockfile="%{icinga_ido2db_socketfile}" \ --with-idomod-tmpfile="%{icinga_idomod_tmpfile}" \ --with-state-dir="%{icinga_spooldir}" make %{?_smp_mflags} all # make daemonchk.cgi and event handlers pushd contrib 1>/dev/null for f in `find . -type f` ; do sed -i "s=/usr/local/icinga/var/status.dat=%{icinga_spooldir}/status.dat=; \ s=/usr/local/icinga/var/icinga.lock=%{icinga_ido2db_lockfile}=; \ s=NscaBin\=\"/usr/local/icinga/libexec/send_nsca\"=NscaBin\=/usr/bin/send_nsca=; \ s=/usr/local/icinga/libexec/eventhandlers/=%{icinga_eventhandlerdir}/=; \ s=/usr/local/nagios/libexec/eventhandlers/=%{icinga_eventhandlerdir}/=; \ s=\$icinga/etc/=%{icinga_sysconfdir}/=; \ s=/usr/local/icinga/etc/=%{icinga_sysconfdir}/=" ${f} done popd 1>/dev/null make %{?_smp_mflags} -C contrib %install make \ install-unstripped \ install-init \ install-commandmode \ install-idoutils \ install-config \ install-webconf \ install-eventhandlers \ DESTDIR=%{buildroot} \ INSTALL_OPTS="" \ INSTALL_OPTS_WEB="" \ COMMAND_OPTS="" \ INIT_OPTS="" make install -C contrib \ DESTDIR=%{buildroot} \ INSTALL_OPTS="" # make SUSE readmes available cp %{SOURCE10} ./ cp %{SOURCE11} ./ # replace placeholders in the update_icinga_paths.sh script sed -i "s=%%{logmsg}=%{logmsg}=; \ s=%%{icinga_lockfile}=%{icinga_lockfile}=; \ s=%%{icinga_sysconfdir}=%{icinga_sysconfdir}=; \ s=%%{icinga_eventhandlerdir}=%{icinga_eventhandlerdir}=; \ s=%%{icinga_spooldir}=%{icinga_spooldir}=; \ s=%%{icinga_ido2db_lockfile}=%{icinga_ido2db_lockfile}=; \ s=%%{icinga_ido2db_socketfile}=%{icinga_ido2db_socketfile}=; \ s=%%{icinga_cmdfile}=%{icinga_cmdfile}=" %{SOURCE12} # make update_icinga_paths.sh script available chmod +x %{SOURCE12} mkdir -p ./examples cp %{SOURCE12} ./examples # make unsupported mysql db creation script available pushd module/idoutils/db 1>/dev/null mkdir -p examples cp scripts/create_mysqldb.sh examples/ popd 1>/dev/null # move idoutils sample configs to final name mv "%{buildroot}%{icinga_sysconfdir}/ido2db.cfg-sample" "%{buildroot}%{icinga_sysconfdir}/ido2db.cfg" mv "%{buildroot}%{icinga_sysconfdir}/idomod.cfg-sample" "%{buildroot}%{icinga_sysconfdir}/idomod.cfg" mv "%{buildroot}%{icinga_sysconfdir}/modules/idoutils.cfg-sample" "%{buildroot}%{icinga_sysconfdir}/modules/idoutils.cfg" # fix resource.cfg eventhandler path - otherwise it creates problem with the update_config_files script sed -i "s|/usr/lib/nagios/plugins/eventhandlers|%{icinga_eventhandlerdir}|g" "%{buildroot}%{icinga_sysconfdir}/resource.cfg" # remove unnecessary files from www log directory rm "%{buildroot}/%{icinga_cgi_logdir}/"{.htaccess,index.htm} # remove setuid from %%{icinga_cmd_filedir} chmod -s "%{buildroot}%{icinga_cmd_filedir}" # install logrotate rule install -D -m 0644 icinga.logrotate %{buildroot}%{icinga_logrotatefile} # install sample htpasswd file install -D -m 0644 icinga.htpasswd %{buildroot}%{icinga_http_authfile} # create icinga localstatedir install -d -m 0755 %{buildroot}%{icinga_localstatedir} # install eventhandlers cp -r contrib/eventhandlers/* "%{buildroot}%{icinga_eventhandlerdir}" # install downtimes cp -r contrib/downtimes "%{buildroot}%{icinga_libdir}/" # install headers for development package install -d -m0755 "%{buildroot}%{_includedir}/%{name}/" install -m0644 include/{config,snprintf,cgiutils,locations}.h "%{buildroot}%{_includedir}/%{name}" # REST of special SUSE stuff here, if needed.... # init-scripts # remove the default init script as SUSE uses an adapted one install -D -m0755 %{SOURCE1} "%{buildroot}%{_initrddir}/%{name}" ln -sf ../../%{_initrddir}/%{name} "%{buildroot}%{_sbindir}/rc%{name}" install -D -m0755 %{SOURCE2} "%{buildroot}%{_initrddir}/ido2db" ln -sf ../../%{_initrddir}/ido2db "%{buildroot}%{_sbindir}/rcido2db" # sysconfig script install -D -m 0644 %{SOURCE3} "%{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}" # install cronjob (gzip' the logfiles) install -D -m 0640 %{SOURCE4} "%{buildroot}%{_sysconfdir}/cron.weekly/%{name}" %if 0%{?suse_version} >= 1110 %fdupes -s %{buildroot} %endif # fix documentation rm "sample-config/"*.in rm "sample-config/template-object/"*.in rm "module/idoutils/config/"*.in # install manpages from Debian install -d -m0755 "%{buildroot}%{_mandir}/man8/" install -m644 %{SOURCE6} "%{buildroot}%{_mandir}/man8/" install -m644 %{SOURCE7} "%{buildroot}%{_mandir}/man8/" install -m644 %{SOURCE8} "%{buildroot}%{_mandir}/man8/" install -m644 %{SOURCE9} "%{buildroot}%{_mandir}/man8/" install -m644 %{SOURCE13} "%{buildroot}%{_mandir}/man8/" install -m644 %{SOURCE14} "%{buildroot}%{_mandir}/man8/" install -m644 %{SOURCE15} "%{buildroot}%{_mandir}/man8/" %pre # add icinga user and groups groupadd -r %{icinga_group} 2>/dev/null || : groupadd -r %{icinga_command_group} 2>/dev/null || : /usr/sbin/useradd -c %{icinga_user} -s /sbin/nologin -r -d %{icinga_localstatedir} -G %{icinga_command_group} -g %{icinga_group} %{icinga_user} 2> /dev/null || : %post if [ ${1:-0} -gt 1 ] then # On Update %{_defaultdocdir}/%{name}/examples/update_icinga_paths.sh %{name} else # On installation # First installation: create an alias for the default nagiosadmin user if [ -r etc/aliases ]; then if ! grep -q "^%{name}:" etc/aliases; then echo -e "%{name}:\troot" >> etc/aliases %{logmsg} "Added alias for user %{name} to /etc/aliases" if [ -x usr/bin/newaliases ]; then usr/bin/newaliases &>/dev/null || true else %{logmsg} "Cannot execute newaliases. Please run it manually." fi fi fi fi %{fillup_and_insserv %{name}} %preun %stop_on_removal %{name} %postun %restart_on_update %{name} %{insserv_cleanup} %post www # If apache is installed, and we can find the apache user, set a shell var if [ -f etc/apache2/uid.conf ]; then wwwusr=$(awk '/^[ \t]*User[ \t]+[a-zA-Z0-9]+/ {print $2}' etc/apache2/uid.conf) else wwwusr=$(awk '/^[ \t]*User[ \t]+[a-zA-Z0-9]+/ {print $2}' etc/apache2/*.conf) fi if [ "$wwwusr" == "" ]; then # otherwise, use the default wwwusr=%{icinga_command_user} fi # if apache user is not in cmdgrp, add it if /usr/bin/id -Gn $wwwusr 2>/dev/null | /bin/grep -q %{icinga_command_group} > /dev/null 2>&1 ; then : # $wwwusr (default: %%{icinga_command_user}) is already in %%{icinga_command_group} group else # modify apache user, adding it to cmdgrp %if 0%{?suse_version} > 1220 usermod -a -G %{icinga_command_group} $wwwusr %else groupmod -A $wwwusr %{icinga_command_group} 2>/dev/null %endif %{logmsg} "User $wwwusr added to group %{icinga_command_group} so sending commands to Icinga from the command CGI is possible." fi if [ ${1:-0} -eq 1 ] then # this is the initial installation: enable icinga test -x %{_sbindir}/a2enflag && %{_sbindir}/a2enflag ICINGA >/dev/null fi %restart_on_update apache2 %preun www %restart_on_update apache2 %postun www if [ "$1" = "0" ]; then # deinstallation of the package - remove the apache flag test -x %{_sbindir}/a2disflag && %{_sbindir}/a2disflag ICINGA >/dev/null %restart_on_update apache2 fi %post idoutils if [ ${1:-0} -gt 1 ] then # On Update %{_defaultdocdir}/%{name}/examples/update_icinga_paths.sh %{name}-idoutils fi %{logmsg} "icinga-idoutils installed: Don't forget to install/upgrade your db schema, check /usr/share/doc/packages/icinga-idoutils/README.SUSE.idoutils" %{fillup_and_insserv ido2db} %preun idoutils %stop_on_removal ido2db %postun idoutils %restart_on_update ido2db %insserv_cleanup %files %defattr(-,root,root) %doc README LICENSE Changelog UPGRADING LEGAL sample-config/ README.SUSE examples %{_mandir}/man8/icinga*.8* %{_mandir}/man8/mini_epn_icinga.8* %{_mandir}/man8/convertcfg.8* %{_mandir}/man8/new_mini_epn.8* %{_mandir}/man8/mini_epn.8* %{_initrddir}/%{name} %{_sbindir}/%{name} %attr(0754,root,%{icinga_group}) %{_sbindir}/icingastats %{_sbindir}/mini_epn %{_sbindir}/new_mini_epn %{_sbindir}/rc%{name} %{icinga_datadir}/p1.pl %{_localstatedir}/adm/fillup-templates/sysconfig.%{name} %attr(0755,root,root) %config %{_sysconfdir}/cron.weekly/%{name} %dir %{icinga_libdir} %{_sbindir}/convertcfg %dir %{icinga_sysconfdir} %dir %{icinga_sysconfdir}/modules %config(noreplace) %{icinga_sysconfdir}/icinga.cfg %dir %{icinga_sysconfdir}/objects %dir %{_sysconfdir}/%{name}/conf.d %config(noreplace) %{icinga_logrotatefile} %config(noreplace) %{icinga_sysconfdir}/objects/commands.cfg %config(noreplace) %{icinga_sysconfdir}/objects/contacts.cfg %config(noreplace) %{icinga_sysconfdir}/objects/notifications.cfg %config(noreplace) %{icinga_sysconfdir}/objects/localhost.cfg %config(noreplace) %{icinga_sysconfdir}/objects/printer.cfg %config(noreplace) %{icinga_sysconfdir}/objects/switch.cfg %config(noreplace) %{icinga_sysconfdir}/objects/templates.cfg %config(noreplace) %{icinga_sysconfdir}/objects/timeperiods.cfg %config(noreplace) %{icinga_sysconfdir}/objects/windows.cfg %config(noreplace) %attr(0640,icinga,icinga) %{icinga_sysconfdir}/resource.cfg %defattr(-,%{icinga_user},%{icinga_group}) %dir %{icinga_logdir} %dir %{icinga_logdir}/archives %dir %{icinga_localstatedir} %dir %{icinga_spooldir} %dir %{icinga_spooldir}/checkresults %ghost %{icinga_cmd_filedir} %files www %defattr(-,root,root) %config(noreplace) %{apacheconfdir}/%{name}.conf %config(noreplace) %{icinga_sysconfdir}/cgi.cfg %config(noreplace) %{icinga_sysconfdir}/cgiauth.cfg %config(noreplace) %attr(0640,root,%{apachegroup}) %{icinga_http_authfile} %dir %{icinga_cgidir}/ %{icinga_cgidir}/avail.cgi %{icinga_cgidir}/cmd.cgi %{icinga_cgidir}/config.cgi %{icinga_cgidir}/extinfo.cgi %{icinga_cgidir}/histogram.cgi %{icinga_cgidir}/history.cgi %{icinga_cgidir}/notifications.cgi %{icinga_cgidir}/outages.cgi %{icinga_cgidir}/showlog.cgi %{icinga_cgidir}/status.cgi %{icinga_cgidir}/statusmap.cgi %{icinga_cgidir}/summary.cgi %{icinga_cgidir}/tac.cgi %{icinga_cgidir}/trends.cgi %{icinga_cgidir}/daemonchk.cgi %{icinga_cgidir}/traceroute.cgi %dir %{icinga_datadir} %{icinga_datadir}/images %{icinga_datadir}/index.html %{icinga_datadir}/js %{icinga_datadir}/main.html %{icinga_datadir}/media %{icinga_datadir}/menu.html %{icinga_datadir}/robots.txt %{icinga_datadir}/ssi %{icinga_datadir}/stylesheets %{icinga_datadir}/jquery-ui %attr(0775,%{icinga_command_user},%{icinga_command_group}) %dir %{icinga_cgi_logdir} %files idoutils %defattr(-,root,root) %doc module/idoutils/db/queries UPGRADING module/idoutils/db/README module/idoutils/config README.SUSE.idoutils %{_mandir}/man8/ido2db.8* %{_initrddir}/ido2db %config(noreplace) %{icinga_sysconfdir}/ido2db.cfg %config(noreplace) %{icinga_sysconfdir}/idomod.cfg %config(noreplace) %{icinga_sysconfdir}/modules/idoutils.cfg %config(noreplace) %{icinga_sysconfdir}/objects/ido2db_check_proc.cfg %{_sbindir}/rcido2db %{_sbindir}/ido2db %{_sbindir}/log2ido %{icinga_libdir}/idomod.so %files idoutils-mysql %defattr(-,root,root) %doc module/idoutils/db/mysql module/idoutils/db/examples %files idoutils-oracle %defattr(-,root,root) %doc module/idoutils/db/oracle %files idoutils-pgsql %defattr(-,root,root) %doc module/idoutils/db/pgsql %files devel %defattr(-,root,root) %{_includedir}/%{name}/ %files doc %defattr(-,root,root) %doc %{icinga_datadir}/docs %files plugins-eventhandlers %defattr(0755,root,root) %{icinga_eventhandlerdir} %files plugins-downtimes %defattr(0755,root,root) %{icinga_libdir}/downtimes %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor