1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00: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) {