function process($ip ,array $config)
{
	echo "#被监控端ip地址\n";
	echo "ip_address=$ip\n";
	echo "#采集信息\n";
	foreach ($config as $script => $params)
	{
		foreach ($params as $p)
		{
			echo makeCommand($ip, $script, $p)."\n";
		}
	}
	echo "#生成监控数据(client)\n";
	echo "/usr/bin/nohup /bin/bash /home/avatar/monitor_scripts/sent_data.sh {$ip} >> /home/avatar/cacti_client_data/{$ip}/client.log 2>&1 & \n";
}
Exemple #2
0
<title>git update</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" />
<meta name="mobile-web-app-capable" content="yes" />
<?php 
require_once "../include/includes.php";
addCssFromConfig("lib.bootstrap");
?>
</head>
<body class="container">
<br/>
<pre><?php 
$gitPath = getExePath($exe = "GIT", $key = "_GIT");
if (!$gitPath || !file_exists($gitPath)) {
    echo "git disabled.";
} else {
    echo "\nstatus:\n";
    echo execCommand(makeCommand("[0] status", $gitPath));
    echo "\npull:\n";
    echo execCommand(makeCommand("[0] pull --rebase", $gitPath));
}
?>
</pre>
<a href="<?php 
echo $APP_DIR;
?>
">return to application</a>
</body>
</html>