]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - initscript for zabbix-agent-standalone and zabbix-server | |
3 | # | |
4 | # Conditional build: | |
5 | %bcond_with pgsql # enable PostgreSQL support (by default use mysql) | |
6 | %bcond_with oracle # enable Oracle support (by default use mysql) | |
7 | ||
8 | Summary: zabbix - network monitoring software | |
9 | Summary(pl.UTF-8): zabbix - oprogramowanie do monitorowania sieci | |
10 | Name: zabbix | |
11 | Version: 1.1.7 | |
12 | Release: 1 | |
13 | License: GPL v2+ | |
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 >= 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) | |
35 | ||
36 | %define _sysconfdir /etc/%{name} | |
37 | %define _appdir %{_datadir}/%{name} | |
38 | %define _webapps /etc/webapps | |
39 | %define _webapp %{name} | |
40 | ||
41 | %description | |
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. | |
51 | ||
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. | |
62 | ||
63 | %package agent-inetd | |
64 | Summary: inetd agent for zabbix | |
65 | Summary(pl.UTF-8): Wersja inetd agenta zabbiksa | |
66 | Group: Networking/Admin | |
67 | Requires: %{name} = %{version}-%{release} | |
68 | Requires: inetdaemon | |
69 | Obsoletes: zabbix-agent-standalone | |
70 | ||
71 | %description agent-inetd | |
72 | This package provides inetd version of zabbix agent. | |
73 | ||
74 | %description agent-inetd -l pl.UTF-8 | |
75 | Ten pakiet dostarcza agenta zabbiksa dla inetd. | |
76 | ||
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 | |
83 | ||
84 | %description agent-standalone | |
85 | This package provides standalone (recommended) version of zabbix agent. | |
86 | ||
87 | %description agent-standalone -l pl.UTF-8 | |
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. | |
117 | ||
118 | %package sender | |
119 | Summary: Zabbix sender | |
120 | Summary(pl.UTF-8): Program zawiadamiający zabbiksa | |
121 | Group: Networking/Admin | |
122 | ||
123 | %description sender | |
124 | This package provides the zabbix sender. | |
125 | ||
126 | %description sender -l pl.UTF-8 | |
127 | Ten pakiet zawiera program zawiadamiający zabbiksa. | |
128 | ||
129 | %package server | |
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 | |
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 | ||
144 | %prep | |
145 | %setup -q | |
146 | ||
147 | %build | |
148 | %configure \ | |
149 | %{!?with_pgsql:--with-mysql} \ | |
150 | %{?with_pgsql:--with-pgsql} \ | |
151 | %{?with_oracle:--with-oracle} \ | |
152 | --enable-server \ | |
153 | --enable-agent \ | |
154 | --with-net-snmp \ | |
155 | --with-ldap \ | |
156 | # --with-ucd-snmp=DIR \ | |
157 | ||
158 | %{__make} | |
159 | ||
160 | %install | |
161 | rm -rf $RPM_BUILD_ROOT | |
162 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{sysconfig/rc-inetd,webapps/%{_webapp}},%{_appdir}} | |
163 | ||
164 | %{__make} install \ | |
165 | DESTDIR=$RPM_BUILD_ROOT | |
166 | ||
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 | |
174 | ||
175 | %clean | |
176 | rm -rf $RPM_BUILD_ROOT | |
177 | ||
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 | ||
190 | %pre | |
191 | %groupadd -g 111 zabbix | |
192 | %useradd -d / -u 111 -g zabbix -c "Zabbix User" -s /bin/false zabbix | |
193 | ||
194 | %post | |
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: | |
199 | %if %{with pgsql} | |
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 | |
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 | |
208 | zcat %{_docdir}/%{name}-%{version}/create/data/images.sql.gz | mysql zabbix | |
209 | %endif | |
210 | %{?TODO:You also need zabbix-agent. install zabbix-agent-standalone %or zabbix-agent-inetd.} | |
211 | EOF | |
212 | fi | |
213 | ||
214 | %postun | |
215 | if [ "$1" = "0" ]; then | |
216 | %userremove zabbix | |
217 | %groupremove zabbix | |
218 | fi | |
219 | ||
220 | %post agent-inetd | |
221 | %service -q rc-inetd reload | |
222 | ||
223 | %postun agent-inetd | |
224 | if [ "$1" = 0 ]; then | |
225 | %service -q rc-inetd reload | |
226 | fi | |
227 | ||
228 | %files | |
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} | |
233 | %dir %{_appdir}/frontends | |
234 | ||
235 | %files agent-inetd | |
236 | %defattr(644,root,root,755) | |
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 | |
239 | %attr(755,root,root) %{_bindir}/zabbix_agent | |
240 | ||
241 | %files agent-standalone | |
242 | %defattr(644,root,root,755) | |
243 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf | |
244 | %attr(755,root,root) %{_bindir}/zabbix_agentd | |
245 | ||
246 | %files frontend-php | |
247 | %defattr(644,root,root,755) | |
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 | |
251 | ||
252 | %files get | |
253 | %defattr(644,root,root,755) | |
254 | %attr(755,root,root) %{_bindir}/zabbix_get | |
255 | ||
256 | %files sender | |
257 | %defattr(644,root,root,755) | |
258 | %attr(755,root,root) %{_bindir}/zabbix_sender | |
259 | ||
260 | %files server | |
261 | %defattr(644,root,root,755) | |
262 | %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf | |
263 | %attr(755,root,root) %{_bindir}/zabbix_server |