-
Notifications
You must be signed in to change notification settings - Fork 1
/
zabbix.spec
1080 lines (874 loc) · 33.7 KB
/
zabbix.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Name : zabbix
Version : 2.0.5
Release : 1.1%{?dist}
Summary : Enterprise-class open source distributed monitoring solution.
Group : Applications/Internet
License : GPLv2+
URL : http://www.zabbix.com/
Source0 : %{name}-%{version}.tar.gz
Source1 : zabbix-web.conf
Source2 : zabbix-logrotate.in
Source3 : zabbix-java-gateway.init
Patch0 : config.patch
Patch1 : fonts-config.patch
Patch2 : JMX_BigDecimal.patch
Patch3 : jmx_port_fix.patch
Buildroot : %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires : mysql-devel
BuildRequires : postgresql-devel
BuildRequires : net-snmp-devel
BuildRequires : openldap-devel
BuildRequires : gnutls-devel
BuildRequires : iksemel-devel
BuildRequires : sqlite-devel
BuildRequires : unixODBC-devel
BuildRequires : curl-devel >= 7.13.1
BuildRequires : OpenIPMI-devel >= 2
BuildRequires : libssh2-devel >= 1
BuildRequires : java-devel >= 1.6.0
Requires : logrotate
Requires(pre) : /usr/sbin/useradd
%description
Zabbix is software that monitors numerous parameters of a network and
the health and integrity of servers. Zabbix uses a flexible
notification mechanism that allows users to configure e-mail based
alerts for virtually any event. This allows a fast reaction to server
problems. Zabbix offers excellent reporting and data visualisation
features based on the stored data. This makes Zabbix ideal for
capacity planning.
Zabbix supports both polling and trapping. All Zabbix reports and
statistics, as well as configuration parameters are accessed through a
web-based front end. A web-based front end ensures that the status of
your network and the health of your servers can be assessed from any
location. Properly configured, Zabbix can play an important role in
monitoring IT infrastructure. This is equally true for small
organisations with a few servers and for large companies with a
multitude of servers.
%package agent
Summary : Zabbix Agent
Group : Applications/Internet
Requires : zabbix = %{version}-%{release}
Requires(post) : /sbin/chkconfig
Requires(preun) : /sbin/chkconfig
Requires(preun) : /sbin/service
%description agent
The Zabbix client agent, to be installed on monitored systems.
%package get
Summary : Zabbix Get
Group : Applications/Internet
%description get
Zabbix get command line utility
%package sender
Summary : Zabbix Sender
Group : Applications/Internet
%description sender
Zabbix sender command line utility
%package server
Summary : Zabbix server common files
Group : Applications/Internet
Requires : zabbix = %{version}-%{release}
Requires : zabbix-server-implementation = %{version}-%{release}
Requires : fping
Requires : net-snmp
Requires : iksemel
Requires : unixODBC
Requires : libssh2 >= 1.0.0
Requires : curl >= 7.13.1
Requires : OpenIPMI-libs >= 2.0.14
Conflicts : zabbix-proxy
Requires(post) : /sbin/chkconfig
Requires(preun) : /sbin/chkconfig
Requires(preun) : /sbin/service
%description server
Zabbix server common files.
%package server-mysql
Summary : Zabbix server compiled to use MySQL database
Group : Applications/Internet
Requires : zabbix = %{version}-%{release}
Requires : zabbix-server = %{version}-%{release}
Provides : zabbix-server-implementation = %{version}-%{release}
Obsoletes : zabbix <= 1.5.3-0.1
Conflicts : zabbix-server-pgsql
%description server-mysql
Zabbix server compiled with MySQL database support.
%package server-pgsql
Summary : Zabbix server compiled to use PostgresSQL database
Group : Applications/Internet
Requires : zabbix = %{version}-%{release}
Requires : zabbix-server = %{version}-%{release}
Requires : postgresql
Provides : zabbix-server-implementation = %{version}-%{release}
Conflicts : zabbix-server-mysql
%description server-pgsql
Zabbix server compiled with PostgresSQL database support.
%package proxy
Summary : Zabbix Proxy common files
Group : Applications/Internet
Requires : zabbix = %{version}-%{release}
Requires : zabbix-proxy-implementation = %{version}-%{release}
Requires : fping
Requires : net-snmp
Requires : unixODBC
Requires : libssh2 >= 1.0.0
Requires : curl >= 7.13.1
Requires : OpenIPMI-libs >= 2.0.14
Conflicts : zabbix-server
Conflicts : zabbix-web
Requires(post) : /sbin/chkconfig
Requires(preun) : /sbin/chkconfig
Requires(preun) : /sbin/service
%description proxy
The Zabbix proxy common files
%package proxy-mysql
Summary : Zabbix proxy compiled to use MySQL
Group : Applications/Internet
Requires : zabbix-proxy = %{version}-%{release}
Requires : mysql
Provides : zabbix-proxy-implementation = %{version}-%{release}
Conflicts : zabbix-proxy-pgsql
Conflicts : zabbix-proxy-sqlite3
%description proxy-mysql
The Zabbix proxy compiled to use MySQL
%package proxy-pgsql
Summary : Zabbix proxy compiled to use PostgreSQL
Group : Applications/Internet
Requires : zabbix-proxy = %{version}-%{release}
Requires : postgresql
Provides : zabbix-proxy-implementation = %{version}-%{release}
Conflicts : zabbix-proxy-mysql
Conflicts : zabbix-proxy-sqlite3
%description proxy-pgsql
The Zabbix proxy compiled to use PostgreSQL
%package proxy-sqlite3
Summary : Zabbix proxy compiled to use SQLite3
Group : Applications/Internet
Requires : zabbix-proxy = %{version}-%{release}
Requires : sqlite
Provides : zabbix-proxy-implementation = %{version}-%{release}
Conflicts : zabbix-proxy-mysql
Conflicts : zabbix-proxy-pgsql
%description proxy-sqlite3
The Zabbix proxy compiled to use SQLite3
%package java-gateway
Summary : Zabbix java gateway
Group : Applications/Internet
Requires : zabbix = %{version}-%{release}
Requires : java >= 1.6.0
Requires(post) : /sbin/chkconfig
Requires(preun) : /sbin/chkconfig
Requires(preun) : /sbin/service
%description java-gateway
The Zabbix java gateway
%package web
Summary : Zabbix Web Frontend
Group : Applications/Internet
%if 0%{?fedora} > 9 || 0%{?rhel} >= 6
BuildArch : noarch
%endif
Requires : httpd
Requires : php >= 5.0
Requires : php-gd
Requires : php-bcmath
Requires : php-mbstring
Requires : php-xml
# DejaVu fonts doesn't exist on EL <= 5
%if 0%{?fedora} || 0%{?rhel} >= 6
Requires : dejavu-sans-fonts
%endif
Requires : zabbix-web-database = %{version}-%{release}
Requires(post) : %{_sbindir}/update-alternatives
Requires(preun) : %{_sbindir}/update-alternatives
Conflicts : zabbix-proxy
%description web
The php frontend to display the zabbix web interface.
%package web-mysql
Summary : Zabbix web frontend for MySQL
Group : Applications/Internet
%if 0%{?fedora} > 9 || 0%{?rhel} >= 6
BuildArch : noarch
%endif
Requires : zabbix-web = %{version}-%{release}
Requires : php-mysql
Provides : zabbix-web-database = %{version}-%{release}
Conflicts : zabbix-web-pgsql
Conflicts : zabbix-web-sqlite3
Obsoletes : zabbix-web <= 1.5.3-0.1
%description web-mysql
Zabbix web frontend for MySQL
%package web-pgsql
Summary : Zabbix web frontend for PostgreSQL
Group : Applications/Internet
%if 0%{?fedora} > 9 || 0%{?rhel} >= 6
BuildArch : noarch
%endif
Requires : zabbix-web = %{version}-%{release}
Requires : php-pgsql
Provides : zabbix-web-database = %{version}-%{release}
Conflicts : zabbix-web-mysql
Conflicts : zabbix-web-sqlite3
%description web-pgsql
Zabbix web frontend for PostgreSQL
%package web-japanese
Summary : Japanese font for Zabbix web frontend
Group : Applications/Internet
%if 0%{?fedora} > 9 || 0%{?rhel} >= 6
BuildArch : noarch
Requires : vlgothic-p-fonts
%else
Requires : ipa-pgothic-fonts
%endif
Requires : %{name}-web = %{version}-%{release}
Requires(post) : %{_sbindir}/update-alternatives
Requires(preun) : %{_sbindir}/update-alternatives
%description web-japanese
Japanese font for Zabbix web frontend
%prep
%setup0 -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
# DejaVu fonts doesn't exist on EL <= 5
%if 0%{?fedora} || 0%{?rhel} >= 6
# remove included fonts
rm -rf frontends/php/fonts/DejaVuSans.ttf
%endif
# remove executable permissions
chmod a-x upgrades/dbpatches/1.8/mysql/upgrade
# fix up some lib64 issues
sed -i.orig -e 's|_LIBDIR=/usr/lib|_LIBDIR=%{_libdir}|g' \
configure
# kill off .htaccess files, options set in SOURCE1
rm -f frontends/php/include/.htaccess
rm -f frontends/php/include/classes/.htaccess
rm -f frontends/php/api/.htaccess
rm -f frontends/php/conf/.htaccess
# set timestamp on modified config file and directories
touch -r frontends/php/css.css frontends/php/include/config.inc.php \
frontends/php/include/defines.inc.php \
frontends/php/include \
frontends/php/include/classes
# fix path to traceroute utility
sed -i.orig -e 's|/usr/bin/traceroute|/bin/traceroute|' database/mysql/data.sql
sed -i.orig -e 's|/usr/bin/traceroute|/bin/traceroute|' database/postgresql/data.sql
sed -i.orig -e 's|/usr/bin/traceroute|/bin/traceroute|' database/sqlite3/data.sql
# remove .orig files in frontend
find frontends/php -name '*.orig'|xargs rm -f
# remove prebuild Windows binaries
rm -rf bin
# change log directory of zabbix_java.log
sed -i -e 's|/tmp/zabbix_java.log|/var/log/zabbix/zabbix_java_gateway.log|g' src/zabbix_java/lib/logback.xml
%build
common_flags="
--enable-dependency-tracking
--sysconfdir=/etc/zabbix
--enable-server
--enable-agent
--enable-proxy
--enable-ipv6
--enable-java
--with-net-snmp
--with-ldap
--with-libcurl
--with-openipmi
--with-jabber
--with-unixodbc
--with-ssh2
"
%configure $common_flags --with-mysql
make %{?_smp_mflags}
mv src/zabbix_server/zabbix_server src/zabbix_server/zabbix_server_mysql
mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_mysql
%configure $common_flags --with-postgresql
make %{?_smp_mflags}
mv src/zabbix_server/zabbix_server src/zabbix_server/zabbix_server_pgsql
mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_pgsql
%configure $common_flags --with-sqlite3
make %{?_smp_mflags}
#mv src/zabbix_server/zabbix_server src/zabbix_server/zabbix_server_sqlite3
mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_sqlite3
touch src/zabbix_server/zabbix_server
touch src/zabbix_proxy/zabbix_proxy
%install
rm -rf $RPM_BUILD_ROOT
# install
make DESTDIR=$RPM_BUILD_ROOT install
# remove unnecessary files
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}
rm $RPM_BUILD_ROOT%{_sbindir}/zabbix_server
rm $RPM_BUILD_ROOT%{_sbindir}/zabbix_proxy
find ./frontends/php -name '*.orig'|xargs rm -f
find ./database -name '*.orig'|xargs rm -f
# set up some required directories
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/web
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
mkdir -p $RPM_BUILD_ROOT/usr/lib/%{name}/alertscripts
mkdir -p $RPM_BUILD_ROOT/usr/lib/%{name}/externalscripts
mkdir -p $RPM_BUILD_ROOT%{_datadir}
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/%{name}
# install the frontend
cp -a frontends/php $RPM_BUILD_ROOT%{_datadir}/%{name}
# prepare ghosted config file
touch $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/web/zabbix.conf.php
# move maintenance.inc.php
mv $RPM_BUILD_ROOT%{_datadir}/%{name}/conf/maintenance.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/web/
# drop config files in place
install -m 0644 -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf
# install zabbix_agent.conf and userparameter files
install -dm 755 $RPM_BUILD_ROOT%{_docdir}/%{name}-agent-%{version}
install -m 0644 conf/zabbix_agent.conf $RPM_BUILD_ROOT%{_docdir}/%{name}-agent-%{version}
install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/zabbix_agentd.d
install -m 0644 conf/zabbix_agentd/userparameter_mysql.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/zabbix_agentd.d
install -m 0644 conf/zabbix_agentd/userparameter_examples.conf $RPM_BUILD_ROOT%{_docdir}/%{name}-agent-%{version}
# fix config file options
cat conf/zabbix_agentd.conf | sed \
-e '/^# PidFile=/a \\nPidFile=%{_localstatedir}/run/zabbix/zabbix_agentd.pid' \
-e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/%{name}/zabbix_agentd.log|g' \
-e '/^# LogFileSize=.*/a \\nLogFileSize=0' \
-e '/^# Include=$/a \\nInclude=%{_sysconfdir}/%{name}/zabbix_agentd.d/' \
> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/zabbix_agentd.conf
cat conf/zabbix_server.conf | sed \
-e '/^# PidFile=/a \\nPidFile=%{_localstatedir}/run/zabbix/zabbix_server.pid' \
-e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/%{name}/zabbix_server.log|g' \
-e '/^# LogFileSize=/a \\nLogFileSize=0' \
-e '/^# AlertScriptsPath=/a \\nAlertScriptsPath=/usr/lib/%{name}/alertscripts' \
-e '/^# ExternalScripts=/a \\nExternalScripts=/usr/lib/%{name}/externalscripts' \
-e 's|^DBUser=root|DBUser=zabbix|g' \
-e '/^# DBSocket=/a \\nDBSocket=%{_localstatedir}/lib/mysql/mysql.sock' \
-e '/^# SNMPTrapperFile=.*/a \\nSNMPTrapperFile=/var/log/snmptt/snmptt.log' \
> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/zabbix_server.conf
cat conf/zabbix_proxy.conf | sed \
-e '/^# PidFile=/a \\nPidFile=%{_localstatedir}/run/zabbix/zabbix_proxy.pid' \
-e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/%{name}/zabbix_proxy.log|g' \
-e '/^# LogFileSize=/a \\nLogFileSize=0' \
-e '/^# ExternalScripts=/a \\nExternalScripts=/usr/lib/%{name}/externalscripts' \
-e 's|^DBUser=root|DBUser=zabbix|g' \
-e '/^# DBSocket=/a \\nDBSocket=%{_localstatedir}/lib/mysql/mysql.sock' \
> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/zabbix_proxy.conf
cat src/zabbix_java/settings.sh | sed \
-e 's|^PID_FILE=.*|PID_FILE="/var/run/zabbix/zabbix_java.pid"|g' \
> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/zabbix_java_gateway.conf
# install log rotation
cat %{SOURCE2} | sed -e 's|COMPONENT|server|g' > \
$RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-server
cat %{SOURCE2} | sed -e 's|COMPONENT|agentd|g' > \
$RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-agent
cat %{SOURCE2} | sed -e 's|COMPONENT|proxy|g' > \
$RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-proxy
# init scripts
install -m 0755 -p misc/init.d/redhat/zabbix-server $RPM_BUILD_ROOT%{_sysconfdir}/init.d/zabbix-server
install -m 0755 -p misc/init.d/redhat/zabbix-agent $RPM_BUILD_ROOT%{_sysconfdir}/init.d/zabbix-agent
install -m 0755 -p misc/init.d/redhat/zabbix-proxy $RPM_BUILD_ROOT%{_sysconfdir}/init.d/zabbix-proxy
install -m 0755 -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/zabbix-java-gateway
# install server and proxy binaries
install -m 0755 -p src/zabbix_server/zabbix_server_* $RPM_BUILD_ROOT%{_sbindir}/
install -m 0755 -p src/zabbix_proxy/zabbix_proxy_* $RPM_BUILD_ROOT%{_sbindir}/
# delete unnecessary files from java gateway
rm $RPM_BUILD_ROOT%{_sbindir}/zabbix_java/settings.sh
rm $RPM_BUILD_ROOT%{_sbindir}/zabbix_java/startup.sh
rm $RPM_BUILD_ROOT%{_sbindir}/zabbix_java/shutdown.sh
# nuke static libs and empty oracle upgrade sql
rm -rf $RPM_BUILD_ROOT%{_libdir}/libzbx*.a
# copy sql files to appropriate per package locations
for pkg in proxy server ; do
docdir=$RPM_BUILD_ROOT%{_docdir}/%{name}-$pkg-mysql-%{version}
install -dm 755 $docdir
cp -pR database/mysql $docdir/create
cp -pR --parents upgrades/dbpatches/1.6/mysql $docdir
cp -pR --parents upgrades/dbpatches/1.8/mysql $docdir
cp -pR --parents upgrades/dbpatches/2.0/mysql $docdir
docdir=$RPM_BUILD_ROOT%{_docdir}/%{name}-$pkg-pgsql-%{version}
install -dm 755 $docdir
cp -pR database/postgresql $docdir/create
cp -pR --parents upgrades/dbpatches/1.6/postgresql $docdir
cp -pR --parents upgrades/dbpatches/1.8/postgresql $docdir
cp -pR --parents upgrades/dbpatches/2.0/postgresql $docdir
if [ "$pkg" = "proxy" ]; then
docdir=$RPM_BUILD_ROOT%{_docdir}/%{name}-$pkg-sqlite3-%{version}
install -dm 755 $docdir
cp -pR database/sqlite3 $docdir/create
fi
done
# remove extraneous ones
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/create
%clean
rm -rf $RPM_BUILD_ROOT
%pre
getent group zabbix > /dev/null || groupadd -r zabbix
getent passwd zabbix > /dev/null || \
useradd -r -g zabbix -d %{_localstatedir}/lib/zabbix -s /sbin/nologin \
-c "Zabbix Monitoring System" zabbix
:
%post agent
/sbin/chkconfig --add zabbix-agent || :
%post server
/sbin/chkconfig --add zabbix-server
if [ $1 -gt 1 ]
then
# Apply permissions also in *.rpmnew upgrades from old permissive ones
chmod 0640 %{_sysconfdir}/zabbix/zabbix_server.conf
chown root:zabbix %{_sysconfdir}/zabbix/zabbix_server.conf
fi
:
%post server-mysql
/usr/sbin/update-alternatives --install %{_sbindir}/zabbix_server zabbix-server %{_sbindir}/zabbix_server_mysql 10
:
%post server-pgsql
/usr/sbin/update-alternatives --install %{_sbindir}/zabbix_server zabbix-server %{_sbindir}/zabbix_server_pgsql 10
:
%post proxy
/sbin/chkconfig --add zabbix-proxy
if [ $1 -gt 1 ]
then
# Apply permissions also in *.rpmnew upgrades from old permissive ones
chmod 0640 %{_sysconfdir}/zabbix/zabbix_proxy.conf
chown root:zabbix %{_sysconfdir}/zabbix/zabbix_proxy.conf
fi
:
%post proxy-mysql
/usr/sbin/update-alternatives --install %{_sbindir}/zabbix_proxy zabbix-proxy %{_sbindir}/zabbix_proxy_mysql 10
:
%post proxy-pgsql
/usr/sbin/update-alternatives --install %{_sbindir}/zabbix_proxy zabbix-proxy %{_sbindir}/zabbix_proxy_pgsql 10
:
%post proxy-sqlite3
/usr/sbin/update-alternatives --install %{_sbindir}/zabbix_proxy zabbix-proxy %{_sbindir}/zabbix_proxy_sqlite3 10
:
%post java-gateway
/sbin/chkconfig --add zabbix-java-gateway || :
%post web
%if 0%{?fedora} || 0%{?rhel} >= 6
/usr/sbin/update-alternatives --install %{_datadir}/%{name}/fonts/graphfont.ttf zabbix-web-font %{_datadir}/fonts/dejavu/DejaVuSans.ttf 10
%else
/usr/sbin/update-alternatives --install %{_datadir}/%{name}/fonts/graphfont.ttf zabbix-web-font %{_datadir}/%{name}/fonts/DejaVuSans.ttf 10
%endif
# move existing config file on update
if [ "$1" -ge "1" ]
then
if [ -f %{_sysconfdir}/zabbix/zabbix.conf.php ]
then
mv %{_sysconfdir}/zabbix/zabbix.conf.php %{_sysconfdir}/zabbix/web
chown apache:apache %{_sysconfdir}/zabbix/web/zabbix.conf.php
fi
fi
:
%post web-japanese
%if 0%{?fedora} || 0%{?rhel} >= 6
/usr/sbin/update-alternatives --install %{_datadir}/%{name}/fonts/graphfont.ttf zabbix-web-font %{_datadir}/fonts/vlgothic/VL-PGothic-Regular.ttf 20
%else
/usr/sbin/update-alternatives --install %{_datadir}/%{name}/fonts/graphfont.ttf zabbix-web-font %{_datadir}/fonts/ipa-pgothic/ipagp.ttf 20
%endif
:
%preun agent
if [ "$1" = 0 ]
then
/sbin/service zabbix-agent stop >/dev/null 2>&1
/sbin/chkconfig --del zabbix-agent
fi
:
%preun server
if [ "$1" = 0 ]
then
/sbin/service zabbix-server stop >/dev/null 2>&1
/sbin/chkconfig --del zabbix-server
fi
:
%preun server-mysql
if [ "$1" = 0 ]
then
/usr/sbin/update-alternatives --remove zabbix-server %{_sbindir}/zabbix_server_mysql
fi
:
%preun server-pgsql
if [ "$1" = 0 ]
then
/usr/sbin/update-alternatives --remove zabbix-server %{_sbindir}/zabbix_server_pgsql
fi
:
%preun proxy
if [ "$1" = 0 ]
then
/sbin/service zabbix-proxy stop >/dev/null 2>&1
/sbin/chkconfig --del zabbix-proxy
fi
:
%preun proxy-mysql
if [ "$1" = 0 ]
then
/usr/sbin/update-alternatives --remove zabbix-proxy %{_sbindir}/zabbix_proxy_mysql
fi
:
%preun proxy-pgsql
if [ "$1" = 0 ]
then
/usr/sbin/update-alternatives --remove zabbix-proxy %{_sbindir}/zabbix_proxy_pgsql
fi
:
%preun proxy-sqlite3
if [ "$1" = 0 ]
then
/usr/sbin/update-alternatives --remove zabbix-proxy %{_sbindir}/zabbix_proxy_sqlite3
fi
:
%preun java-gateway
if [ $1 -eq 0 ]
then
/sbin/service zabbix-java-gateway stop >/dev/null 2>&1
/sbin/chkconfig --del zabbix-java-gateway
fi
:
%preun web
if [ "$1" = 0 ]
then
%if 0%{?fedora} || 0%{?rhel} >= 6
/usr/sbin/update-alternatives --remove zabbix-web-font %{_datadir}/fonts/dejavu/DejaVuSans.ttf
%else
/usr/sbin/update-alternatives --remove zabbix-web-font %{_datadir}/%{name}/fonts/DejaVuSans.ttf
%endif
fi
:
%preun web-japanese
if [ "$1" = 0 ]
then
%if 0%{?fedora} || 0%{?rhel} >= 6
/usr/sbin/update-alternatives --remove zabbix-web-font %{_datadir}/fonts/vlgothic/VL-PGothic-Regular.ttf
%else
/usr/sbin/update-alternatives --remove zabbix-web-font %{_datadir}/fonts/ipa-pgothic/ipagp.ttf
%endif
fi
:
%postun agent
if [ $1 -ge 1 ]
then
/sbin/service zabbix-agent try-restart >/dev/null 2>&1 || :
fi
%postun server
if [ $1 -ge 1 ]
then
/sbin/service zabbix-server try-restart >/dev/null 2>&1 || :
fi
%postun proxy
if [ $1 -ge 1 ]
then
/sbin/service zabbix-proxy try-restart >/dev/null 2>&1 || :
fi
%postun java-gateway
if [ $1 -gt 1 ]; then
/sbin/service zabbix-java-gateway condrestart >/dev/null 2>&1 || :
fi
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING NEWS README
%dir %{_sysconfdir}/zabbix
%attr(0755,zabbix,zabbix) %dir %{_localstatedir}/log/zabbix
%attr(0755,zabbix,zabbix) %dir %{_localstatedir}/run/zabbix
%files agent
%defattr(-,root,root,-)
%{_docdir}/%{name}-agent-%{version}/
%config(noreplace) %{_sysconfdir}/zabbix/zabbix_agentd.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/zabbix-agent
%dir %{_sysconfdir}/zabbix/zabbix_agentd.d
%config(noreplace) %{_sysconfdir}/zabbix/zabbix_agentd.d/userparameter_mysql.conf
%{_sysconfdir}/init.d/zabbix-agent
%{_sbindir}/zabbix_agent
%{_sbindir}/zabbix_agentd
%{_mandir}/man8/zabbix_agentd.8*
%files get
%defattr(-,root,root,-)
%{_bindir}/zabbix_get
%{_mandir}/man1/zabbix_get.1*
%files sender
%defattr(-,root,root,-)
%{_bindir}/zabbix_sender
%{_mandir}/man1/zabbix_sender.1*
%files server
%defattr(-,root,root,-)
%attr(0640,root,zabbix) %config(noreplace) %{_sysconfdir}/zabbix/zabbix_server.conf
%dir /usr/lib/%{name}/alertscripts
%dir /usr/lib/%{name}/externalscripts
%config(noreplace) %{_sysconfdir}/logrotate.d/zabbix-server
%{_sysconfdir}/init.d/zabbix-server
%{_mandir}/man8/zabbix_server.8*
%files server-mysql
%defattr(-,root,root,-)
%{_docdir}/%{name}-server-mysql-%{version}/
%{_sbindir}/zabbix_server_mysql
%files server-pgsql
%defattr(-,root,root,-)
%{_docdir}/%{name}-server-pgsql-%{version}/
%{_sbindir}/zabbix_server_pgsql
%files proxy
%defattr(-,root,root,-)
%attr(0640,root,zabbix) %config(noreplace) %{_sysconfdir}/zabbix/zabbix_proxy.conf
%attr(0755,zabbix,zabbix) %dir /usr/lib/zabbix/externalscripts
%config(noreplace) %{_sysconfdir}/logrotate.d/zabbix-proxy
%{_sysconfdir}/init.d/zabbix-proxy
%{_mandir}/man8/zabbix_proxy.8*
%files proxy-mysql
%defattr(-,root,root,-)
%{_docdir}/%{name}-proxy-mysql-%{version}/
%{_sbindir}/zabbix_proxy_mysql
%files proxy-pgsql
%defattr(-,root,root,-)
%{_docdir}/%{name}-proxy-pgsql-%{version}/
%{_sbindir}/zabbix_proxy_pgsql
%files proxy-sqlite3
%defattr(-,root,root,-)
%{_docdir}/%{name}-proxy-sqlite3-%{version}/
%{_sbindir}/zabbix_proxy_sqlite3
%files java-gateway
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/zabbix/zabbix_java_gateway.conf
%{_sysconfdir}/init.d/zabbix-java-gateway
%{_sbindir}/zabbix_java
%files web
%defattr(-,root,root,-)
%dir %attr(0750,apache,apache) %{_sysconfdir}/zabbix/web
%ghost %attr(0644,apache,apache) %config(noreplace) %{_sysconfdir}/zabbix/web/zabbix.conf.php
%config(noreplace) %{_sysconfdir}/zabbix/web/maintenance.inc.php
%config(noreplace) %{_sysconfdir}/httpd/conf.d/zabbix.conf
%{_datadir}/zabbix
%files web-mysql
%defattr(-,root,root,-)
%files web-pgsql
%defattr(-,root,root,-)
%files web-japanese
%defattr(-,root,root,-)
%changelog
* Mon Mar 11 2013 William Riley <[email protected]> - 2.0.5-1.1
- Add ability to set JMX port per item
- Make items use the host interface with the correct port if available
* Wed Feb 13 2013 Kodai Terashima <[email protected]> - 2.0.5-1
- update to 2.0.5
* Sun Dec 9 2012 Kodai Terashima <[email protected]> - 2.0.4-1
- update to 2.0.4
* Tue Oct 16 2012 Kodai Terashima <[email protected]> - 2.0.3-1
- update to 2.0.3
* Wed Aug 1 2012 Kodai Terashima <[email protected]> - 2.0.2-1
- update to 2.0.2
* Mon Jul 16 2012 Kodai Terashima <[email protected]> - 2.0.1-2
- move userparameter_examples.conf to docdir
- move java gateway log file to /var/log/zabbix
* Tue Jul 3 2012 Kodai Terashima <[email protected]> - 2.0.1-1
- update to 2.0.1
* Wed May 30 2012 Kodai Terashima <[email protected]> - 2.0.0-1
- update to 2.0.0
* Wed Apr 25 2012 Kodai Terashima <[email protected]> -1.8.12-1
- update to 1.8.12
* Tue Apr 3 2012 Kodai Terashima <[email protected]> - 1.8.11-1
- update to 1.8.11
- move maintenance.inc.php to /etc/zabbix/web
* Wed Feb 8 2012 Kodai Terashima <[email protected]> - 1.8.10-1
- update to 1.8.10
- remove snmptrap related files
- move init scripts to zabbix source
- separate get and sender subpackages
- remove server-sqlite3 and web-sqlite3 subpackages
- add web-japanese subpackage
- move alertscripts and externalscripts to /usr/lib/zabbix
- improve default parameter of config files
- delete dependency for zabbix from web package
- move zabbix_agent.conf to docdir
* Tue Aug 9 2011 Dan Horák <dan[at]danny.cz> - 1.8.6-1
- updated to 1.8.6 (#729164, #729165)
- updated user/group adding scriptlet
* Mon May 23 2011 Dan Horák <dan[at]danny.cz> - 1.8.5-2
- include /var/lib/zabbix and /etc/zabbix/externalscripts dirs in package (#704181)
- add snmp trap receiver script in package (#705331)
* Wed Apr 20 2011 Dan Horák <dan[at]danny.cz> - 1.8.5-1
- updated to 1.8.5
* Tue Jan 18 2011 Dan Horák <dan[at]danny.cz> - 1.8.4-2
- enable libcurl detection (#670500)
* Tue Jan 4 2011 Dan Horák <dan[at]danny.cz> - 1.8.4-1
- updated to 1.8.4
- fixes zabbix_agent fail to start on IPv4-only host (#664639)
* Tue Nov 23 2010 Dan Horák <dan[at]danny.cz> - 1.8.3-3
- zabbix emailer doesn't handle multiline responses (#656072)
* Tue Oct 05 2010 jkeating - 1.8.3-2.1
- Rebuilt for gcc bug 634757
* Mon Sep 6 2010 Dan Horák <dan[at]danny.cz> - 1.8.3-2
- fix font path in patch2 (#630500)
* Tue Aug 17 2010 Dan Horák <dan[at]danny.cz> - 1.8.3-1
- updated to 1.8.3
* Wed Aug 11 2010 Dan Horák <dan[at]danny.cz> - 1.8.2-3
- added patch for XSS in triggers page (#620809, ZBX-2326)
* Thu Apr 29 2010 Dan Horák <dan[at]danny.cz> - 1.8.2-2
- DejaVu fonts doesn't exist on EL <= 5
* Tue Mar 30 2010 Dan Horák <dan[at]danny.cz> - 1.8.2-1
- Update to 1.8.2
* Sat Mar 20 2010 Dan Horák <dan[at]danny.cz> - 1.8.1-7
- web interface needs php-xml (#572413)
- updated defaults in config files (#573325)
- built with libssh2 support (#575279)
* Wed Feb 24 2010 Dan Horák <dan[at]danny.cz> - 1.8.1-6
- use system fonts
* Sun Feb 13 2010 Dan Horák <dan[at]danny.cz> - 1.8.1-5
- fixed linking with the new --no-add-needed default (#564932)
* Mon Feb 1 2010 Dan Horák <dan[at]danny.cz> - 1.8.1-4
- enable dependency tracking
* Mon Feb 1 2010 Dan Horák <dan[at]danny.cz> - 1.8.1-3
- updated the web-config patch
* Mon Feb 1 2010 Dan Horák <dan[at]danny.cz> - 1.8.1-2
- close fd on exec (#559221)
* Fri Jan 29 2010 Dan Horák <dan[at]danny.cz> - 1.8.1-1
- Update to 1.8.1
* Tue Jan 26 2010 Dan Horák <dan[at]danny.cz> - 1.8-1
- Update to 1.8
* Thu Dec 31 2009 Dan Horák <dan[at]danny.cz> - 1.6.8-1
- Update to 1.6.8
- Upstream changelog: http://www.zabbix.com/rn1.6.8.php
- fixes 2 issues from #551331
* Wed Nov 25 2009 Dan Horák <dan[at]danny.cz> - 1.6.6-2
- rebuilt with net-snmp 5.5
* Sat Aug 29 2009 Dan Horák <dan[at]danny.cz> - 1.6.6-1
- Update to 1.6.6
- Upstream changelog: http://www.zabbix.com/rn1.6.6.php
* Fri Aug 21 2009 Tomas Mraz <[email protected]> - 1.6.5-3
- rebuilt with new openssl
* Mon Jul 27 2009 Fedora Release Engineering <[email protected]> - 1.6.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Mon Jun 8 2009 Jeffrey C. Ollie <[email protected]> - 1.6.5-1
- Update to 1.6.5, see http://sourceforge.net/mailarchive/message.php?msg_name=4A37A2CA.8050503%40zabbix.com for the full release notes.
-
- It is recommended to create the following indexes in order to speed up
- performance of ZABBIX front-end as well as server side (ignore it if the
- indexes already exist):
-
- CREATE UNIQUE INDEX history_log_2 on history_log (itemid,id);
- CREATE UNIQUE INDEX history_text_2 on history_text (itemid,id);
- CREATE INDEX graphs_items_1 on graphs_items (itemid);
- CREATE INDEX graphs_items_2 on graphs_items (graphid);
- CREATE INDEX services_1 on services (triggerid);
* Mon Jun 8 2009 Ville Skyttä <ville.skytta at iki.fi> - 1.6.4-4
- Start agent after and shut down before proxy and server by default.
- Include database schemas also in -proxy-* docs.
- Make buildable on EL-4 (without libcurl, OpenIPMI).
- Reformat description.
* Fri Apr 17 2009 Ville Skyttä <ville.skytta at iki.fi> - 1.6.4-3
- Tighten configuration file permissions.
- Ensure zero exit status from scriptlets.
- Improve init script LSB compliance.
- Restart running services on package upgrades.
* Thu Apr 9 2009 Dan Horák <dan[at]danny.cz> - 1.6.4-2
- make the -docs subpackage noarch
* Thu Apr 9 2009 Dan Horák <dan[at]danny.cz> - 1.6.4-1
- update to 1.6.4
- remove the cpustat patch, it was integreated into upstream
- use noarch subpackage for the web interface
- database specific web subpackages conflicts with each other
- use common set of option for the configure macro
- enable IPMI support
- sqlite web subpackage must depend on local sqlite
- reorganize the docs and the sql scripts
- change how the web interface config file is created
- updated scriptlet for adding the zabbix user
- move the documentation in PDF to -docs subpackage
- most of the changes were submitted by Ville Skyttä in #494706
- Resolves: #489673, #493234, #494706
* Mon Mar 9 2009 Jeffrey C. Ollie <[email protected]> - 1.6.2-5
- Update pre patch due to incomplete fix for security problems.
* Wed Mar 4 2009 Jeffrey C. Ollie <[email protected]> - 1.6.2-4
- Update to a SVN snapshot of the upstream 1.6 branch to fix security
issue (BZ#488501)
* Wed Feb 25 2009 Fedora Release Engineering <[email protected]> - 1.6.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Fri Jan 23 2009 Jeffrey C. Ollie <[email protected]> - 1.6.2-2
- Rebuild for MySQL 5.1.X
* Fri Jan 16 2009 Jeffrey C. Ollie <[email protected]> - 1.6.2-1
- Update to 1.6.2: http://www.zabbix.com/rn1.6.2.php
* Thu Dec 4 2008 Jeffrey C. Ollie <[email protected]> - 1.6.1-1
- Fix BZ#474593 by adding a requires.
* Wed Nov 5 2008 Jeffrey C. Ollie <[email protected]> - 1.6.1-1
- Update to 1.6.1
* Tue Sep 30 2008 Jeffrey C. Ollie <[email protected]> - 1.6-1.1
- Bump release because forgot to add some new files.
* Thu Sep 30 2008 Jeffrey C. Ollie <[email protected]> - 1.6-1
- Update to final 1.6
* Mon Aug 11 2008 Jason L Tibbitts III <[email protected]> - 1.4.6-2
- Fix license tag.
* Fri Jul 25 2008 Jeffrey C. Ollie <[email protected]> - 1.4.6-1
- Update to 1.4.6
* Mon Jul 07 2008 Dan Horak <dan[at]danny.cz> - 1.4.5-4
- add LSB headers into init scripts
- disable internal log rotation
* Fri May 02 2008 Jarod Wilson <[email protected]> - 1.4.5-3
- Seems the zabbix folks replaced the original 1.4.5 tarball with
an updated tarball or something -- it actually does contain a
tiny bit of additional code... So update to newer 1.4.5.
* Tue Apr 08 2008 Jarod Wilson <[email protected]> - 1.4.5-2
- Fix building w/postgresql (#441456)
* Tue Mar 25 2008 Jeffrey C. Ollie <[email protected]> - 1.4.5-1
- Update to 1.4.5
* Thu Feb 14 2008 Jarod Wilson <[email protected]> - 1.4.4-2
- Bump and rebuild with gcc 4.3
* Mon Dec 17 2007 Jarod Wilson <[email protected]> - 1.4.4-1
- New upstream release
- Fixes two crasher bugs in 1.4.3 release
* Wed Dec 12 2007 Jarod Wilson <[email protected]> - 1.4.3-1
- New upstream release
* Thu Dec 06 2007 Release Engineering <rel-eng at fedoraproject dot org> - 1.4.2-5
- Rebuild for deps
* Sat Dec 01 2007 Dan Horak <dan[at]danny.cz> 1.4.2-4