首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用堆栈驱动程序(gcloud宿主)监视码头上的nginx

问使用堆栈驱动程序(gcloud宿主)监视码头上的nginx
EN

Stack Overflow用户
提问于 2017-12-28 17:26:44
回答 1查看 1K关注 0票数 0

为了使用堆栈驱动程序监视nginx (作为应用程序),仅仅将loggin定向到gcploggin驱动程序就足够了,还是必须安装监视代理?

EN

回答 1

Stack Overflow用户

发布于 2017-12-29 14:59:10

要监视nginx状态页面指标:

  1. 您的服务器需要是google云实例或AWS实例。
  2. 是。您需要在服务器/实例/坞上安装代理。
  3. 您需要添加nginx插件配置。
  4. 您必须修改Nginx配置,以允许Stackdriver访问状态页。

Nginx:

代码语言:javascript
复制
# Enable nginx-status for better monitoring with Stackdriver module.
location = /nginx-status {
    # Turn on nginx stats
    stub_status on;
    # I do not need logs for stats
    access_log   off;
    # Security: Only allow access from localhost
    allow 127.0.0.1;
    # Send rest of the world to /dev/null
    deny all;
}

示例Nginx插件配置:https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/collectd.d/nginx.conf

您可以修改stackdriver插件配置,以读取nginx状态指标,如下所示:

代码语言:javascript
复制
LoadPlugin nginx
<Plugin "nginx">
    URL "http://localhost/nginx-status"
</Plugin>

更多插件配置:https://github.com/Stackdriver/stackdriver-agent-service-configs/tree/master/etc/collectd.d

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48011765

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档