【问题标题】:Nagiosgraph onMouseOver not workingNagiosgraph onMouseOver 不工作
【发布时间】:2015-07-22 10:00:30
【问题描述】:

我有一个 nagios 服务器监控多个主机和服务。现在我被要求实施 nagiosgraph。我已经完全按照文档进行操作,除了鼠标悬停功能外,一切正常。

我用这段代码创建了一个 common-header.ssi 文件

<script type="text/javascript" src="/nagiosgraph/nagiosgraph.js"></script>

我已将此文件放入我的 nagios 路径 /usr/local/nagios/share/ssi

我已经定义了一个服务来使用鼠标悬停功能,如下所示:

define service{
    use                             local-service,graphed-service
    host_name                       TOMCAT-DESARROLLO
    service_description             Tomcat heap memory
    check_command                   check_nrpe!check_jmx_heap
    notifications_enabled           0
    action_url                      /nagiosgraph/cgi-bin/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$' onMouseOver="showGraphPopup(this)" onMouseOut="hideGraphPopup()" rel='/nagiosgraph/cgi-bin/showgraph.cgi?host=$HOSTNAME$&service=$SERVICEDESC$
}

Nagiosgraphs 工作正常,我可以通过单击图标访问服务图表。当我将鼠标悬停在图标上时,弹出窗口应该会显示图形,而无需单击任何位置,但我在控制台中收到以下错误消息:

Uncaught ReferenceError: showGraphPopup is not defined
     onmouseover @ status.cgi?host=all:893

在我看来,nagiosgraph 使用了错误的 cgi,因为命令行声明它将使用“showgraph.cgi”,但错误来自 nagios 的“status.cgi”。

关于为什么会发生这种情况以及如何解决它的任何想法?

非常感谢

【问题讨论】:

  • 这是我一直关注的文档,与 nagiosgrap-1.5.2.tar.gz 包中包含的文档完全相同。

标签: javascript apache cgi nagios


【解决方案1】:

我不知道它是否与你有关,我现在与同样的问题斗争了 2 天,终于搞定了。 来自 Nagios:You can include custom headers and footers in the output of the CGIs by dropping some appropriately named HTML files in the ssi/ subdirectory of the Nagios HTML directory (i.e. /usr/local/nagios/share/ssi). 不对! ssi 文件的格式应该是 bash 而不是 HTML。这意味着您应该回显输出。示例 common-header.ssi:

#!/bin/bash    
echo "<script type=\"text/javascript\" src=\"/nagiosgraph/nagiosgraph.js\"></script>"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多