2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

make host/port configurable

This commit is contained in:
Ilia Kondrashov 2013-11-27 18:03:06 +04:00
parent 04e9d5bfa1
commit 274440f2b2
2 changed files with 18 additions and 2 deletions

View File

@ -4,8 +4,16 @@
* @author: Konstantin Kuklin <konstantin.kuklin@gmail.com>
* 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";
if (isset($argc) && $argc > 1) {

View File

@ -4,8 +4,16 @@
* @author: Konstantin Kuklin <konstantin.kuklin@gmail.com>
* 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";
if (isset($argc) && $argc > 1) {