2 # - initscript for zabbix-agentd, zabbix-server, zabbix-proxy and zabbix-java
5 %bcond_with pgsql # enable PostgreSQL support
6 %bcond_with oracle # enable Oracle support
7 %bcond_with sqlite3 # enable sqlite3 support
8 %bcond_without mysql # enable MySQL support
9 %bcond_without java # disable java support
11 %if %{with pgsql} || %{with oracle} || %{with sqlite3}
15 %if %{?with_pgsql:1}%{?with_oracle:1}%{?with_sqlite3:1}%{?with_mysql:1} != 1
16 ERROR: exactly one database must be selected
19 %define php_min_version 5.4.0
20 Summary: Zabbix - network monitoring software
21 Summary(pl.UTF-8): Zabbix - oprogramowanie do monitorowania sieci
26 Group: Networking/Utilities
27 Source0: http://downloads.sourceforge.net/zabbix/%{name}-%{version}.tar.gz
28 # Source0-md5: e2491b482868059f251902d5f636eacb
29 Source1: %{name}-apache.conf
30 Source2: %{name}_server.service
31 Source3: %{name}_agentd.service
32 Source4: %{name}_proxy.service
33 Source5: %{name}_java.service
34 Source6: %{name}.tmpfiles
36 URL: http://zabbix.sourceforge.net/
37 BuildRequires: OpenIPMI-devel
38 BuildRequires: curl-devel
39 BuildRequires: iksemel-devel
40 %{?with_java:BuildRequires: jdk}
41 BuildRequires: libssh2-devel
42 BuildRequires: libxml2-devel
43 %{?with_mysql:BuildRequires: mysql-devel}
44 BuildRequires: net-snmp-devel
45 BuildRequires: openldap-devel >= 2.4.6
46 BuildRequires: openssl-devel >= 0.9.7d
47 %{?with_pgsql:BuildRequires: postgresql-devel}
48 BuildRequires: rpmbuild(macros) >= 1.671
49 %{?with_sqlite3:BuildRequires: sqlite3-devel}
50 BuildRequires: unixODBC-devel
51 Requires: %{name}-agentd = %{version}-%{release}
52 Requires: %{name}-frontend-php = %{version}-%{release}
53 Requires: %{name}-server = %{version}-%{release}
54 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 %define _sysconfdir /etc/%{name}
57 %define _appdir %{_datadir}/%{name}
58 %define _webapps /etc/webapps
59 %define _webapp %{name}
62 Zabbix is software that monitors numerous parameters of a network and
63 the servers on that network. It is a useful tool for monitoring the
64 health and integrity of servers. Zabbix uses a flexible notification
65 mechanism that allows users to configure email based alerts for
66 virtually any event. All monitored parameters are stored in a
67 database. Zabbix offers excellent reporting and data visualisation
68 features based on the stored data. Zabbix supports both polling and
69 trapping. All Zabbix reports and statistics, as well as configuration
70 parameters, are accessed through a web-based front end.
72 %description -l pl.UTF-8
73 Zabbix to oprogramowanie do monitorowania licznych parametrów sieci i
74 serwerów sieciowych. Jest przydatny przy monitorowaniu działania
75 serwerów. Jorzysta z elastycznego mechanizmu powiadamiania, który
76 pozwala użytkownikom konfigurować powiadamianie pocztą elektroniczną
77 dla praktycznie wszelkich zdarzeń. Monitorowane parametry są
78 przechowywane w bazie danych. W oparciu o przechowywane dane Zabbix
79 oferuje świetne raportowanie i funkcje wizualizacji. Wspiera zarówno
80 odpytywanie jak i pułapkowanie. Dostęp do wszystkich raportów i
81 statystyk Zabbiksa jest możliwy poprzez interfejs oparty o WWW.
84 Summary: Common files for Zabbix monitoring software
85 Summary(pl.UTF-8): Wspólne pliki dla oprogramowania monitorującego Zabbix
86 Group: Networking/Utilities
87 Requires(postun): /usr/sbin/groupdel
88 Requires(postun): /usr/sbin/userdel
89 Requires(pre): /bin/id
90 Requires(pre): /usr/bin/getgid
91 Requires(pre): /usr/sbin/groupadd
92 Requires(pre): /usr/sbin/useradd
93 Provides: group(zabbix)
94 Provides: user(zabbix)
97 Common files for Zabbix monitoring software.
99 %description common -l pl.UTF-8
100 Wspólne pliki dla oprogramowania monitorującego Zabbix.
103 Summary: Zabbix Agent
104 Summary(pl.UTF-8): Agenta Zabbiksa
105 Group: Networking/Utilities
106 Requires: %{name}-common = %{version}-%{release}
107 Requires: systemd-units >= 38
108 Obsoletes: zabbix-agent-inetd
109 Obsoletes: zabbix-agent-standalone
112 Zabbix agent collects data from the local system for a Zabbix server.
114 %description agentd -l pl.UTF-8
115 Agent zbiera dane z lokalnej maszyny dla serwera Zabbix.
117 %package frontend-php
118 Summary: PHP frontend for Zabbix
119 Summary(pl.UTF-8): Interfejs PHP dla Zabbiksa
120 Group: Applications/WWW
121 Requires: php(bcmath)
122 Requires: php(core) >= %{php_min_version}
125 Requires: php(gettext)
127 Requires: php(mbstring)
128 %{?with_mysql:Requires: php(mysql)}
130 %{?with_pgsql:Requires: php(pgsql)}
131 Requires: php(session)
132 Requires: php(sockets)
134 Requires: php(xmlreader)
135 Requires: php(xmlwriter)
137 Requires: webserver(php)
139 %description frontend-php
140 This package provides web based (PHP) frontend for Zabbix.
142 %description frontend-php -l pl.UTF-8
143 Ten pakiet dostarcza napisany w PHP frontend dla Zabbiksa.
146 Summary: Program retrieving data from Zabbix agent
147 Summary(pl.UTF-8): Program odpytujÄcy agenta Zabbiksa
148 Group: Networking/Utilities
151 This package provides a program retrieving data from Zabbix agent.
153 %description get -l pl.UTF-8
154 Ten pakiet zawiera program odpytujÄcy agenta Zabbiksa.
157 Summary: Zabbix proxy
158 Summary(pl.UTF-8): Proxy do Zabbiksa
159 Group: Networking/Utilities
160 Requires: %{name}-common = %{version}-%{release}
161 Requires: systemd-units >= 38
164 This package provides the Zabbix proxy.
166 %description proxy -l pl.UTF-8
167 Ten pakiet zawiera proxy Zabbix.
170 Summary: Zabbix sender
171 Summary(pl.UTF-8): Program zawiadamiający Zabbiksa
172 Group: Networking/Utilities
175 This package provides the Zabbix sender.
177 %description sender -l pl.UTF-8
178 Ten pakiet zawiera program zawiadamiający Zabbiksa.
181 Summary: Zabbix server
182 Summary(pl.UTF-8): Serwer Zabbiksa
183 Group: Networking/Utilities
184 Requires: %{name}-common = %{version}-%{release}
185 Requires: systemd-units >= 38
186 Obsoletes: zabbix-suckerd
187 Obsoletes: zabbix-trapper-inetd
188 Obsoletes: zabbix-trapper-standalone
191 This package provides the Zabbix server.
193 %description server -l pl.UTF-8
194 Ten pakiet zawiera serwer Zabbiksa.
197 Summary: Zabbix Java Gateway
198 Group: Networking/Utilities
199 Requires: %{name}-common = %{version}-%{release}
200 Requires: systemd-units >= 38
203 This package provides the Zabbix Java Gateway.
212 %{?with_mysql:--with-mysql} \
213 %{?with_pgsql:--with-postgresql} \
214 %{?with_oracle:--with-oracle} \
215 %{?with_sqlite3:--with-sqlite3} \
220 %{__enable_disable java} \
234 rm -rf $RPM_BUILD_ROOT
235 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/webapps/%{_webapp},%{_appdir}} \
236 $RPM_BUILD_ROOT{/run/zabbix,/var/log/zabbix,%{systemdunitdir},%{systemdtmpfilesdir}}
239 DESTDIR=$RPM_BUILD_ROOT \
240 ZJG_DEST=$RPM_BUILD_ROOT%{_datadir}/zabbix_java
242 cp -r frontends $RPM_BUILD_ROOT%{_appdir}
244 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
245 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
247 install %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_server.service
248 install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_agentd.service
249 install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_proxy.service
250 install %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/zabbix_java.service
252 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/zabbix.conf
254 mv $RPM_BUILD_ROOT%{_appdir}/frontends/php/conf $RPM_BUILD_ROOT%{_sysconfdir}/frontend
255 ln -s %{_sysconfdir}/frontend $RPM_BUILD_ROOT%{_appdir}/frontends/php/conf
256 touch $RPM_BUILD_ROOT%{_sysconfdir}/frontend/zabbix.conf.php
259 mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh $RPM_BUILD_ROOT%{_sysconfdir}/zabbix_java.conf
260 ln -s %{_sysconfdir}/zabbix_java.conf $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh
261 mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback.xml $RPM_BUILD_ROOT%{_sysconfdir}/java-logback.xml
262 ln -s %{_sysconfdir}/java-logback.xml $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback.xml
263 mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback-console.xml $RPM_BUILD_ROOT%{_sysconfdir}/java-logback-console.xml
264 ln -s %{_sysconfdir}/java-logback-console.xml $RPM_BUILD_ROOT%{_datadir}/zabbix_java/lib/logback-console.xml
266 cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-start <<'EOF'
269 exec %{_datadir}/zabbix_java/startup.sh "$@"
272 cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-stop <<'EOF'
275 exec %{_datadir}/zabbix_java/shutdown.sh "$@"
280 rm -rf $RPM_BUILD_ROOT
282 %triggerin frontend-php -- apache1 < 1.3.37-3, apache1-base
283 %webapp_register apache %{_webapp}
285 %triggerun frontend-php -- apache1 < 1.3.37-3, apache1-base
286 %webapp_unregister apache %{_webapp}
288 %triggerin frontend-php -- apache < 2.2.0, apache-base
289 %webapp_register httpd %{_webapp}
291 %triggerun frontend-php -- apache < 2.2.0, apache-base
292 %webapp_unregister httpd %{_webapp}
295 %groupadd -g 111 zabbix
296 %useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix
299 if [ "$1" = "0" ]; then
305 if [ "$1" = 1 ]; then
306 %banner -e %{name}-server <<-EOF
307 You should create database for Zabbix.
309 Running these should be fine in most cases:
310 psql -c 'create database zabbix'
311 zcat %{_docdir}/%{name}-server-%{version}/postgresql/schema.sql.gz | psql zabbix
312 zcat %{_docdir}/%{name}-server-%{version}/postgresql/images.sql.gz | psql zabbix
313 zcat %{_docdir}/%{name}-server-%{version}/postgresql/data.sql.gz | psql zabbix
316 Running these should be fine in most cases:
317 mysqladmin create zabbix
318 zcat %{_docdir}/%{name}-server-%{version}/mysql/schema.sql.gz | mysql zabbix
319 zcat %{_docdir}/%{name}-server-%{version}/mysql/images.sql.gz | mysql zabbix
320 zcat %{_docdir}/%{name}-server-%{version}/mysql/data.sql.gz | mysql zabbix
322 Database template is available in %{_docdir}/%{name}-%{version}
325 %{?TODO:You also need zabbix-agent. install zabbix-agentd.}
328 %systemd_post zabbix_server.service
331 %systemd_preun zabbix_server.service
337 %systemd_post zabbix_agentd.service
340 %systemd_preun zabbix_agentd.service
346 %systemd_post zabbix_proxy.service
349 %systemd_preun zabbix_proxy.service
355 %systemd_post zabbix_java.service
358 %systemd_preun zabbix_java.service
364 %defattr(644,root,root,755)
365 %doc AUTHORS ChangeLog README
368 %defattr(644,root,root,755)
369 %doc AUTHORS ChangeLog README
370 %attr(751,root,zabbix) %dir %{_sysconfdir}
371 %attr(751,root,http) %dir %{_sysconfdir}/frontend
373 %dir %{_appdir}/frontends
374 %dir %attr(770,root,zabbix) /run/zabbix
375 %dir %attr(775,root,zabbix) /var/log/zabbix
376 %{systemdtmpfilesdir}/zabbix.conf
379 %defattr(644,root,root,755)
380 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf
381 %attr(755,root,root) %{_sbindir}/zabbix_agentd
382 %{_mandir}/man8/zabbix_agentd*
383 %{systemdunitdir}/zabbix_agentd.service
386 %defattr(644,root,root,755)
387 %attr(750,root,http) %dir %{_webapps}/%{_webapp}
388 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/*
389 %{_appdir}/frontends/php
390 %ghost %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/zabbix.conf.php
391 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/.htaccess
392 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/maintenance.inc.php
393 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/frontend/zabbix.conf.php.example
396 %defattr(644,root,root,755)
397 %attr(755,root,root) %{_bindir}/zabbix_get
398 %{_mandir}/man1/zabbix_get*
401 %defattr(644,root,root,755)
402 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_proxy.conf
403 %attr(755,root,root) %{_sbindir}/zabbix_proxy
404 %{_mandir}/man8/zabbix_proxy*
405 %{systemdunitdir}/zabbix_proxy.service
408 %defattr(644,root,root,755)
409 %attr(755,root,root) %{_bindir}/zabbix_sender
410 %{_mandir}/man1/zabbix_sender*
413 %defattr(644,root,root,755)
414 %doc upgrades/dbpatches
419 %doc database/postgresql
425 %doc database/sqlite3
427 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf
428 %attr(755,root,root) %{_sbindir}/zabbix_server
429 %{_mandir}/man8/zabbix_server*
430 %{systemdunitdir}/zabbix_server.service
434 %defattr(644,root,root,755)
435 %attr(755,root,root) %{_sbindir}/zabbix_java-start
436 %attr(755,root,root) %{_sbindir}/zabbix_java-stop
437 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_java.conf
438 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/java-logback.xml
439 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/java-logback-console.xml
440 %dir %{_datadir}/zabbix_java
441 %{_datadir}/zabbix_java/bin
442 %{_datadir}/zabbix_java/lib
443 %{_datadir}/zabbix_java/settings.sh
444 %attr(755,root,root) %{_datadir}/zabbix_java/shutdown.sh
445 %attr(755,root,root) %{_datadir}/zabbix_java/startup.sh
446 %{systemdunitdir}/zabbix_java.service