]>
Commit | Line | Data |
---|---|---|
f127e10b | 1 | # TODO |
094b9a01 ER |
2 | # - Data Sources (data_sources.php) get duplicated if you use host template, |
3 | # this is limitation of cacti, but you can manually join the DS with graphs | |
4 | # and delete overkill. | |
f127e10b ER |
5 | %define template nagiostats |
6 | Summary: Nagios Statistics - Cacti scripts and templates | |
7 | Name: cacti-template-%{template} | |
8 | Version: 0.1 | |
094b9a01 | 9 | Release: 0.13 |
f127e10b ER |
10 | License: GPL v2 |
11 | Group: Applications/WWW | |
12 | Source0: http://forums.cacti.net/download/file.php?id=18185#/nacti.tar.gz | |
13 | # Source0-md5: 758d07f15a58c845169b3359bce837c5 | |
6412a85c | 14 | Source1: cacti_host_template_nagios_statistics.xml |
7f553a10 | 15 | Source2: check_nagios.sh |
7dc81cca | 16 | Patch0: pld.patch |
e7f813b7 | 17 | Patch1: cgi-rfc.patch |
f127e10b | 18 | URL: http://forums.cacti.net/about33806.html |
094b9a01 | 19 | BuildRequires: rpmbuild(macros) >= 1.595 |
f127e10b ER |
20 | BuildRequires: sed >= 4.0 |
21 | Requires: cacti >= 0.8.7e-8 | |
094b9a01 ER |
22 | Requires: wget |
23 | Suggests: nagios-cgi-nagiostats | |
f127e10b ER |
24 | BuildArch: noarch |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
27 | %define cactidir /usr/share/cacti | |
28 | %define resourcedir %{cactidir}/resource | |
29 | %define scriptsdir %{cactidir}/scripts | |
30 | # XXX amd64? | |
31 | %define nagioscgidir /usr/lib/nagios/cgi | |
32 | ||
33 | %description | |
34 | Template for Cacti - Nagios statistics. | |
35 | ||
094b9a01 ER |
36 | %package -n nagios-cgi-nagiostats |
37 | Summary: CGI webinterface for Nagiostats | |
38 | Group: Applications/WWW | |
39 | Requires: nagios-cgi | |
40 | ||
41 | %description -n nagios-cgi-nagiostats | |
42 | CGI webinterface for Nagiostats. | |
43 | ||
f127e10b ER |
44 | %prep |
45 | %setup -qc | |
6412a85c | 46 | %patch0 -p1 |
e7f813b7 | 47 | %patch1 -p1 |
6412a85c | 48 | cp -a %{SOURCE1} . |
7f553a10 ER |
49 | cp -a %{SOURCE2} . |
50 | %{__sed} -i -e 's,check_nagios.pl,check_nagios.sh,' * | |
f127e10b ER |
51 | |
52 | %install | |
53 | rm -rf $RPM_BUILD_ROOT | |
54 | install -d $RPM_BUILD_ROOT{%{resourcedir},%{scriptsdir},%{nagioscgidir}} | |
7f553a10 | 55 | install -p check_nagios.sh $RPM_BUILD_ROOT%{scriptsdir} |
f127e10b | 56 | install -p mrtgstats.cgi $RPM_BUILD_ROOT%{nagioscgidir} |
f127e10b ER |
57 | cp -a *.xml $RPM_BUILD_ROOT%{resourcedir} |
58 | ||
59 | %post | |
60 | %cacti_import_template %{resourcedir}/cacti_graph_template_nagios_statistics_-_check_statistics.xml | |
61 | %cacti_import_template %{resourcedir}/cacti_graph_template_nagios_statistics_-_host_checks.xml | |
62 | %cacti_import_template %{resourcedir}/cacti_graph_template_nagios_statistics_-_host_problems.xml | |
63 | %cacti_import_template %{resourcedir}/cacti_graph_template_nagios_statistics_-_latency.xml | |
64 | %cacti_import_template %{resourcedir}/cacti_graph_template_nagios_statistics_-_service_checks.xml | |
65 | %cacti_import_template %{resourcedir}/cacti_graph_template_nagios_statistics_-_service_problems.xml | |
6412a85c | 66 | %cacti_import_template %{resourcedir}/cacti_host_template_nagios_statistics.xml |
f127e10b | 67 | |
094b9a01 ER |
68 | %banner -o -e %{name} <<EOF |
69 | You should install 'nagios-cgi-nagiostats' to Nagios servier which would be used | |
70 | to provide data for Cacti template. | |
71 | EOF | |
72 | ||
f127e10b ER |
73 | %clean |
74 | rm -rf $RPM_BUILD_ROOT | |
75 | ||
76 | %files | |
77 | %defattr(644,root,root,755) | |
78 | %doc README | |
7f553a10 | 79 | %attr(755,root,root) %{scriptsdir}/check_nagios.sh |
f127e10b ER |
80 | %{resourcedir}/*.xml |
81 | ||
094b9a01 ER |
82 | %files -n nagios-cgi-nagiostats |
83 | %defattr(644,root,root,755) | |
f127e10b | 84 | %attr(755,root,root) %{nagioscgidir}/mrtgstats.cgi |