【发布时间】:2013-09-09 20:20:49
【问题描述】:
- CentOS 6.3
- 穆宁 2.0.17-1
- php54 (php-fpm)
- nginx 1.2.6-1
通过“epel”存储库设置 munin,经过修改后,我可以使用多个节点。但是,图形缩放不适用于任何图形。根据我在网上找到的建议,我最终将 *_strategy 模式从 HTML 切换到 cgi - 这使得没有任何图表正在更新(因为 cgi 不工作)并且缩放仍然被破坏。
我可以在网上找到的所有指南(包括官方:http://munin-monitoring.org/wiki/CgiHowto2)都提到了使用 spawnfcgi(我曾经在较旧的 CentOS5 服务器上使用)并为此生成特定实例。但是,我在这台服务器上使用 php-fpm 而不是 spawnfcgi 无法适应它的工作。
不工作,我的意思是图表不会加载到“缩放”屏幕上,而是显示损坏的图像链接。 nginx错误日志显示:
2013/09/05 16:31:59 [error] 29384#0: *2 open() "/usr/share/nginx/vhosts/munin.mydomain.com/public_html/munin-cgi/munin-cgi-graph/mydomain.com/host.mydomain.com/postfix_mailvolume-pinpoint=1378299671,1378407671.png" failed (2: No such file or directory), client: 10.30.2.1, server: munin.mydomain.com, request: "GET /munin-cgi/munin-cgi-graph/mydomain.com/host.mydomain.com/postfix_mailvolume-pinpoint=1378299671,1378407671.png?&lower_limit=&upper_limit=&size_x=800&size_y=400 HTTP/1.1", host: "munin.mydomain.com", referrer: "http://munin.mydomain.com/static/dynazoom.html?cgiurl_graph=/munin-cgi/munin-cgi-graph&plugin_name=mydomain.com/host.mydomain.com/postfix_mailvolume&size_x=800&size_y=400&start_epoch=1378299671&stop_epoch=1378407671"
这里是 munin.conf:
[16:42:21]$ cat /etc/munin/munin.conf | sed -e '/^#/d' -e '/^$/d'
htmldir /usr/share/nginx/vhosts/munin.mydomain.com/public_html/
includedir /etc/munin/conf.d
graph_strategy cgi
cgiurl_graph /munin-cgi/munin-cgi-graph
html_strategy cgi
[host.mydomain.com]
address 127.0.0.1
use_node_name yes
[otherhost.mydomain.com]
address 1.2.3.4
use_node_name yes
这里是 nginx 的虚拟主机:
[16:44:16]$ cat /etc/nginx/conf.d/vhosts/munin.thegnomedev.com.conf | sed -e '/^$/d' -e '/^#/d'
server {
listen 80;
server_name munin.mydomain.com;
access_log /var/log/nginx/munin.mydomain.com combined;
error_log /var/log/nginx/error.log warn;
rewrite_log on;
root /usr/share/nginx/vhosts/munin.mydomain.com/public_html/;
index index.php index.html index.htm;
location / {
auth_basic "Restricted";
auth_basic_user_file /usr/share/nginx/vhosts/munin.mydomain.com/.htpasswd;
}
location ^~ /cgi-bin/munin-cgi-graph/ {
fastcgi_split_path_info ^(/cgi-bin/munin-cgi-graph)(.*);
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
include fastcgi_params;
}
location /munin/static/ {
alias /etc/munin/static/;
}
location /munin/ {
fastcgi_split_path_info ^(/munin)(.*);
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
include fastcgi_params;
}
# Deny hidden file types
location ~ /(\.ht|\.git|\.svn) {
deny all;
}
}
在这一点上,我感到非常沮丧,以至于我认为我正在击中大脑锁定。我承认,很可能是我对 nginx 的语法以及它与 php-fpm 的交互方式缺乏完全理解,这可能是罪魁祸首——尤其是如果我可以进行简单的语法更改以使其正常工作。
如果能通过我现有的堆栈解决此问题,我们将不胜感激。一天中的大部分时间都在谷歌上搜索并尝试各种事情。
谢谢
【问题讨论】:
-
你在这方面有什么进展吗?我有完全相同的问题..
-
同样的问题,使用 centos 6 但使用 apache
-
运行具有相同问题的类似设置。一直在到处寻找解决方案。
标签: linux nginx php centos6 munin