免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2137 | 回复: 0
打印 上一主题 下一主题

[其他] 求问使用Percona_Monitoring_Plugins配合cacti监控nginx的情况 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-09-06 18:18 |只看该作者 |倒序浏览

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访问了。在那里设置域名呢???
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP