]>
Commit | Line | Data |
---|---|---|
c4962172 | 1 | # TODO |
7dcff817 | 2 | # - initscript for zabbix-agent-standalone and zabbix-server |
10a854a6 TO |
3 | # |
4 | # Conditional build: | |
625793cb | 5 | %bcond_with pgsql # enable PostgreSQL support (by default use mysql) |
2fe2194b MWP |
6 | %bcond_with oracle # enable Oracle support (by default use mysql) |
7 | ||
7f4b6a83 | 8 | Summary: zabbix - network monitoring software |
5750cc93 | 9 | Summary(pl.UTF-8): zabbix - oprogramowanie do monitorowania sieci |
10a854a6 | 10 | Name: zabbix |
a7e2963d | 11 | Version: 1.1.7 |
12 | Release: 1 | |
10a854a6 TO |
13 | License: GPL v2+ |
14 | Group: Networking/Admin | |
b37e41ff | 15 | Source0: http://dl.sourceforge.net/zabbix/%{name}-%{version}.tar.gz |
a7e2963d | 16 | # Source0-md5: ac24ab58ef1a985c1e2a5217386d5dba |
10a854a6 | 17 | Source1: %{name}-agent.inetd |
7dcff817 | 18 | Source2: %{name}-apache.conf |
10a854a6 | 19 | URL: http://zabbix.sourceforge.net/ |
39709426 | 20 | %{!?with_pgsql:BuildRequires: mysql-devel} |
39709426 | 21 | BuildRequires: net-snmp-devel |
246efd79 | 22 | BuildRequires: openldap-devel >= 2.4.6 |
2886d983 | 23 | BuildRequires: openssl-devel >= 0.9.7d |
9ffbc0d2 | 24 | %{?with_pgsql:BuildRequires: postgresql-devel} |
96b8972f | 25 | BuildRequires: rpmbuild(macros) >= 1.268 |
9ffbc0d2 ER |
26 | Requires(postun): /usr/sbin/groupdel |
27 | Requires(postun): /usr/sbin/userdel | |
a5bb35f6 | 28 | Requires(pre): /bin/id |
9b19117f | 29 | Requires(pre): /usr/bin/getgid |
a5bb35f6 JB |
30 | Requires(pre): /usr/sbin/groupadd |
31 | Requires(pre): /usr/sbin/useradd | |
9b19117f | 32 | Provides: group(zabbix) |
33 | Provides: user(zabbix) | |
10a854a6 TO |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
35 | ||
a5bb35f6 | 36 | %define _sysconfdir /etc/%{name} |
7dcff817 TP |
37 | %define _appdir %{_datadir}/%{name} |
38 | %define _webapps /etc/webapps | |
39 | %define _webapp %{name} | |
10a854a6 TO |
40 | |
41 | %description | |
b82afc4b | 42 | zabbix is software that monitors numerous parameters of a network and |
1266ba50 | 43 | the servers on that network. It is a useful tool for monitoring |
b82afc4b | 44 | the health and integrity of servers. zabbix uses a flexible |
7f4b6a83 | 45 | notification mechanism that allows users to configure email based |
46 | alerts for virtually any event. All monitored parameters are stored in | |
b82afc4b | 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 | |
7f4b6a83 | 50 | parameters, are accessed through a web-based front end. |
51 | ||
ff14176a JR |
52 | %description -l pl.UTF-8 |
53 | zabbix to oprogramowanie do monitorowania licznych parametrów sieci i | |
1266ba50 TP |
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. | |
10a854a6 | 62 | |
10a854a6 TO |
63 | %package agent-inetd |
64 | Summary: inetd agent for zabbix | |
5750cc93 | 65 | Summary(pl.UTF-8): Wersja inetd agenta zabbiksa |
10a854a6 | 66 | Group: Networking/Admin |
b37e41ff | 67 | Requires: %{name} = %{version}-%{release} |
10a854a6 | 68 | Requires: inetdaemon |
96b8972f | 69 | Obsoletes: zabbix-agent-standalone |
10a854a6 TO |
70 | |
71 | %description agent-inetd | |
90e6d4b1 AG |
72 | This package provides inetd version of zabbix agent. |
73 | ||
ff14176a | 74 | %description agent-inetd -l pl.UTF-8 |
90e6d4b1 | 75 | Ten pakiet dostarcza agenta zabbiksa dla inetd. |
10a854a6 TO |
76 | |
77 | %package agent-standalone | |
7f4b6a83 | 78 | Summary: Standalone agent for zabbix |
5750cc93 | 79 | Summary(pl.UTF-8): Wersja wolnostojąca agenta zabbiksa |
10a854a6 | 80 | Group: Networking/Admin |
b37e41ff | 81 | Requires: %{name} = %{version}-%{release} |
96b8972f | 82 | Obsoletes: zabbix-agent-inetd |
10a854a6 | 83 | |
80945b42 | 84 | %description agent-standalone |
7dcff817 | 85 | This package provides standalone (recommended) version of zabbix agent. |
90e6d4b1 | 86 | |
ff14176a | 87 | %description agent-standalone -l pl.UTF-8 |
7dcff817 TP |
88 | Ten pakiet dostarcza wolnostojącej (zalecanej) wersji agenta zabbiksa. |
89 | ||
90 | %package frontend-php | |
91 | Summary: PHP frontend for zabbix | |
92 | Summary(pl.UTF-8): Interfejs PHP dla zabbiksa | |
93 | Group: Networking/Admin | |
94 | Requires: php(gd) | |
95 | %{!?with_pgsql:Requires: php-mysql} | |
96 | %{?with_pgsql:Requires: php-pgsql} | |
97 | Requires: webapps | |
98 | Requires: webserver = apache | |
99 | Requires: webserver(php) | |
100 | ||
101 | %description frontend-php | |
102 | This package provides web based (PHP) frontend for zabbix. | |
103 | ||
104 | %description frontend-php -l pl.UTF-8 | |
105 | Ten pakiet dostarcza napisany w PHP frontend dla zabbiksa. | |
106 | ||
107 | %package get | |
108 | Summary: Program retrieving data from zabbix agent | |
109 | Summary(pl.UTF-8): Program odpytujÄcy agenta zabbiksa | |
110 | Group: Networking/Admin | |
111 | ||
112 | %description get | |
113 | This package provides a program retrieving data from zabbix agent. | |
114 | ||
115 | %description get -l pl.UTF-8 | |
116 | Ten pakiet zawiera program odpytujÄcy agenta zabbiksa. | |
10a854a6 | 117 | |
10a854a6 | 118 | %package sender |
7dcff817 | 119 | Summary: Zabbix sender |
5750cc93 | 120 | Summary(pl.UTF-8): Program zawiadamiający zabbiksa |
10a854a6 TO |
121 | Group: Networking/Admin |
122 | ||
123 | %description sender | |
39709426 | 124 | This package provides the zabbix sender. |
10a854a6 | 125 | |
ff14176a JR |
126 | %description sender -l pl.UTF-8 |
127 | Ten pakiet zawiera program zawiadamiający zabbiksa. | |
a5bb35f6 | 128 | |
a7e2963d | 129 | %package server |
7dcff817 TP |
130 | Summary: Zabbix server |
131 | Summary(pl.UTF-8): Serwer zabbiksa | |
132 | Group: Networking/Admin | |
133 | Requires: %{name} = %{version}-%{release} | |
1266ba50 TP |
134 | Obsoletes: %{name}-suckerd |
135 | Obsoletes: %{name}-trapper-inetd | |
136 | Obsoletes: %{name}-trapper-standalone | |
a7e2963d | 137 | |
138 | %description server | |
139 | This package provides the zabbix server. | |
140 | ||
141 | %description server -l pl.UTF-8 | |
142 | Ten pakiet zawiera serwer zabbiksa. | |
143 | ||
10a854a6 | 144 | %prep |
5d18cc59 | 145 | %setup -q |
10a854a6 TO |
146 | |
147 | %build | |
10a854a6 | 148 | %configure \ |
39709426 | 149 | %{!?with_pgsql:--with-mysql} \ |
150 | %{?with_pgsql:--with-pgsql} \ | |
2fe2194b MWP |
151 | %{?with_oracle:--with-oracle} \ |
152 | --enable-server \ | |
153 | --enable-agent \ | |
154 | --with-net-snmp \ | |
7dcff817 | 155 | --with-ldap \ |
2fe2194b | 156 | # --with-ucd-snmp=DIR \ |
10a854a6 TO |
157 | |
158 | %{__make} | |
159 | ||
160 | %install | |
161 | rm -rf $RPM_BUILD_ROOT | |
7dcff817 | 162 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{sysconfig/rc-inetd,webapps/%{_webapp}},%{_appdir}} |
10a854a6 | 163 | |
2fe2194b MWP |
164 | %{__make} install \ |
165 | DESTDIR=$RPM_BUILD_ROOT | |
10a854a6 | 166 | |
7dcff817 TP |
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 | |
10a854a6 TO |
174 | |
175 | %clean | |
176 | rm -rf $RPM_BUILD_ROOT | |
177 | ||
7dcff817 TP |
178 | %triggerin frontend-php -- apache1 < 1.3.37-3, apache1-base |
179 | %webapp_register apache %{_webapp} | |
180 | ||
181 | %triggerun frontend-php -- apache1 < 1.3.37-3, apache1-base | |
182 | %webapp_unregister apache %{_webapp} | |
183 | ||
184 | %triggerin frontend-php -- apache < 2.2.0, apache-base | |
185 | %webapp_register httpd %{_webapp} | |
186 | ||
187 | %triggerun frontend-php -- apache < 2.2.0, apache-base | |
188 | %webapp_unregister httpd %{_webapp} | |
189 | ||
e9e15753 | 190 | %pre |
78794d78 ER |
191 | %groupadd -g 111 zabbix |
192 | %useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix | |
10a854a6 | 193 | |
c4962172 | 194 | %post |
96b8972f | 195 | if [ "$1" = 1 ]; then |
c4962172 ER |
196 | %banner -e %{name} <<-EOF |
197 | You should create database for Zabbix. | |
198 | Running these should be fine in most cases: | |
199 | %if %{with pgsql} | |
200 | psql -c 'create database zabbix' | |
7dcff817 | 201 | zcat %{_docdir}/%{name}-%{version}/create/postgresql/schema.sql.gz | psql zabbix |
c4962172 | 202 | zcat %{_docdir}/%{name}-%{version}/create/data/data.sql.gz | psql zabbix |
02051dbe | 203 | zcat %{_docdir}/%{name}-%{version}/create/data/images_pgsql.sql.gz | psql zabbix |
c4962172 ER |
204 | %else |
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 | |
02051dbe | 208 | zcat %{_docdir}/%{name}-%{version}/create/data/images.sql.gz | mysql zabbix |
c4962172 ER |
209 | %endif |
210 | %{?TODO:You also need zabbix-agent. install zabbix-agent-standalone %or zabbix-agent-inetd.} | |
211 | EOF | |
96b8972f | 212 | fi |
c4962172 | 213 | |
e9e15753 | 214 | %postun |
10a854a6 | 215 | if [ "$1" = "0" ]; then |
9b19117f | 216 | %userremove zabbix |
217 | %groupremove zabbix | |
10a854a6 TO |
218 | fi |
219 | ||
220 | %post agent-inetd | |
96b8972f | 221 | %service -q rc-inetd reload |
10a854a6 TO |
222 | |
223 | %postun agent-inetd | |
96b8972f ER |
224 | if [ "$1" = 0 ]; then |
225 | %service -q rc-inetd reload | |
10a854a6 TO |
226 | fi |
227 | ||
10a854a6 TO |
228 | %files |
229 | %defattr(644,root,root,755) | |
7dcff817 TP |
230 | %doc AUTHORS FAQ NEWS README ChangeLog create upgrades bin/ZabbixW{32,64}.exe |
231 | %attr(750,root,zabbix) %dir %{_sysconfdir} | |
e4c376d6 | 232 | %dir %{_appdir} |
7dcff817 | 233 | %dir %{_appdir}/frontends |
10a854a6 TO |
234 | |
235 | %files agent-inetd | |
236 | %defattr(644,root,root,755) | |
7dcff817 TP |
237 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent.conf |
238 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/zabbix-agent | |
a7e2963d | 239 | %attr(755,root,root) %{_bindir}/zabbix_agent |
10a854a6 TO |
240 | |
241 | %files agent-standalone | |
242 | %defattr(644,root,root,755) | |
7dcff817 | 243 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf |
a7e2963d | 244 | %attr(755,root,root) %{_bindir}/zabbix_agentd |
10a854a6 | 245 | |
7dcff817 | 246 | %files frontend-php |
10a854a6 | 247 | %defattr(644,root,root,755) |
7dcff817 TP |
248 | %attr(750,root,http) %dir %{_webapps}/%{_webapp} |
249 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/* | |
250 | %{_appdir}/frontends/php | |
10a854a6 | 251 | |
a7e2963d | 252 | %files get |
10a854a6 | 253 | %defattr(644,root,root,755) |
a7e2963d | 254 | %attr(755,root,root) %{_bindir}/zabbix_get |
10a854a6 | 255 | |
7dcff817 TP |
256 | %files sender |
257 | %defattr(644,root,root,755) | |
258 | %attr(755,root,root) %{_bindir}/zabbix_sender | |
259 | ||
a7e2963d | 260 | %files server |
10a854a6 | 261 | %defattr(644,root,root,755) |
7dcff817 | 262 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf |
a7e2963d | 263 | %attr(755,root,root) %{_bindir}/zabbix_server |