1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

Merge pull request #405 from caseycs/sphinx_configurable_params

make host/port configurable
This commit is contained in:
Steve Schnepp 2013-11-28 08:03:37 -08:00
commit 7216b55570
2 changed files with 18 additions and 2 deletions

View file

@ -4,8 +4,16 @@
* @author: Konstantin Kuklin <konstantin.kuklin@gmail.com> * @author: Konstantin Kuklin <konstantin.kuklin@gmail.com>
* Date: 24.05.12 * Date: 24.05.12
*/ */
$host = getenv('host');
$port = getenv('port');
$sCommandSystem = "echo 'show status;' | mysql -h127.0.0.1 -P9306 | grep connections | awk '{ print $2}';"; if (!$host)
$host = '127.0.0.1';
if (!$port)
$port = 9306;
$sCommandSystem = "echo 'show status;' | mysql -h{$host} -P{$port} | grep connections | awk '{ print $2}';";
$sTmpFilePath = "/tmp/sphinx_connections"; $sTmpFilePath = "/tmp/sphinx_connections";
if (isset($argc) && $argc > 1) { if (isset($argc) && $argc > 1) {

View file

@ -4,8 +4,16 @@
* @author: Konstantin Kuklin <konstantin.kuklin@gmail.com> * @author: Konstantin Kuklin <konstantin.kuklin@gmail.com>
* Date: 24.05.12 * Date: 24.05.12
*/ */
$host = getenv('host');
$port = getenv('port');
$sCommandSystem = "echo 'show status;' | mysql -h127.0.0.1 -P9306 | grep '^queries' | awk '{ print $2}';"; if (!$host)
$host = '127.0.0.1';
if (!$port)
$port = 9306;
$sCommandSystem = "echo 'show status;' | mysql -h{$host} -P{$port} | grep '^queries' | awk '{ print $2}';";
$sTmpFilePath = "/tmp/sphinx_queries"; $sTmpFilePath = "/tmp/sphinx_queries";
if (isset($argc) && $argc > 1) { if (isset($argc) && $argc > 1) {