Browse Source

icinga2 updates

Signed-off-by: monitorbuilder_pel7ppc64lebuilder0 <monitorbuilder@powerel.org>
master
monitorbuilder_pel7ppc64lebuilder0 1 year ago
parent
commit
148e5b25a5
  1. 12
      SOURCES/icinga-notifications.service
  2. 11
      SOURCES/icinga-reporting.service
  3. 7
      SOURCES/icingacli
  4. 35
      SOURCES/icingaweb2.conf
  5. 7
      SOURCES/icingaweb2.fc
  6. 45
      SOURCES/icingaweb2.if
  7. 4
      SOURCES/icingaweb2.index.php
  8. 29
      SOURCES/icingaweb2.te
  9. 63
      SPECS/icinga-notifications-web.spec
  10. 79
      SPECS/icinga-notifications.spec
  11. 2
      SPECS/icinga2.spec
  12. 4
      SPECS/icingadb-redis.spec
  13. 2
      SPECS/icingaweb2-module-cube.spec
  14. 55
      SPECS/icingaweb2-module-pdfexport.spec
  15. 84
      SPECS/icingaweb2-module-reporting.spec
  16. 2
      SPECS/icingaweb2-module-x509.spec
  17. 94
      SPECS/icingaweb2.spec

12
SOURCES/icinga-notifications.service

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
[Unit]
Description=Icinga Notifications
After=syslog.target network-online.target icinga2.service postgresql.service

[Service]
Type=notify
ExecStart=/usr/sbin/icinga-notifications-daemon --config /etc/icinga-notifications/config.yml
User=icinganotifications
Group=icinganotifications

[Install]
WantedBy=multi-user.target

11
SOURCES/icinga-reporting.service

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
[Unit]
Description=Icinga Reporting Scheduler

[Service]
Type=simple
User=apache
ExecStart=/usr/bin/icingacli reporting schedule run
Restart=on-success

[Install]
WantedBy=multi-user.target

7
SOURCES/icingacli

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
#!/usr/bin/php
<?php
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */

require_once '/usr/share/php/Icinga/Application/Cli.php';

Icinga\Application\Cli::start('/usr/share/icingaweb2')->dispatch();

35
SOURCES/icingaweb2.conf

@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
Alias /icingaweb2 "/usr/share/icingaweb2/public"

<Directory "/usr/share/icingaweb2/public">
Options SymLinksIfOwnerMatch
AllowOverride None
Require all granted

DirectoryIndex index.php

SetEnv ICINGAWEB_CONFIGDIR "/etc/icingaweb2"

EnableSendfile Off

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /icingaweb2/
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>

<IfModule !mod_rewrite.c>
DirectoryIndex error_norewrite.html
ErrorDocument 404 /icingaweb2/error_norewrite.html
</IfModule>

# Forward PHP requests to FPM
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
<FilesMatch "\.php$">
SetHandler "proxy:fcgi://127.0.0.1:9000"
ErrorDocument 503 /icingaweb2/error_unavailable.html
</FilesMatch>
</Directory>

7
SOURCES/icingaweb2.fc

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
/etc/icingaweb2(/.*)? gen_context(system_u:object_r:icingaweb2_config_t,s0)

/usr/share/icingaweb2(/.*)? gen_context(system_u:object_r:icingaweb2_content_t,s0)

/var/log/icingaweb2(/.*)? gen_context(system_u:object_r:icingaweb2_rw_content_t,s0)
/var/cache/icingaweb2(/.*)? gen_context(system_u:object_r:icingaweb2_rw_content_t,s0)
/var/lib/icingaweb2(/.*)? gen_context(system_u:object_r:icingaweb2_rw_content_t,s0)

45
SOURCES/icingaweb2.if

