Конфиг такой:
Код: Выделить всё
nagios.cfg
## For Nagios Grapher
service_perfdata_file=/var/spool/nagios/service-perfdata.pipe
service_perfdata_file_template=$HOSTNAME$\t$SERVICEDESC$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA\t$TIMET$\n
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=30
service_perfdata_file_processing_command=process-service-perfdata-file
Код: Выделить всё
commands.cfg
## For Nagios Grapher
define command{
command_name process-service-perfdata-file
command_line mv /var/spool/nagios/service-perfdata.pipe /var/spool/nagios/service-perfdata.$TIMET$
}
Код: Выделить всё
/usr/local/etc/nagios/serviceext/localhost.cfg
## For Nagios Grapher
/usr/local/etc/nagios/serviceext/localhost.cfg
# ExtInfo for localhost, PING
define serviceextinfo{
host_name localhost
icon_image dot.png' alt="" border="0"></a><A TARGET="_blank" HREF="graphs.cgi?host=localhost&service=PING"><img src="/nagios/images/logos/graph.png"
service_description PING
}
#ExtInfo for localhost, HTTP
define serviceextinfo{
host_name localhost
icon_image dot.png' alt="" border="0"></a><A TARGET="_blank" HREF="graphs.cgi?host=localhost&service=check_http"><img src="/nagios/images/logos/graph.png"
service_description check_http
}
Код: Выделить всё
gateway# cat /usr/local/etc/nagios/ngraph.d/templates/standard/check_ping.ncfg
#---
#NagiosGrapherTemplateforcheck_ping
#Author:MariusHein
#---
#PingDEFPacketloss
define ngraph{
service_name PING
graph_log_regex loss = (\d+)
graph_value Loss
graph_units %
graph_legend Loss
graph_legend_eol none
page 2 Loss
rrd_plottype LINE2
rrd_color ff0000
}
#PingDEFRTA - Этот работает исправно
define ngraph{
service_name PING
graph_log_regex rta = (\d+[,\.]\d+)
graph_value RTA
graph_units ms
graph_legend RTA
page 1 RTA
rrd_plottype AREA
rrd_color 00a000
}
#PingVDEF,AverageRTA
define ngraph{
service_name PING
type VDEF
graph_value vdef_ping_average
graph_units
graph_legend RTA Average
graph_calc RTA,AVERAGE
graph_legend_eol LEFT
page 1 RTA
rrd_plottype LINE1
rrd_color 0000ff
hide no
}
#[EOF]gateway#
№ cat /usr/local/etc/nagios/ngraph.d/templates/standard/check_http.# --- появляется, но базу в которую нужно смотреть он не видит... ее просто нет)
# NagiosGrapher Template for check_http
# Author: Marius Hein
# ---
define ngraph{
service_name HTTP
graph_perf_regex time=\s*([0-9\.,]+)
graph_value http_res
graph_units seconds
graph_legend HTTP response time
rrd_plottype AREA
rrd_color c0c0ff
}
define ngraph{
service_name HTTP
type CDEF
graph_value http_cdef
graph_units
graph_legend
graph_calc http_res
rrd_plottype LINE1
rrd_color 000000
}
# [EOF]