- 论坛徽章:
- 0
|
cacti/scripts目录下有一个
ss_get_by_ssh.php
可以设置ssh登录到被监控的服务器上,但是问题只有这一个ssh脚本。
如何设定多台被监控主机的被监控url呢?
代码解读:
# Parameters for specific graphs can be specified here, or in the .cnf file.
$status_server = 'localhost'; # Where to query for HTTP status==========被监控主机只有这一个
$status_url = '/server-status'; # The URL path to HTTP status
$http_user = ''; # HTTP authentication
$http_pass = ''; # HTTP authentication
$http_port = 80; # Which port Apache listens on
$memcache_port = 11211; # Which port memcached listens on
$redis_port = 6379; # Which port redis listens on
# How to get openvz stats
$openvz_cmd = 'cat /proc/user_beancounters';
function nginx_cmdline ( $options ) {
global $status_server, $status_url, $http_user, $http_pass, $http_port, $use_ssh;
$use_ssh = isset($options['use-ssh']) ? $options['use-ssh'] : $use_ssh;
$srv = $status_server;
if ( isset($options['server']) ) {
$srv = $options['server'];
}
elseif ( ! $use_ssh ) {
$srv = $options['host'];
}
$url = isset($options['url']) ? $options['url'] : $status_url;
$user = isset($options['http-user']) ? $options['http-user'] : $http_user;
$pass = isset($options['http-password']) ? $options['http-password'] : $http_pass;
$port = isset($options['port2']) ? " options[port2]" : " http_port";
$auth = ($user ? "--http-user=$user" : '') . ' ' . ($pass ? "--http-password=$pass" : '');
return "wget $auth -U Cacti/1.0 -q -O - -T 5 \"http://$srv$port$url?auto\"";
另外:
如果被监控主机被禁止了ip访问----境内的所有websever应该都被设置禁止ip访问了。在那里设置域名呢???
|
|