为什么Munin服务器在打到/ munin-cgi / munin-cgi-graph时只给出404状态?

我正在使用亚马逊Linux发行版(最近的一个)。 我试图安装munin在本地节点(只有一个节点,节点和主)。 所以我试了一下:

$ sudo yum install munin munin-node httpd mod_fcgid 

然后我编辑了/etc/munin/munin.conf:

 # cgi on demand html_strategy cgi graph_strategy cgi 

然后我激活了服务:

 $ sudo chkconfig munin-node on 

我检查了版本:

 $ munin-node-configure --version Version: This is munin-node-configure (munin-node) v2.0.20. [... more text here ...] 

我确保munin.conf有ScriptAlias指令:

 <directory /var/www/html/munin> AuthUserFile /etc/munin/munin-htpasswd AuthName "Munin" AuthType Basic require valid-user ExpiresActive On ExpiresDefault M310 </directory> ScriptAlias /munin-cgi/munin-cgi-graph /var/www/cgi-bin/munin-cgi-graph 

我确保密码设置为一个很好的密码:

 $ sudo htpasswd -c /etc/munin/munin-htpasswd MyUser #stdin < my password 

然后我重新启动了服务:

 $ sudo /etc/init.d/munin restart 

而我的httpd:

 $ sudo /etc/init.d/httpd restart 

但是打到/ munin-cgi / munin-cgi-graph会产生一个404.但是这个404不是一个像Apache一样的404,而是一个完全空的404错误,完全没有内容,就好像它是由cgi脚本给出的。 httpd error_log没有显示任何内容。

我应该检查什么? 我的问题是什么?

不幸的是,“ …但是打到/ munin-cgi / munin-cgi-graph会产生一个404 … ”你不是在报告提到404的完整URL。请注意你需要打电话给munin- cgi-graph CGI具有适当的参数,并且这些参数将由munin自己正确validation。

换句话说,在我这边,这个URL:

 https://my.monitoring.server/cgi-bin/munin-cgi-graph/SAN/SAN/SAN_SW_Brocade1-pinpoint=1435589472,1435697472.png?&lower_limit=&upper_limit=&size_x=800&size_y=400 

会产生如下图:

在这里输入图像说明

而另外这个URL:

 https://my.monitoring.server/cgi-bin/munin-cgi-graph/something_random/here_and_there 

将持续在你可能提到的404错误:

 verzulli@iMac-Chiara:~$ wget https://my.monitoring.server/cgi-bin/munin-cgi-graph/something_random/here_and_there --2015-06-30 23:02:39-- https://my.monitoring.server/cgi-bin/munin-cgi-graph/something_random/here_and_there [....] Richiesta HTTP inviata, in attesa di risposta... 404 Not Found 2015-06-30 23:02:40 ERRORE 404: Not Found. verzulli@iMac-Chiara:~$ 

这是munin-CGI图CGI的预期行为。 快速查看源代码将显示:

 while (new CGI::Fast) { # 1rst thing is to validate the URL. Only a subset of chars are allowed. # Return 404 if not compliant, w/o logging. [...] } 

如果由munin-cgi-graph处理的渲染过程失败,那么很有可能在/var/log/munin/munin-cgi-graph.loglogging一些东西(…你的LOGpath可能不同,根据你的自己的configuration)。

由于dynamic图生成可能有点棘手,您可以仔细阅读这里和这里的文档。

如果问题仍然存在,请提供进一步的细节。

更新1

至于访问慕尼黑networking界面的正确方法,请考虑在慕尼黑服务器上所有的监视活动都由一个cron-job( munin-cron )发起,开始启动一个munin-update工作,最后是一个munin-htmlmunin-graph作业。

网页由munin-htmlpipe理,根据munin.conf文件中的html-dir指令生成/更新网页。

默认安装可能如下所示:

  • munin.confhtmldir /var/www/html/munin

与默认的Apache安装一起,可以让你的munin网页界面访问http://your.monitoring.server/munin


PS:最后的个人说明:即使是棘手的问题,在ServerFault上寻求支持也许会更容易,但我build议您更有机地处理您的munin / monitoring问题,search/阅读专门的文档/教程。 即使起初可能会更具挑战性,但我保证,从长远来看,你将得到回报:-)

检查你的apache / httpd是否加载了fcgidcgi模块。

 apachectl -M | grep cgi 

应该回应

 cgi_module (shared) 

要么

 fcgid_module (shared) 

(或两者)。