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: ac24ab58ef1a985c1e2a5217386d5dba
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
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 zabbix is software that monitors numerous parameters of a network and
43 the servers on that network. It is a useful tool for monitoring
44 the health and integrity of servers. zabbix uses a flexible
45 notification mechanism that allows users to configure email based
46 alerts for virtually any event. All monitored parameters are stored in
47 a database. zabbix offers excellent reporting and data visualisation
48 features based on the stored data. zabbix supports both polling and
49 trapping. All zabbix reports and statistics, as well as configuration
50 parameters, are accessed through a web-based front end.
52 %description -l pl.UTF-8
53 zabbix to oprogramowanie do monitorowania licznych parametrów sieci i
54 serwerów sieciowych. Jest przydatny przy monitorowaniu działania
55 serwerów. Jorzysta z elastycznego mechanizmu powiadamiania, który
56 pozwala użytkownikom konfigurować powiadamianie pocztą elektroniczną
57 dla praktycznie wszelkich zdarzeń. Monitorowane parametry są
58 przechowywane w bazie danych. W oparciu o przechowywane dane zabbix
59 oferuje świetne raportowanie i funkcje wizualizacji. Wspiera zarówno
60 odpytywanie jak i pułapkowanie. Dostęp do wszystkich raportów i
61 statystyk zabbiksa jest możliwy poprzez interfejs oparty o WWW.
64 Summary: inetd agent for zabbix
65 Summary(pl.UTF-8): Wersja inetd agenta zabbiksa
66 Group: Networking/Admin
67 Requires: %{name} = %{version}-%{release}
69 Obsoletes: zabbix-agent-standalone
71 %description agent-inetd
72 This package provides inetd version of zabbix agent.
74 %description agent-inetd -l pl.UTF-8
75 Ten pakiet dostarcza agenta zabbiksa dla inetd.
77 %package agent-standalone
78 Summary: Standalone agent for zabbix
79 Summary(pl.UTF-8): Wersja wolnostojąca agenta zabbiksa
80 Group: Networking/Admin
81 Requires: %{name} = %{version}-%{release}
82 Obsoletes: zabbix-agent-inetd
84 %description agent-standalone
85 This package provides standalone (recommended) version of zabbix agent.
87 %description agent-standalone -l pl.UTF-8
88 Ten pakiet dostarcza wolnostojącej (zalecanej) wersji agenta zabbiksa.
91 Summary: PHP frontend for zabbix
92 Summary(pl.UTF-8): Interfejs PHP dla zabbiksa
93 Group: Networking/Admin
95 %{!?with_pgsql:Requires: php-mysql}
96 %{?with_pgsql:Requires: php-pgsql}
98 Requires: webserver = apache
99 Requires: webserver(php)
101 %description frontend-php
102 This package provides web based (PHP) frontend for zabbix.
104 %description frontend-php -l pl.UTF-8
105 Ten pakiet dostarcza napisany w PHP frontend dla zabbiksa.
108 Summary: Program retrieving data from zabbix agent
109 Summary(pl.UTF-8): Program odpytujÄcy agenta zabbiksa
110 Group: Networking/Admin
113 This package provides a program retrieving data from zabbix agent.
115 %description get -l pl.UTF-8
116 Ten pakiet zawiera program odpytujÄcy agenta zabbiksa.
119 Summary: Zabbix sender
120 Summary(pl.UTF-8): Program zawiadamiający zabbiksa
121 Group: Networking/Admin
124 This package provides the zabbix sender.
126 %description sender -l pl.UTF-8
127 Ten pakiet zawiera program zawiadamiający zabbiksa.
130 Summary: Zabbix server
131 Summary(pl.UTF-8): Serwer zabbiksa
132 Group: Networking/Admin
133 Requires: %{name} = %{version}-%{release}
134 Obsoletes: %{name}-suckerd
135 Obsoletes: %{name}-trapper-inetd
136 Obsoletes: %{name}-trapper-standalone
139 This package provides the zabbix server.
141 %description server -l pl.UTF-8
142 Ten pakiet zawiera serwer zabbiksa.
149 %{!?with_pgsql:--with-mysql} \
150 %{?with_pgsql:--with-pgsql} \
151 %{?with_oracle:--with-oracle} \
156 # --with-ucd-snmp=DIR \
161 rm -rf $RPM_BUILD_ROOT
162 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{sysconfig/rc-inetd,webapps/%{_webapp}},%{_appdir}}
165 DESTDIR=$RPM_BUILD_ROOT
167 install misc/conf/zabbix_{a*,s*} $RPM_BUILD_ROOT%{_sysconfdir}
168 cp -r frontends $RPM_BUILD_ROOT%{_appdir}
169 mv -f $RPM_BUILD_ROOT%{_appdir}/frontends/php/include/db.inc.php $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
170 ln -s %{_webapps}/%{_webapp}/db.inc.php $RPM_BUILD_ROOT%{_appdir}/frontends/php/include
171 install %{SOURCE1} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-agent
172 install %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
173 install %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
176 rm -rf $RPM_BUILD_ROOT
178 %triggerin frontend-php -- apache1 < 1.3.37-3, apache1-base
179 %webapp_register apache %{_webapp}
181 %triggerun frontend-php -- apache1 < 1.3.37-3, apache1-base
182 %webapp_unregister apache %{_webapp}
184 %triggerin frontend-php -- apache < 2.2.0, apache-base
185 %webapp_register httpd %{_webapp}
187 %triggerun frontend-php -- apache < 2.2.0, apache-base
188 %webapp_unregister httpd %{_webapp}
191 %groupadd -g 111 zabbix
192 %useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix
195 if [ "$1" = 1 ]; then
196 %banner -e %{name} <<-EOF
197 You should create database for Zabbix.
198 Running these should be fine in most cases:
200 psql -c 'create database zabbix'
201 zcat %{_docdir}/%{name}-%{version}/create/postgresql/schema.sql.gz | psql zabbix
202 zcat %{_docdir}/%{name}-%{version}/create/data/data.sql.gz | psql zabbix
203 zcat %{_docdir}/%{name}-%{version}/create/data/images_pgsql.sql.gz | psql zabbix
205 mysqladmin create zabbix
206 zcat %{_docdir}/%{name}-%{version}/create/mysql/schema.sql.gz | mysql zabbix
207 zcat %{_docdir}/%{name}-%{version}/create/data/data.sql.gz | mysql zabbix
208 zcat %{_docdir}/%{name}-%{version}/create/data/images.sql.gz | mysql zabbix
210 %{?TODO:You also need zabbix-agent. install zabbix-agent-standalone %or zabbix-agent-inetd.}
215 if [ "$1" = "0" ]; then
221 %service -q rc-inetd reload
224 if [ "$1" = 0 ]; then
225 %service -q rc-inetd reload
229 %defattr(644,root,root,755)
230 %doc AUTHORS FAQ NEWS README ChangeLog create upgrades bin/ZabbixW{32,64}.exe
231 %attr(750,root,zabbix) %dir %{_sysconfdir}
232 %dir %{_appdir}/frontends
235 %defattr(644,root,root,755)
236 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent.conf
237 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/zabbix-agent
238 %attr(755,root,root) %{_bindir}/zabbix_agent
240 %files agent-standalone
241 %defattr(644,root,root,755)
242 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf
243 %attr(755,root,root) %{_bindir}/zabbix_agentd
246 %defattr(644,root,root,755)
247 %attr(750,root,http) %dir %{_webapps}/%{_webapp}
248 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/*
249 %{_appdir}/frontends/php
252 %defattr(644,root,root,755)
253 %attr(755,root,root) %{_bindir}/zabbix_get
256 %defattr(644,root,root,755)
257 %attr(755,root,root) %{_bindir}/zabbix_sender
260 %defattr(644,root,root,755)
261 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf
262 %attr(755,root,root) %{_bindir}/zabbix_server