@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
########################################
## <summary>
## Allow the specified domain to read
## icingaweb2 configuration files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`icingaweb2_read_config',`
gen_require(`
type icingaweb2_config_t;
')

files_search_etc($1)
list_dirs_pattern($1, icingaweb2_config_t, icingaweb2_config_t)
read_files_pattern($1, icingaweb2_config_t, icingaweb2_config_t)
read_lnk_files_pattern($1, icingaweb2_config_t, icingaweb2_config_t)
')

########################################
## <summary>
## Allow the specified domain to read
## and write icingaweb2 configuration files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`icingaweb2_manage_config',`
gen_require(`
type icingaweb2_config_t;
')

files_search_etc($1)
manage_dirs_pattern($1, icingaweb2_config_t, icingaweb2_config_t)
manage_files_pattern($1, icingaweb2_config_t, icingaweb2_config_t)
manage_lnk_files_pattern($1, icingaweb2_config_t, icingaweb2_config_t)
')

4
SOURCES/icingaweb2.index.php

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
<?php
/*! Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */

require_once '/usr/share/php/Icinga/Application/webrouter.php';

29
SOURCES/icingaweb2.te

@ -0,0 +1,29 @@ @@ -0,0 +1,29 @@
policy_module(icingaweb2, 0.0.1)

########################################
#
# Declarations
#

require {
type httpd_t;
}

## <desc>
## <p>
## Allow Apache to manage icingaweb2 configuration
## </p>
## </desc>
gen_tunable(httpd_can_manage_icingaweb2_config, true)

type icingaweb2_config_t;
files_config_file(icingaweb2_config_t)

optional_policy(`
apache_content_template(icingaweb2)
icingaweb2_read_config(httpd_t)
tunable_policy(`httpd_can_manage_icingaweb2_config',`
icingaweb2_manage_config(httpd_t)
')
')

63
SPECS/icinga-notifications-web.spec

@ -0,0 +1,63 @@ @@ -0,0 +1,63 @@
%global module_name notifications
%global basedir %{_datadir}/icingaweb2/modules/notifications
%global docdir %{_datadir}/doc/icinganotifications

Name: icinga-notifications-web
Version: 0.0.1
Release: 1%{?dist}
Summary: Icinga Notifications Web — Manage incidents and who gets notified about them how and when
Group: Applications/System
License: GPLv2+
URL: https://icinga.com
#Source0: https://github.com/Icinga/icinga-notifications-web/archive/v%{version}.tar.gz
BuildArch: noarch
Requires: icingaweb2 >= 2.9
Requires: icinga-notifications
Requires: icinga-php-library
Requires: icinga-php-thirdparty


%description
Icinga DB Web offers a modern and streamlined design to provide a clear
and concise overview of your monitoring environment.


%prep
%setup -q -T -c %{name}-%{version}
git clone https://github.com/Icinga/icinga-notifications-web .



%install
mkdir -vp %{buildroot}%{basedir}
mkdir -vp %{buildroot}%{docdir}
cp -vr application %{buildroot}%{basedir}
cp -vr library %{buildroot}%{basedir}
cp -vr public %{buildroot}%{basedir}
cp -vr configuration.php %{buildroot}%{basedir}
cp -vr module.info %{buildroot}%{basedir}


%clean
rm -rf %{buildroot}


%preun
set -e
# Only for removal
if [ $1 == 0 ]; then
echo "Disabling icingaweb2 module '%{module_name}'"
rm -f /etc/icingaweb2/enabledModules/%{module_name}
fi
exit 0


%files
%doc README.md
%license LICENSE
%defattr(-,root,root)
%{basedir}
%{docdir}


%changelog

79
SPECS/icinga-notifications.spec

@ -0,0 +1,79 @@ @@ -0,0 +1,79 @@
%global provider github
%global provider_tld com
%global project Icinga
%global repo icinga-notifications
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path %{provider_prefix}
%define debug_package %nil
%define configdir %{_sysconfdir}/%{name}
%define service %{name}.service

Name: icinga-notifications
Version: 0.0.1
Release: 1%{?dist}
Summary: Icinga Notifications
Group: System Environment/Daemons
License: GPLv2+
URL: https://%{provider_prefix}
#Source0: https://%{import_path}/archive/v%{version}.tar.gz
Source1: icinga-notifications.service
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
BuildRequires: gcc
BuildRequires: git
BuildRequires: systemd
Requires(pre): shadow-utils


%description
Icinga Notifications


%prep
%setup -q -T -c %{name}-%{version}
git clone https://%{provider_prefix} .

%build
go build -v -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid "%{version}"" -buildvcs=false -trimpath ./cmd/icinga-notifications-daemon


%install
install -d -m 0755 %{buildroot}%{_sbindir}
install -d -m 0755 %{buildroot}%{configdir}
install -d -m 0755 %{buildroot}%{_unitdir}
install -m 0755 icinga-notifications-daemon %{buildroot}%{_sbindir}/
install -m 0644 config.example.yml %{buildroot}%{configdir}/config.yml
install -m 0644 icinga2.conf %{buildroot}%{configdir}/icinga2-notifications.conf
install -m 0644 %{S:1} %{buildroot}%{_unitdir}/
install -d -m 0755 %{buildroot}%{_datadir}/%{name}
(umask 0022 && cp -rv schema %{buildroot}%{_datadir}/%{name}/)


%pre
getent group icinganotifications >/dev/null || groupadd -r icinganotifications
getent passwd icinganotifications >/dev/null || useradd -r -g icinganotifications -d /etc/icinganotifications -s /sbin/nologin -c 'Icinga Notifications' icinganotifications
%post
%systemd_post %{service}
%preun
%systemd_preun %{service}
%postun
%systemd_postun %{service}


%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root)
%doc LICENSE README.md
%{_sbindir}/icinga-notifications-daemon
%{_unitdir}/%{service}
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/schema
%defattr(0644,icinganotifications,icinganotifications,0755)
%dir %{configdir}
%config(noreplace) %{configdir}/config.yml
%config(noreplace) %{configdir}/icinga2-notifications.conf


%changelog

2
SPECS/icinga2.spec

@ -40,7 +40,7 @@ Summary: Network monitoring application @@ -40,7 +40,7 @@ Summary: Network monitoring application
License: GPLv2+
Group: System/Monitoring
Name: icinga2
Version: 2.13.7
Version: 2.14.0
Release: %{revision}%{?dist}
Url: https://www.icinga.com/
Source: https://github.com/Icinga/%{name}/archive/v%{version}%{?src_version_suffix}.tar.gz

4
SPECS/icingadb-redis.spec

@ -238,6 +238,7 @@ if [ -f %{_sysconfdir}/%{name}-sentinel.conf -a ! -L %{_sysconfdir}/%{name}-sen @@ -238,6 +238,7 @@ if [ -f %{_sysconfdir}/%{name}-sentinel.conf -a ! -L %{_sysconfdir}/%{name}-sen
fi
mv %{_sysconfdir}/%{name}-sentinel.conf %{_sysconfdir}/%{name}/%{?pkg_prefix}sentinel.conf
fi
/usr/sbin/semanage port -a -t redis_port_t -p tcp 6380 &> /dev/null || true
%systemd_post %{name}.service
%systemd_post %{name}-sentinel.service
%preun
@ -246,6 +247,9 @@ fi @@ -246,6 +247,9 @@ fi
%postun
%systemd_postun_with_restart %{name}.service
%systemd_postun_with_restart %{name}-sentinel.service
if [ $1 -eq 0 ]; then
/usr/sbin/semanage port -d -t redis_port_t -p tcp 6380 &> /dev/null || true
fi


%files

2
SPECS/icingaweb2-module-cube.spec

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
%global icingaweb_min_version 2.6.0
%global basedir %{_datadir}/icingaweb2/modules/%{module_name}
Name: icingaweb2-module-%{module_name}
Version: 1.3.0
Version: 1.3.1
Release: 1%{?dist}
Summary: Certificate Monitoring (x509) - Icinga Web 2 module
Group: Applications/System

55
SPECS/icingaweb2-module-pdfexport.spec

@ -0,0 +1,55 @@ @@ -0,0 +1,55 @@
%global module_name pdfexport
%global icingaweb_min_version 2.6.0
%global basedir %{_datadir}/icingaweb2/modules/%{module_name}

Name: icingaweb2-module-%{module_name}
Version: 0.10.2
Release: 1%{?dist}
Summary: PDF Export - Icinga Web 2 module
Group: Applications/System
License: GPLv2+
URL: https://icinga.com
Source0: https://github.com/Icinga/icingaweb2-module-%{module_name}/archive/v%{version}.tar.gz
BuildArch: noarch
Requires: icingaweb2 >= %{icingaweb_min_version}
Requires: php-Icinga >= %{icingaweb_min_version}


%description
PDF export functionality for Icinga Web 2 using Google Chrome/Chromium for
rendering.


%prep
%setup -q


%build


%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{basedir}
cp -r * %{buildroot}%{basedir}


%clean
rm -rf %{buildroot}


%preun
set -e
if [ $1 == 0 ]; then
echo "Disabling icingaweb2 module '%{module_name}'"
rm -f /etc/icingaweb2/enabledModules/%{module_name}
fi
exit 0


%files
%doc README.md LICENSE
%defattr(-,root,root)
%{basedir}


%changelog

84
SPECS/icingaweb2-module-reporting.spec

@ -0,0 +1,84 @@ @@ -0,0 +1,84 @@
%global module_name reporting
%global icingaweb_min_version 2.6.0
%global basedir %{_datadir}/icingaweb2/modules/%{module_name}
%global service_name icinga-%{module_name}
%global service_user apache

Name: icingaweb2-module-%{module_name}
Version: 0.10.0
Release: 1%{?dist}
Summary: Reporting - Icinga Web 2 module
Group: Applications/System
License: GPLv2+
URL: https://icinga.com
Source0: https://github.com/Icinga/icingaweb2-module-%{module_name}/archive/v%{version}.tar.gz
Source1: %{service_name}.service
BuildArch: noarch
BuildRequires: systemd-devel
Requires: systemd
Requires: icingaweb2 >= %{icingaweb_min_version}
Requires: php-Icinga >= %{icingaweb_min_version}
Requires: icingaweb2-module-reactbundle >= 0.4
Requires: icingaweb2-module-ipl >= 0.2.1
Requires: icingaweb2-module-pdfexport >= 0.9


%description
Icinga Reporting is the central component for reporting related functionality
in the monitoring web frontend and framework Icinga Web 2. The engine allows
you to create reports over a specified time period for ad-hoc and scheduled
generation of reports. Other modules use the provided functionality in order
to provide concrete reports.
If you are looking for SLA reports for your hosts and services, please also
install the idoreports module.


%prep
%setup -q


%build


%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{basedir}
cp -r * %{buildroot}%{basedir}
install -d %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{service_name}.service
# Replace user in service unit
sed -i -e 's~^User=.*~User=%{service_user}~' %{buildroot}%{_unitdir}/%{service_name}.service


%clean
rm -rf %{buildroot}



%post
%systemd_post %{service_name}.service


%preun
%systemd_preun %{service_name}.service
if [ $1 == 0 ]; then
echo "Disabling icingaweb2 module '%{module_name}'"
rm -f /etc/icingaweb2/enabledModules/%{module_name}
fi
exit 0


%postun
set -e
%systemd_postun_with_restart %{service_name}.service
exit 0


%files
%doc README.md LICENSE
%defattr(-,root,root)
%{basedir}
%{_unitdir}/%{service_name}.service


%changelog

2
SPECS/icingaweb2-module-x509.spec

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
%global service_name icinga-%{module_name}
%global service_user apache
Name: icingaweb2-module-%{module_name}
Version: 1.1.2
Version: 1.2.1
Release: 1%{?dist}
Summary: Certificate Monitoring (x509) - Icinga Web 2 module
Group: Applications/System

94
SPECS/icingaweb2.spec

@ -21,6 +21,12 @@ Group: Applications/System @@ -21,6 +21,12 @@ Group: Applications/System
License: GPLv2+ and MIT and BSD
URL: https://icinga.com
Source0: https://github.com/Icinga/icingaweb2/archive/refs/tags/v%{version}.tar.gz
Source1: icingaweb2.te
Source2: icingaweb2.if
Source3: icingaweb2.fc
Source4: icingacli
Source5: icingaweb2.conf
Source6: icingaweb2.index.php
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
Requires: %{php}-mysqlnd
@ -154,7 +160,9 @@ Icinga Web 2's fork of Zend Framework 1 @@ -154,7 +160,9 @@ Icinga Web 2's fork of Zend Framework 1
%prep
%setup -q
mkdir selinux
cp -p packages/selinux/icingaweb2.{fc,if,te} selinux
cp -p %{SOURCE1} selinux
cp -p %{SOURCE2} selinux
cp -p %{SOURCE3} selinux


%build
@ -177,18 +185,14 @@ cp -prv modules/{monitoring,setup,doc,translation} %{buildroot}/%{basedir}/modul @@ -177,18 +185,14 @@ cp -prv modules/{monitoring,setup,doc,translation} %{buildroot}/%{basedir}/modul
cp -prv library/Icinga %{buildroot}/%{phpdir}
cp -prv library/vendor/{dompdf,HTMLPurifier*,JShrink,lessphp,Parsedown,Zend} %{buildroot}/%{basedir}/library/vendor
cp -prv public/{css,font,img,js,error_norewrite.html,error_unavailable.html} %{buildroot}/%{basedir}/public
%if 0%{?php_fpm:1}
cp -pv packages/files/apache/icingaweb2.fpm.conf %{buildroot}/%{wwwconfigdir}/icingaweb2.conf
%else
cp -pv packages/files/apache/icingaweb2.conf %{buildroot}/%{wwwconfigdir}/icingaweb2.conf
%endif
cp -pv packages/files/bin/icingacli %{buildroot}/%{bindir}
cp -pv %{SOURCE5} %{buildroot}/%{wwwconfigdir}/icingaweb2.conf
cp -pv %{SOURCE4} %{buildroot}/%{bindir}
%if 0%{?php_bin:1}
sed -i '1 s~#!.*~#!%{php_bin}~' %{buildroot}/%{bindir}/icingacli
%endif
cp -pv packages/files/public/index.php %{buildroot}/%{basedir}/public
cp -prv etc/schema %{buildroot}/%{docsdir}
cp -prv packages/files/config/modules/{setup,translation} %{buildroot}/%{configdir}/modules
cp -pv %{SOURCE6} %{buildroot}/%{basedir}/public
cp -prv schema %{buildroot}/%{docsdir}
#cp -prv packages/files/config/modules/{setup,translation} %{buildroot}/%{configdir}/modules
cd selinux
for selinuxvariant in %{selinux_variants}
do
@ -223,10 +227,10 @@ rm -rf %{buildroot} @@ -223,10 +227,10 @@ rm -rf %{buildroot}
%{basedir}/public
%config(noreplace) %{wwwconfigdir}/icingaweb2.conf
%attr(2775,root,%{icingawebgroup}) %dir %{logdir}
%attr(2770,root,%{icingawebgroup}) %config(noreplace) %dir %{configdir}/modules/setup
%attr(0660,root,%{icingawebgroup}) %config(noreplace) %{configdir}/modules/setup/config.ini
%attr(2770,root,%{icingawebgroup}) %config(noreplace) %dir %{configdir}/modules/translation
%attr(0660,root,%{icingawebgroup}) %config(noreplace) %{configdir}/modules/translation/config.ini
#%attr(2770,root,%{icingawebgroup}) %config(noreplace) %dir %{configdir}/modules/setup
#%attr(0660,root,%{icingawebgroup}) %config(noreplace) %{configdir}/modules/setup/config.ini
#%attr(2770,root,%{icingawebgroup}) %config(noreplace) %dir %{configdir}/modules/translation
#%attr(0660,root,%{icingawebgroup}) %config(noreplace) %{configdir}/modules/translation/config.ini
%{docsdir}
%docdir %{docsdir}

@ -319,65 +323,3 @@ fi @@ -319,65 +323,3 @@ fi


%changelog
* Tue Aug 18 2020 Johannes Meyer <johannes.meyer@icinga.com> 2.8.2-1
- Update to 2.8.2

* Mon Jun 29 2020 Johannes Meyer <johannes.meyer@icinga.com> 2.8.1-1
- Update to 2.8.1

* Mon Jun 8 2020 Johannes Meyer <johannes.meyer@icinga.com> 2.8.0-1
- Update to 2.8.0
- Add new requirement for package icinga-l10n
- [EPEL 7] We now require PHP 7.3 instead of PHP 7.1
- Please check uprading docs at /usr/share/icingaweb2/doc/80-Upgrading.md

* Fri Oct 18 2019 Johannes Meyer <johannes.meyer@icinga.com> 2.7.3-1
- Update to 2.7.3

* Wed Oct 16 2019 Johannes Meyer <johannes.meyer@icinga.com> 2.7.2-1
- Update to 2.7.2

* Wed Aug 14 2019 Johannes Meyer <johannes.meyer@icinga.com> 2.7.1-1
- Update to 2.7.1

* Tue Jul 30 2019 Johannes Meyer <johannes.meyer@icinga.com> 2.7.0-1
- Update to 2.7.0

* Wed Apr 24 2019 Johannes Meyer <johannes.meyer@icinga.com> 2.6.3-1
- Update to 2.6.3

* Wed Nov 21 2018 Eric Lippmann <eric.lippmann@icinga.com> 2.6.2-1
- Update to 2.6.2

* Thu Aug 02 2018 Eric Lippmann <eric.lippmann@icinga.com> 2.6.1-1
- Update to 2.6.1

* Thu Jul 19 2018 Blerim Sheqa <blerim.sheqa@icinga.com> 2.6.0-1
- Update to 2.6.0

* Fri Apr 27 2018 Eric Lippmann <eric.lippmann@icinga.com> 2.5.3-1
- Update to 2.5.3

* Thu Apr 26 2018 Eric Lippmann <eric.lippmann@icinga.com> 2.5.2-1
- Update to 2.5.2

* Mon Jan 22 2018 Markus Frosch <markus.frosch@icinga.com> 2.5.1-1
- Update to 2.5.1
- Remove FPM patches

* Wed Nov 29 2017 Eric Lippmann <eric.lippmann@icinga.com> 2.5.0-2
- FPM: Add patch to support both Apache >= 2.4 and Apache < 2.4

* Tue Nov 28 2017 Eric Lippmann <eric.lippmann@icinga.com> 2.5.0-1
- Install error_unavailable.html
- Add patch to fix Apache FPM config

* Mon Nov 27 2017 Markus Frosch <markus.frosch@icinga.com> 2.5.0-1
- Update to 2.5.0
- All packages now require PHP >= 5.6
- [EPEL 6 + 7] We now require PHP 7 from SCL packages, php-fpm as runtime engine
- [SUSE / openSUSE] Requirements will force the installation of php7
- Please check upgrading docs at /usr/share/icingaweb2/doc/80-Upgrading.md

* Thu Sep 28 2017 Markus Frosch <markus.frosch@icinga.com> 2.4.2-1
- Update to 2.4.2

Loading…
Cancel
Save