packages: cacti-template-mysql/cacti-template-mysql.spec (NEW), cacti-templ...

glen glen at pld-linux.org
Fri May 7 00:24:56 CEST 2010


Author: glen                         Date: Thu May  6 22:24:56 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- new

---- Files affected:
packages/cacti-template-mysql:
   cacti-template-mysql.spec (NONE -> 1.1)  (NEW), config.patch (NONE -> 1.1)  (NEW), config.php (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/cacti-template-mysql/cacti-template-mysql.spec
diff -u /dev/null packages/cacti-template-mysql/cacti-template-mysql.spec:1.1
--- /dev/null	Fri May  7 00:24:57 2010
+++ packages/cacti-template-mysql/cacti-template-mysql.spec	Fri May  7 00:24:51 2010
@@ -0,0 +1,65 @@
+# $Revision$, $Date$
+%define		template	mysql
+Summary:	MySQL cacti templates
+Name:		cacti-template-%{template}
+Version:	1.1.7
+Release:	1
+License:	GPL v2
+Group:		Applications/WWW
+Source0:	http://mysql-cacti-templates.googlecode.com/files/better-cacti-templates-%{version}.tar.gz
+# Source0-md5:	cec81aa5cba180d079122127bde9bae0
+Source1:	config.php
+Patch0:		config.patch
+URL:		http://code.google.com/p/mysql-cacti-templates/
+BuildRequires:	rpmbuild(macros) >= 1.554
+Requires:	cacti >= 0.8.7e-8
+Conflicts:	cacti-spine < 0.8.7e-3
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define		_sysconfdir		/etc/webapps/cacti
+%define		cactidir		/usr/share/cacti
+%define		resourcedir		%{cactidir}/resource
+%define		scriptsdir		%{cactidir}/scripts
+
+%description
+This is a set of templates for monitoring MySQL servers with Cacti.
+
+%prep
+%setup -qn better-cacti-templates-%{version}
+%patch0 -p1
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{resourcedir},%{scriptsdir}}
+
+# we deliberately are not packaging other templates this project offers:
+# - it's idiotic to graph network services over ssh
+# - the should get their own package to avoid some confusion when searching for
+#   templates in package repository
+install -p scripts/ss_get_mysql_stats.php $RPM_BUILD_ROOT%{scriptsdir}
+cp -a templates/cacti_host_template_x_mysql_server*.xml \
+	$RPM_BUILD_ROOT%{resourcedir}/cacti_host_template_x_mysql_server.xml
+cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ss_get_mysql_stats.php
+
+%post
+%cacti_import_template %{resourcedir}/cacti_host_template_x_mysql_server.xml
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc COPYING README Changelog
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ss_get_mysql_stats.php
+%attr(755,root,root) %{scriptsdir}/ss_get_mysql_stats.php
+%{resourcedir}/*.xml
+
+%define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1  2010/05/06 22:24:51  glen
+- new

================================================================
Index: packages/cacti-template-mysql/config.patch
diff -u /dev/null packages/cacti-template-mysql/config.patch:1.1
--- /dev/null	Fri May  7 00:24:57 2010
+++ packages/cacti-template-mysql/config.patch	Fri May  7 00:24:51 2010
@@ -0,0 +1,13 @@
+--- cacti/scripts/ss_get_mysql_stats.php~	2010-04-21 01:38:51.000000000 +0300
++++ cacti/scripts/ss_get_mysql_stats.php	2010-05-06 17:44:31.168860657 +0300
+@@ -67,6 +67,10 @@
+ # ============================================================================
+ # Include settings from an external config file (issue 39).
+ # ============================================================================
++# prefer system location first
++if ( file_exists('/etc/webapps/cacti/ss_get_mysql_stats.php') ) {
++   require('/etc/webapps/cacti/ss_get_mysql_stats.php');
++}
+ if ( file_exists(__FILE__ . '.cnf' ) ) {
+    require(__FILE__ . '.cnf');
+ }

================================================================
Index: packages/cacti-template-mysql/config.php
diff -u /dev/null packages/cacti-template-mysql/config.php:1.1
--- /dev/null	Fri May  7 00:24:57 2010
+++ packages/cacti-template-mysql/config.php	Fri May  7 00:24:51 2010
@@ -0,0 +1,17 @@
+<?php
+# ============================================================================
+# CONFIGURATION for <path_cacti>/scripts/ss_get_mysql_stats.php
+# ============================================================================
+# Define MySQL connection constants in config.php.  Arguments explicitly passed
+# in from Cacti will override these.  However, if you leave them blank in Cacti
+# and set them here, you can make life easier.
+#
+# For more options see the script itself.
+# ============================================================================
+
+$mysql_user = 'mysql';
+$mysql_pass = '';
+$mysql_port = 3306;
+
+# Whether to use the script server or not
+$use_ss    = FALSE;
================================================================


More information about the pld-cvs-commit mailing list