2 # - systemd units for zabbix-agentd, zabbix-server and zabbix-java
3 # - initscript for zabbix-agentd, zabbix-server and zabbix-java
6 %bcond_with pgsql # enable PostgreSQL support
7 %bcond_with oracle # enable Oracle support
8 %bcond_with sqlite3 # enable sqlite3 support
9 %bcond_without mysql # enable MySQL support
11 %bcond_without java # disable java support
13 %if %{with pgsql} || %{with oracle} || %{with sqlite3}
17 %if %{?with_pgsql:1}%{?with_oracle:1}%{?with_sqlite3:1}%{?with_mysql:1} != 1
18 ERROR: exactly one database must be selected
21 Summary: zabbix - network monitoring software
22 Summary(pl.UTF-8): zabbix - oprogramowanie do monitorowania sieci
27 Group: Networking/Utilities
28 Source0: http://dl.sourceforge.net/zabbix/%{name}-%{version}.tar.gz
29 # Source0-md5: e2491b482868059f251902d5f636eacb
30 Source1: %{name}-apache.conf
31 URL: http://zabbix.sourceforge.net/
32 BuildRequires: OpenIPMI-devel
33 BuildRequires: curl-devel
34 BuildRequires: iksemel-devel
35 %{?with_java:BuildRequires: jdk}
36 BuildRequires: libxml2-devel
37 BuildRequires: libssh2-devel
38 %{?with_mysql:BuildRequires: mysql-devel}
39 BuildRequires: net-snmp-devel
40 BuildRequires: openldap-devel >= 2.4.6
41 BuildRequires: openssl-devel >= 0.9.7d
42 %{?with_pgsql:BuildRequires: postgresql-devel}
43 %{?with_sqlite3:BuildRequires: sqlite3-devel}
44 BuildRequires: unixODBC-devel
45 BuildRequires: rpmbuild(macros) >= 1.268
46 Requires(postun): /usr/sbin/groupdel
47 Requires(postun): /usr/sbin/userdel
48 Requires(pre): /bin/id
49 Requires(pre): /usr/bin/getgid
50 Requires(pre): /usr/sbin/groupadd
51 Requires(pre): /usr/sbin/useradd
52 Provides: group(zabbix)
53 Provides: user(zabbix)
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
64 the health and integrity of servers. zabbix uses a flexible
65 notification mechanism that allows users to configure email based
66 alerts for virtually any event. All monitored parameters are stored in
67 a 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: Standalone agent for zabbix
85 Summary(pl.UTF-8): Wersja wolnostojąca agenta zabbiksa
86 Group: Networking/Utilities
87 Requires: %{name} = %{version}-%{release}
88 Obsoletes: zabbix-agent-inetd
89 Obsoletes: zabbix-agent-standalone
92 This package provides the zabbix agent.
94 %description agentd -l pl.UTF-8
95 Ten pakiet dostarcza agenta zabbiksa.
98 Summary: PHP frontend for zabbix
99 Summary(pl.UTF-8): Interfejs PHP dla zabbiksa
100 Group: Applications/WWW
102 Requires: php(bcmath)
104 Requires: php(mbstring)
106 Requires: php(sockets)
107 Requires: php(session)
108 %{?with_mysql:Requires: php(mysql)}
109 %{?with_pgsql:Requires: php(pgsql)}
111 Requires: webserver(php)
113 %description frontend-php
114 This package provides web based (PHP) frontend for zabbix.
116 %description frontend-php -l pl.UTF-8
117 Ten pakiet dostarcza napisany w PHP frontend dla zabbiksa.
120 Summary: Program retrieving data from zabbix agent
121 Summary(pl.UTF-8): Program odpytujÄcy agenta zabbiksa
122 Group: Networking/Utilities
125 This package provides a program retrieving data from zabbix agent.
127 %description get -l pl.UTF-8
128 Ten pakiet zawiera program odpytujÄcy agenta zabbiksa.
131 Summary: Zabbix proxy
132 Summary(pl.UTF-8): Proxy do zabbiksa
133 Group: Networking/Utilities
136 This package provides the zabbix proxy.
138 %description proxy -l pl.UTF-8
139 Ten pakiet zawiera proxy zabbix.
142 Summary: Zabbix sender
143 Summary(pl.UTF-8): Program zawiadamiający zabbiksa
144 Group: Networking/Utilities
147 This package provides the zabbix sender.
149 %description sender -l pl.UTF-8
150 Ten pakiet zawiera program zawiadamiający zabbiksa.
153 Summary: Zabbix server
154 Summary(pl.UTF-8): Serwer zabbiksa
155 Group: Networking/Utilities
156 Requires: %{name} = %{version}-%{release}
157 Obsoletes: %{name}-suckerd
158 Obsoletes: %{name}-trapper-inetd
159 Obsoletes: %{name}-trapper-standalone
162 This package provides the zabbix server.
164 %description server -l pl.UTF-8
165 Ten pakiet zawiera serwer zabbiksa.
168 Summary: Zabbix Java Gateway
169 Group: Networking/Utilities
170 Requires: %{name} = %{version}-%{release}
173 This package provides the Zabbix Java Gateway.
180 %{?with_mysql:--with-mysql} \
181 %{?with_pgsql:--with-pgsql} \
182 %{?with_oracle:--with-oracle} \
183 %{?with_sqlite3:--with-sqlite3} \
188 %{__enable_disable java} \
202 rm -rf $RPM_BUILD_ROOT
203 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/webapps/%{_webapp},%{_appdir}}
206 DESTDIR=$RPM_BUILD_ROOT \
207 ZJG_DEST=$RPM_BUILD_ROOT%{_datadir}/zabbix_java
209 cp -r frontends $RPM_BUILD_ROOT%{_appdir}
210 #mv -f $RPM_BUILD_ROOT%{_appdir}/frontends/php/include/db.inc.php $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
211 #ln -s %{_webapps}/%{_webapp}/db.inc.php $RPM_BUILD_ROOT%{_appdir}/frontends/php/include
212 install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
213 install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
216 mv $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh $RPM_BUILD_ROOT%{_sysconfdir}/zabbix_java.conf
217 ln -s %{_sysconfdir}/zabbix_java.conf $RPM_BUILD_ROOT%{_datadir}/zabbix_java/settings.sh
219 cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-start <<'EOF'
222 exec %{_datadir}/zabbix_java/startup.sh "$@"
225 cat >$RPM_BUILD_ROOT%{_sbindir}/zabbix_java-stop <<'EOF'
228 exec %{_datadir}/zabbix_java/shutdown.sh "$@"
233 rm -rf $RPM_BUILD_ROOT
235 %triggerin frontend-php -- apache1 < 1.3.37-3, apache1-base
236 %webapp_register apache %{_webapp}
238 %triggerun frontend-php -- apache1 < 1.3.37-3, apache1-base
239 %webapp_unregister apache %{_webapp}
241 %triggerin frontend-php -- apache < 2.2.0, apache-base
242 %webapp_register httpd %{_webapp}
244 %triggerun frontend-php -- apache < 2.2.0, apache-base
245 %webapp_unregister httpd %{_webapp}
248 %groupadd -g 111 zabbix
249 %useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix
252 if [ "$1" = 1 ]; then
253 %banner -e %{name}-server <<-EOF
254 You should create database for Zabbix.
256 Running these should be fine in most cases:
257 psql -c 'create database zabbix'
258 zcat %{_docdir}/%{name}-server-%{version}/postgresql/schema.sql.gz | psql zabbix
259 zcat %{_docdir}/%{name}-server-%{version}/postgresql/data.sql.gz | psql zabbix
260 zcat %{_docdir}/%{name}-server-%{version}/postgresql/images.sql.gz | psql zabbix
263 Running these should be fine in most cases:
264 mysqladmin create zabbix
265 zcat %{_docdir}/%{name}-server-%{version}/mysql/schema.sql.gz | mysql zabbix
266 zcat %{_docdir}/%{name}-server-%{version}/mysql/images.sql.gz | mysql zabbix
267 zcat %{_docdir}/%{name}-server-%{version}/mysql/data.sql.gz | mysql zabbix
269 Database template is available in %{_docdir}/%{name}-%{version}
272 %{?TODO:You also need zabbix-agent. install zabbix-agentd.}
277 if [ "$1" = "0" ]; then
283 %defattr(644,root,root,755)
284 %doc AUTHORS ChangeLog README
285 %attr(750,root,zabbix) %dir %{_sysconfdir}
287 %dir %{_appdir}/frontends
290 %defattr(644,root,root,755)
291 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf
292 %attr(755,root,root) %{_sbindir}/zabbix_agentd
293 %{_mandir}/man8/zabbix_agentd*
296 %defattr(644,root,root,755)
297 %attr(750,root,http) %dir %{_webapps}/%{_webapp}
298 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/*
299 %{_appdir}/frontends/php
302 %defattr(644,root,root,755)
303 %attr(755,root,root) %{_bindir}/zabbix_get
304 %{_mandir}/man1/zabbix_get*
307 %defattr(644,root,root,755)
308 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_proxy.conf
309 %attr(755,root,root) %{_sbindir}/zabbix_proxy
310 %{_mandir}/man8/zabbix_proxy*
313 %defattr(644,root,root,755)
314 %attr(755,root,root) %{_bindir}/zabbix_sender
315 %{_mandir}/man1/zabbix_sender*
318 %defattr(644,root,root,755)
319 %doc upgrades/dbpatches
323 %if %{with postgresql}
324 %doc database/postgresql
330 %doc database/sqlite3
332 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf
333 %attr(755,root,root) %{_sbindir}/zabbix_server
334 %{_mandir}/man8/zabbix_server*
338 %defattr(644,root,root,755)
339 %attr(755,root,root) %{_sbindir}/zabbix_java-start
340 %attr(755,root,root) %{_sbindir}/zabbix_java-stop
341 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_java.conf
342 %dir %{_datadir}/zabbix_java
343 %{_datadir}/zabbix_java/bin
344 %{_datadir}/zabbix_java/lib
345 %{_datadir}/zabbix_java/settings.sh
346 %attr(755,root,root) %{_datadir}/zabbix_java/shutdown.sh
347 %attr(755,root,root) %{_datadir}/zabbix_java/startup.sh