2 # - add another scripts,addons
3 # - patches for path to files (bin,includes)
4 # - %%post - add template to cacti
5 # - instead of using %{__php} macro, make scripts executable with #!/usr/bin/php !
6 %define namesrc cacti_templates
7 %include /usr/lib/rpm/macros.perl
8 Summary: Add-ons for Cacti
9 Summary(pl.UTF-8): Dodatki do Cacti
14 Group: Applications/WWW
15 #Show locked Machines, Shares and Files from a Samba Server - http://forums.cacti.net/about7516.html
16 Source0: http://forums.cacti.net/files/samba.tar.gz
17 # Source0-md5: b8fc04a74b8ab297fd39fb6fb02d80f4
18 # Cacti Poller Statistics - http://forums.cacti.net/about18057-0-asc-0.html
19 Source1: http://forums.cacti.net/files/ss_poller.php.gz
20 # Source1-md5: 5de3f1cfeb5803a9c76a6e1472dd2478
21 Source2: http://forums.cacti.net/files/cacti_host_template_local_cacti_polling_host_171.xml
22 # Source2-md5: 3f54a6579f06745426163685facac558
23 # Adding template from command line - http://forums.cacti.net/about8827.html
24 Source3: http://forums.cacti.net/files/add_template.zip
25 # Source3-md5: a38f01091cb4bf1dbd86db29d6c4c966
26 # DNS Server Response Time - http://forums.cacti.net/about6332.html
27 Source4: http://forums.cacti.net/files/cacti_graph_template_dnsresponsetime_204__fixed_timeout_and_interval_161.xml
28 # Source4-md5: abf46930508377099b37d696648ce7de
29 Source5: http://forums.cacti.net/files/dnsresponsetimeloop_115.txt
30 # Source5-md5: 0844f7d58ff77904416dee5b120c31cf
31 # hddtemp - http://forums.cacti.net/about15020.html , http://forums.cacti.net/about15743.html
32 #URL: http://www.pawelko.net/Cacti/3-Hddtemp-Template-For-Cacti
33 Source6: http://www.pawelko.net/xmedia/cacti/cacti-linux-hddtemp-1.0.tar.gz
34 # Source6-md5: d08898b43978ccbd863076c4b3124987
35 # MySQL Host Template - http://www.faemalia.net/mysqlUtils/ , http://forums.cacti.net/viewtopic.php?t=11010
36 Source7: http://www.faemalia.net/mysqlUtils/teMySQLcacti-20060810.tar.gz
38 Patch0: %{name}-add_template.patch
39 URL: http://www.debianhelp.co.uk/cactitemplates.htm
40 BuildRequires: rpm-perlprov
41 BuildRequires: rpmbuild(macros) >= 1.322
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 %define webcactiroot /usr/share/cacti
47 %define webcactiscriptdir %{webcactiroot}/scripts
48 %define webcactiscrptserverdir %{webcactiroot}/resource/script_server
49 %define webcactiscriptqueriesdir %{webcactiroot}/resource/script_queries
50 %define webcactisnmpqueriesdir %{webcactiroot}/resource/snmp_queries
51 %define __php %{_bindir}/php
54 Templates and scripts for Cacti.
56 %description -l pl.UTF-8
57 Skrypty i templaty dla Cacti.
59 %package Cacti_Poller_Statistics
60 Summary: Statistics for Cacti Poller
61 Summary(pl.UTF-8): Statystyki działania Pollera Cacti
62 Group: Applications/WWW
63 Requires: %{name}-cmd_line_add_template
65 %description Cacti_Poller_Statistics
66 Statistics for Cacti Poller, works with localhost only.
68 %description Cacti_Poller_Statistics -l pl.UTF-8
69 Statystyki działania Pollera Cacti, działa tylko lokalnie.
71 %package cmd_line_add_template
72 Summary: Adding template for Cacti from command line
73 Summary(pl.UTF-8): Dodawanie template dla cacti z lini poleceń
74 Group: Applications/WWW
76 %description cmd_line_add_template
77 Adding template for Cacti from command line. Usage :
78 /usr/share/cacti/cacti/add_template.php your_template.xml
80 %description cmd_line_add_template -l pl.UTF-8
81 Dodawanie template dla cacti z lini poleceń. Usage :
82 /usr/share/cacti/cacti/add_template.php your_template.xml
84 %package DNS_Server_Response_Time
85 Summary: Cacti - Measure the response times of multiple internal and external DNS Resolver
86 Summary(pl.UTF-8): Cacti -
87 Group: Applications/WWW
88 Requires: %{name}-cmd_line_add_template
90 %description DNS_Server_Response_Time
91 Measure the response times of multiple internal and external DNS
92 Resolvers. The Perl script launches queries repeatedly (after holdoff
93 delay between queries) during Cacti default sample intervall of 300
94 seconds and the returns minimum, median, average and maximum response
97 %package Samba_locked_machine
98 Summary: Graphs the locked machines, shares and files from a samba server
99 Summary(pl.UTF-8): Samba - wykresy przyłączonych stacji, udziałów i plików w Cacti
100 Group: Applications/WWW
101 Requires: %{name}-cmd_line_add_template
103 %description Samba_locked_machine
104 Add-on for Cacti - graphs the locked machines, shares and files from a
105 samba server in gauge mode.
107 %description Samba_locked_machine -l pl.UTF-8
108 Dodatek do cacti - Samba - wykresy przyłączonych stacji, udziałów
112 Summary: Template to query hddtemp deamon and graph disks temperature
113 Summary(pl.UTF-8): Wykresy temperatury dysków - dane pobierane z hddtemp
114 Group: Applications/WWW
115 Requires: %{name}-cmd_line_add_template
118 Template to query hddtemp deamon and graph disks temperature.
120 %description hddtemp -l pl.UTF-8
121 Wykresy temperatury dysków - dane pobierane z hddtemp.
125 gzip -dNc %{SOURCE1} > ./ss_poller.php
128 find '(' -name '*.php' -o -name '*.inc' ')' -print0 | xargs -0 sed -i -e 's,\r$,,'
131 rm -rf $RPM_BUILD_ROOT
133 install -d $RPM_BUILD_ROOT{%{webcactiroot}/cacti,%{webcactiscriptdir},%{webcactiscriptqueriesdir},%{webcactisnmpqueriesdir},%{webcactiscrptserverdir},%{_bindir}}
135 install samba/cacti_graph_template_snmp_samba.xml $RPM_BUILD_ROOT%{webcactiscriptqueriesdir}
136 install samba/samba.pl $RPM_BUILD_ROOT%{webcactiscriptdir}
138 install ss_poller.php $RPM_BUILD_ROOT%{webcactiscriptdir}/ss_poller.php
139 install %{SOURCE2} $RPM_BUILD_ROOT%{webcactiscriptqueriesdir}/cacti_host_template_local_cacti_polling_host.xml
141 install cacti/add_template.php $RPM_BUILD_ROOT%{webcactiroot}/add_template.php
143 install %{SOURCE4} $RPM_BUILD_ROOT%{webcactiscriptqueriesdir}/cacti_graph_template_dnsresponsetime.xml
144 install %{SOURCE5} $RPM_BUILD_ROOT%{webcactiscriptdir}/dnsResponseTime.pl
146 install cacti-linux-hddtemp-1.0/hddtemp.xml $RPM_BUILD_ROOT%{webcactiscriptqueriesdir}
147 install cacti-linux-hddtemp-1.0/hddtemp.php $RPM_BUILD_ROOT%{webcactiscriptdir}
148 install cacti-linux-hddtemp-1.0/cacti_graph_template_linux_hddtemp*.xml $RPM_BUILD_ROOT%{webcactiscriptqueriesdir}
151 rm -rf $RPM_BUILD_ROOT
153 %post Cacti_Poller_Statistics
154 %{__php} %{webcactiroot}/add_template.php %{webcactiscriptqueriesdir}/cacti_host_template_local_cacti_polling_host.xml
156 %post DNS_Server_Response_Time
157 %{__php} %{webcactiroot}/add_template.php %{webcactiscriptqueriesdir}/cacti_graph_template_dnsresponsetime.xml
159 %post Samba_locked_machine
160 %{__php} %{webcactiroot}/add_template.php %{webcactiscriptqueriesdir}/cacti_graph_template_snmp_samba.xml
163 %{__php} %{webcactiroot}/add_template.php %{webcactiscriptqueriesdir}/cacti_graph_template_linux_hddtemp_disk_temperature*.xml
165 %files Cacti_Poller_Statistics
166 %defattr(644,root,root,755)
167 %attr(755,root,root) %{webcactiscriptdir}/ss_poller.php
168 %{webcactiscriptqueriesdir}/cacti_host_template_local_cacti_polling_host.xml
170 %files cmd_line_add_template
171 %defattr(644,root,root,755)
172 %attr(755,root,root) %{webcactiroot}/add_template.php
174 %files DNS_Server_Response_Time
175 %defattr(644,root,root,755)
176 %attr(755,root,root) %{webcactiscriptdir}/dnsResponseTime.pl
177 %{webcactiscriptqueriesdir}/cacti_graph_template_dnsresponsetime.xml
179 %files Samba_locked_machine
180 %defattr(644,root,root,755)
181 %attr(755,root,root) %{webcactiscriptdir}/samba.pl
182 %{webcactiscriptqueriesdir}/cacti_graph_template_snmp_samba.xml
185 %defattr(644,root,root,755)
186 %doc cacti-linux-hddtemp-1.0/{CHANGELOG.txt,INSTALL.txt}
187 %attr(755,root,root) %{webcactiscriptdir}/hddtemp.php
188 %{webcactiscriptqueriesdir}/cacti_graph_template_linux_hddtemp_disk_temperature*.xml
189 %{webcactiscriptqueriesdir}/hddtemp.xml