2 # - initscript for zabbix-agent-standalone and zabbix-server
5 %bcond_with pgsql # enable PostgreSQL support (by default use mysql)
6 %bcond_with oracle # enable Oracle support (by default use mysql)
8 Summary: zabbix - network monitoring software
9 Summary(pl.UTF-8): zabbix - oprogramowanie do monitorowania sieci
14 Group: Networking/Admin
15 Source0: http://dl.sourceforge.net/zabbix/%{name}-%{version}.tar.gz
16 # Source0-md5: e1e15f3ab9f2c0ec9e6fde145a5a3b6e
17 Source1: %{name}-agent.inetd
18 Source2: %{name}-apache.conf
19 URL: http://zabbix.sourceforge.net/
20 %{!?with_pgsql:BuildRequires: mysql-devel}
21 BuildRequires: net-snmp-devel
22 BuildRequires: openldap-devel >= 2.4.6
23 BuildRequires: openssl-devel >= 0.9.7d
24 %{?with_pgsql:BuildRequires: postgresql-devel}
25 BuildRequires: rpmbuild(macros) >= 1.268
26 Requires(postun): /usr/sbin/groupdel
27 Requires(postun): /usr/sbin/userdel
28 Requires(pre): /bin/id
29 Requires(pre): /usr/bin/getgid
30 Requires(pre): /usr/sbin/groupadd
31 Requires(pre): /usr/sbin/useradd
32 Provides: group(zabbix)
33 Provides: user(zabbix)
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 %define _sysconfdir /etc/%{name}
37 %define _appdir %{_datadir}/%{name}
38 %define _webapps /etc/webapps
39 %define _webapp %{name}
42 %define filterout_ld -Wl,--as-needed
45 zabbix is software that monitors numerous parameters of a network and
46 the servers on that network. It is a useful tool for monitoring
47 the health and integrity of servers. zabbix uses a flexible
48 notification mechanism that allows users to configure email based
49 alerts for virtually any event. All monitored parameters are stored in
50 a database. zabbix offers excellent reporting and data visualisation
51 features based on the stored data. zabbix supports both polling and
52 trapping. All zabbix reports and statistics, as well as configuration
53 parameters, are accessed through a web-based front end.
55 %description -l pl.UTF-8
56 zabbix to oprogramowanie do monitorowania licznych parametrów sieci i
57 serwerów sieciowych. Jest przydatny przy monitorowaniu działania
58 serwerów. Jorzysta z elastycznego mechanizmu powiadamiania, który
59 pozwala użytkownikom konfigurować powiadamianie pocztą elektroniczną
60 dla praktycznie wszelkich zdarzeń. Monitorowane parametry są
61 przechowywane w bazie danych. W oparciu o przechowywane dane zabbix
62 oferuje świetne raportowanie i funkcje wizualizacji. Wspiera zarówno
63 odpytywanie jak i pułapkowanie. Dostęp do wszystkich raportów i
64 statystyk zabbiksa jest możliwy poprzez interfejs oparty o WWW.
67 Summary: inetd agent for zabbix
68 Summary(pl.UTF-8): Wersja inetd agenta zabbiksa
69 Group: Networking/Admin
70 Requires: %{name} = %{version}-%{release}
72 Obsoletes: zabbix-agent-standalone
74 %description agent-inetd
75 This package provides inetd version of zabbix agent.
77 %description agent-inetd -l pl.UTF-8
78 Ten pakiet dostarcza agenta zabbiksa dla inetd.
80 %package agent-standalone
81 Summary: Standalone agent for zabbix
82 Summary(pl.UTF-8): Wersja wolnostojąca agenta zabbiksa
83 Group: Networking/Admin
84 Requires: %{name} = %{version}-%{release}
85 Obsoletes: zabbix-agent-inetd
87 %description agent-standalone
88 This package provides standalone (recommended) version of zabbix agent.
90 %description agent-standalone -l pl.UTF-8
91 Ten pakiet dostarcza wolnostojącej (zalecanej) wersji agenta zabbiksa.
94 Summary: PHP frontend for zabbix
95 Summary(pl.UTF-8): Interfejs PHP dla zabbiksa
96 Group: Networking/Admin
98 %{!?with_pgsql:Requires: php-mysql}
99 %{?with_pgsql:Requires: php-pgsql}
101 Requires: webserver = apache
102 Requires: webserver(php)
104 %description frontend-php
105 This package provides web based (PHP) frontend for zabbix.
107 %description frontend-php -l pl.UTF-8
108 Ten pakiet dostarcza napisany w PHP frontend dla zabbiksa.
111 Summary: Program retrieving data from zabbix agent
112 Summary(pl.UTF-8): Program odpytujÄcy agenta zabbiksa
113 Group: Networking/Admin
116 This package provides a program retrieving data from zabbix agent.
118 %description get -l pl.UTF-8
119 Ten pakiet zawiera program odpytujÄcy agenta zabbiksa.
122 Summary: Zabbix sender
123 Summary(pl.UTF-8): Program zawiadamiający zabbiksa
124 Group: Networking/Admin
127 This package provides the zabbix sender.
129 %description sender -l pl.UTF-8
130 Ten pakiet zawiera program zawiadamiający zabbiksa.
133 Summary: Zabbix server
134 Summary(pl.UTF-8): Serwer zabbiksa
135 Group: Networking/Admin
136 Requires: %{name} = %{version}-%{release}
137 Obsoletes: %{name}-suckerd
138 Obsoletes: %{name}-trapper-inetd
139 Obsoletes: %{name}-trapper-standalone
142 This package provides the zabbix server.
144 %description server -l pl.UTF-8
145 Ten pakiet zawiera serwer zabbiksa.
152 %{!?with_pgsql:--with-mysql} \
153 %{?with_pgsql:--with-pgsql} \
154 %{?with_oracle:--with-oracle} \
159 # --with-ucd-snmp=DIR \
164 rm -rf $RPM_BUILD_ROOT
165 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{sysconfig/rc-inetd,webapps/%{_webapp}},%{_appdir}}
168 DESTDIR=$RPM_BUILD_ROOT
170 install misc/conf/zabbix_{a*,s*} $RPM_BUILD_ROOT%{_sysconfdir}
171 cp -r frontends $RPM_BUILD_ROOT%{_appdir}
172 mv -f $RPM_BUILD_ROOT%{_appdir}/frontends/php/include/db.inc.php $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
173 ln -s %{_webapps}/%{_webapp}/db.inc.php $RPM_BUILD_ROOT%{_appdir}/frontends/php/include
174 install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-agent
175 install %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
176 install %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
179 rm -rf $RPM_BUILD_ROOT
181 %triggerin frontend-php -- apache1 < 1.3.37-3, apache1-base
182 %webapp_register apache %{_webapp}
184 %triggerun frontend-php -- apache1 < 1.3.37-3, apache1-base
185 %webapp_unregister apache %{_webapp}
187 %triggerin frontend-php -- apache < 2.2.0, apache-base
188 %webapp_register httpd %{_webapp}
190 %triggerun frontend-php -- apache < 2.2.0, apache-base
191 %webapp_unregister httpd %{_webapp}
194 %groupadd -g 111 zabbix
195 %useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix
198 if [ "$1" = 1 ]; then
199 %banner -e %{name} <<-EOF
200 You should create database for Zabbix.
201 Running these should be fine in most cases:
203 psql -c 'create database zabbix'
204 zcat %{_docdir}/%{name}-%{version}/create/postgresql/schema.sql.gz | psql zabbix
205 zcat %{_docdir}/%{name}-%{version}/create/data/data.sql.gz | psql zabbix
206 zcat %{_docdir}/%{name}-%{version}/create/data/images_pgsql.sql.gz | psql zabbix
208 mysqladmin create zabbix
209 zcat %{_docdir}/%{name}-%{version}/create/mysql/schema.sql.gz | mysql zabbix
210 zcat %{_docdir}/%{name}-%{version}/create/data/data.sql.gz | mysql zabbix
211 zcat %{_docdir}/%{name}-%{version}/create/data/images.sql.gz | mysql zabbix
213 %{?TODO:You also need zabbix-agent. install zabbix-agent-standalone %or zabbix-agent-inetd.}
218 if [ "$1" = "0" ]; then
224 %service -q rc-inetd reload
227 if [ "$1" = 0 ]; then
228 %service -q rc-inetd reload
232 %defattr(644,root,root,755)
233 %doc AUTHORS FAQ NEWS README ChangeLog create upgrades
234 %attr(750,root,zabbix) %dir %{_sysconfdir}
236 %dir %{_appdir}/frontends
239 %defattr(644,root,root,755)
240 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent.conf
241 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/zabbix-agent
242 %attr(755,root,root) %{_sbindir}/zabbix_agent
244 %files agent-standalone
245 %defattr(644,root,root,755)
246 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf
247 %attr(755,root,root) %{_sbindir}/zabbix_agentd
250 %defattr(644,root,root,755)
251 %attr(750,root,http) %dir %{_webapps}/%{_webapp}
252 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/*
253 %{_appdir}/frontends/php
256 %defattr(644,root,root,755)
257 %attr(755,root,root) %{_sbindir}/zabbix_get
260 %defattr(644,root,root,755)
261 %attr(755,root,root) %{_sbindir}/zabbix_sender
264 %defattr(644,root,root,755)
265 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf
266 %attr(755,root,root) %{_sbindir}/zabbix_server