2 # - add more 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 BR: - instead of using %{__php} macro, make scripts executable with #!/usr/bin/php !
41 BuildRequires: rpm-perlprov
42 BuildRequires: rpmbuild(macros) >= 1.322
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 %define webcactiroot /usr/share/cacti
48 %define webcactiscriptdir %{webcactiroot}/scripts
49 %define webcactiscrptserverdir %{webcactiroot}/resource/script_server
50 %define webcactiscriptqueriesdir %{webcactiroot}/resource/script_queries
51 %define webcactisnmpqueriesdir %{webcactiroot}/resource/snmp_queries
52 %define __php %{_bindir}/php
55 Templates and scripts for Cacti.
57 %description -l pl.UTF-8
58 Skrypty i templaty dla Cacti.
60 %package Cacti_Poller_Statistics
61 Summary: Statistics for Cacti Poller
62 Summary(pl.UTF-8): Statystyki działania Pollera Cacti
63 Group: Applications/WWW
64 Requires: %{name}-cmd_line_add_template
66 %description Cacti_Poller_Statistics
67 Statistics for Cacti Poller, works with localhost only.
69 %description Cacti_Poller_Statistics -l pl.UTF-8
70 Statystyki działania Pollera Cacti, działa tylko lokalnie.
72 %package cmd_line_add_template
73 Summary: Adding template for Cacti from command line
74 Summary(pl.UTF-8): Dodawanie template dla cacti z lini poleceń
75 Group: Applications/WWW
77 %description cmd_line_add_template
78 Adding template for Cacti from command line. Usage :
79 /usr/share/cacti/cacti/add_template.php your_template.xml
81 %description cmd_line_add_template -l pl.UTF-8
82 Dodawanie template dla cacti z lini poleceń. Usage :
83 /usr/share/cacti/cacti/add_template.php your_template.xml
85 %package DNS_Server_Response_Time
86 Summary: Cacti - Measure the response times of multiple internal and external DNS Resolver
87 Summary(pl.UTF-8): Cacti -
88 Group: Applications/WWW
89 Requires: %{name}-cmd_line_add_template
91 %description DNS_Server_Response_Time
92 Measure the response times of multiple internal and external DNS
93 Resolvers. The Perl script launches queries repeatedly (after holdoff
94 delay between queries) during Cacti default sample intervall of 300
95 seconds and the returns minimum, median, average and maximum response
98 %package Samba_locked_machine
99 Summary: Graphs the locked machines, shares and files from a samba server
100 Summary(pl.UTF-8): Samba - wykresy przyłączonych stacji, udziałów i plików w Cacti
101 Group: Applications/WWW
102 Requires: %{name}-cmd_line_add_template
104 %description Samba_locked_machine
105 Add-on for Cacti - graphs the locked machines, shares and files from a
106 samba server in gauge mode.
108 %description Samba_locked_machine -l pl.UTF-8
109 Dodatek do cacti - Samba - wykresy przyłączonych stacji, udziałów
113 Summary: Template to query hddtemp deamon and graph disks temperature
114 Summary(pl.UTF-8): Wykresy temperatury dysków - dane pobierane z hddtemp
115 Group: Applications/WWW
116 Requires: %{name}-cmd_line_add_template
119 Template to query hddtemp deamon and graph disks temperature.
121 %description hddtemp -l pl.UTF-8
122 Wykresy temperatury dysków - dane pobierane z hddtemp.
126 gzip -dNc %{SOURCE1} > ss_poller.php
129 find '(' -name '*.php' -o -name '*.inc' ')' -print0 | xargs -0 sed -i -e 's,\r$,,'
132 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