VPS侦探论坛

标题: 关于Nginx 状态监控 [打印本页]

作者: ronald    时间: 2010-11-23 16:12
标题: 关于Nginx 状态监控
我现在想装状态模块stub_status,
网页上提示:在编译Nginx的时候,需要添加以下参数:
--with-http_stub_status_module
请问具体是怎样编译?



在网上发现一款“监控X”(为了避免广告嫌疑,省略一字),可以监控服务器的状态。所以,想试试看。
有没有哪位高手使用过的?不知道耗不耗资源?
作者: licess    时间: 2010-11-23 16:49
标题: 回复 1# 的帖子
此模块默认已编译。
作者: ronald    时间: 2010-11-23 23:09
军哥,我用IE打开:http://www.aad.com/status或:http://www.aad.com/nginx-status或:http://www.aad.com/server-status都提示:404 Not Found在上面的监控X里,则提示:您填写的URL不是正确的Nginx状态页面地址。能不能帮我看看原因?
作者: ronald    时间: 2010-11-23 23:26
我查了下/usr/local/nginx/conf 下面的nginx.conf文件,里面有这么一段
location /status {
stub_status on;
access_log   off;
}
但是,用上面的地址都打不开。
作者: licess    时间: 2010-11-29 14:36
标题: 回复 3# 的帖子
默认的状态信息是 http://域名/nginx_status

如果重新加的需要,重启nginx才会生效。
作者: wxforex    时间: 2010-12-2 16:51
我的是重启也是404..压根就没生成那个目录......
是不是我做了空主机头有关系?
作者: wxforex    时间: 2010-12-2 16:52
  1. user  www www;

  2. worker_processes 4;
  3. worker_cpu_affinity 0001 0010 0100 1000;
  4. error_log  /home/wwwlogs/nginx_error.log  crit;

  5. pid        /usr/local/nginx/logs/nginx.pid;

  6. #Specifies the value for maximum file descriptors that can be opened by this process.
  7. worker_rlimit_nofile 51200;

  8. events
  9.         {
  10.                 use epoll;
  11.                 worker_connections 51200;
  12.         }

  13. http
  14.         {
  15.                 include       mime.types;
  16.                 default_type  application/octet-stream;

  17.                 server_names_hash_bucket_size 128;
  18.                 client_header_buffer_size 32k;
  19.                 large_client_header_buffers 4 32k;
  20.                 client_max_body_size 8m;

  21.                 sendfile on;
  22.                 tcp_nopush     on;

  23.                 keepalive_timeout 60;

  24.                 tcp_nodelay on;

  25.                 fastcgi_connect_timeout 300;
  26.                 fastcgi_send_timeout 300;
  27.                 fastcgi_read_timeout 300;
  28.                 fastcgi_buffer_size 64k;
  29.                 fastcgi_buffers 4 64k;
  30.                 fastcgi_busy_buffers_size 128k;
  31.                 fastcgi_temp_file_write_size 256k;

  32.                 gzip on;
  33.                 gzip_min_length  1k;
  34.                 gzip_buffers     4 16k;
  35.                 gzip_http_version 1.0;
  36.                 gzip_comp_level 2;
  37.                 gzip_types       text/plain application/x-javascript text/css application/xml;
  38.                 gzip_vary on;

  39.                 #limit_zone  crawler  $binary_remote_addr  10m;

  40. server
  41.         {

  42.         listen 80 default;
  43. return 500;

  44.                 location ~ .*\.(php|php5)?$
  45.                         {
  46.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  47.                                 fastcgi_index index.php;
  48.                                 include fcgi.conf;
  49.                         }

  50.                 location /status {
  51.                         stub_status on;
  52.                         access_log   off;
  53.                 }

  54.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  55.                         {
  56.                                 expires      30d;
  57.                         }

  58.                 location ~ .*\.(js|css)?$
  59.                         {
  60.                                 expires      12h;
  61.                         }
  62.   location /idc/nginx-status {
  63.             stub_status on;
  64.             access_log  off;
  65.         }
  66.                 log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
  67.              '$status $body_bytes_sent "$http_referer" '
  68.              '"$http_user_agent" $http_x_forwarded_for';
  69.                 access_log  /home/wwwlogs/access.log  access;
  70.         }

  71. include vhost/*.conf;
  72. }
复制代码

作者: sea912    时间: 2011-2-24 16:27
测试成功   这样就可以了!

http://173.212.254.126/status

http://cs.henyoo.com/status




欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/) Powered by Discuz! X3.4