Nagiosgrapth - 没有图表

时间:2015-07-03 15:22:14

标签: nagios

我已经使用NGINX + PHP-FPM在我的CentOS 7上安装了Nagiosgraph,手动使用这两个HowTos:

http://sourceforge.net/p/nagiosgraph/git/ci/master/tree/INSTALL http://sachinharma.blogspot.com/2013/08/nagiosgraph-graphs-in-nagios-on_7.html

一切似乎都有效 - 但我没有任何真实的图表:

enter image description here

请注意 - 有黄色矩形 - 它是通过鼠标选择的,看起来像 - 有一些“图形”,但它不会显示。

我在rrd目录中有数据:

# rrdtool dump /var/nagios/rrd/www.dev.domain.com/Current%20Load___load1.rrd
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rrd SYSTEM "http://oss.oetiker.ch/rrdtool/rrdtool.dtd">
<!-- Round Robin Database Dump -->
<rrd>
        <version>0003</version>
        <step>300</step> <!-- Seconds -->
        <lastupdate>1435935645</lastupdate> <!-- 2015-07-03 15:00:45 UTC -->

        <ds>
                <name> data </name>
                <type> GAUGE </type>
                <minimal_heartbeat>600</minimal_heartbeat>
                <min>NaN</min>
                <max>NaN</max>
...

日志等没有错误

nagios.cfg

...
process_performance_data=1
service_perfdata_file=/var/log/nagios/perfdata.log
service_perfdata_file_template=$LASTSERVICECHECK$||$HOSTNAME$||$SERVICEDESC$||$SERVICEOUTPUT$||$SERVICEPERFDATA$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=30
service_perfdata_file_processing_command=process-service-graph
...

templates.cfg

define service {
       name graphed-service
       action_url show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$' onMouseOver='showGraphPopup(this)' onMouseOut='hideGraphPopup()' rel='showgraph.cgi?host=$HOSTNAME$&service=$SERVICEDESC$&period=week&rrdopts=-w+450+-j
       register 0
     }

commands.cfg

define command {
       command_name  process-service-graph
       command_line  /bin/perl /usr/local/nagios/libexec/insert.pl
     }

最后 - 在主机配置中:

define service{
        use                             local-service,graphed-service
        host_name                       www.dev.domain.com
        service_description             Tomcat mem
        check_command                   check-tomcat-mem!8080!admin!Iivoh4pe
        notifications_enabled           1
        }

我在这里做错了什么?

1 个答案:

答案 0 :(得分:0)

问题出在我的/opt/nagiosgraph/etc/nagiosgraph.conf

有:

nagiosgraphcgiurl = /usr/local/nagios/sbin/

而不是:

nagiosgraphcgiurl = /nagios/cgi-bin

这解决了我的问题。