Affects: NagiosGrapher-current-200803031420
Thumbnail graphs (icon image graphs) break because of a change in the way $end is handled. In the current code, if $end is undefined, ng->graph_image() will be passed an empty "--end" parameter.
This patch is one way to fix it:
--- rrd2-graph.cgi.in.old 2008-03-01 03:13:01.000000000 +1100
+++ rrd2-graph.cgi.in 2008-07-01 08:04:02.000000000 +1000
@@ -356,7 +356,7 @@
'height' => $height,
'width' => $width,
'start' => "--start=" . $start,
- 'end' => "--end=" . $end,
+ 'end' => (defined $end ? "--end=" . $end : ""),
'title' => "MultiGraph: " . $nmgraph{service_name},
'vertical' => join( ' / ', values(%units) ),
'values' => \@values,
@@ -644,7 +644,7 @@
'height' => $height,
'width' => $width,
'start' => "--start=" . $start,
- 'end' => "--end=" . $end,
+ 'end' => (defined $end ? "--end=" . $end : ""),
'title' => "$host("
. $xml_hash->{host}->{$host}->{service}->{$service}->{service_title}
. ") - $title Graph",
The way I solved this was by fixing the graph URLs contained in the serviceextinfo.
Just add "&end=now" to the icon_image...
icon_image dot.png' alt="" border="0"></a><A TARGET="_blank" HREF="graphs.cgi?host=localhost&service=Current Users"><img src="/nagios/cgi-bin/rrd2-system.cgi?host=localhost&service=Current Users&start=-5400&end=now&title=Actual&width=20&height=20&type=AVERAGE&only-graph=true"
If you're using nagiosGrapher to generate your extinfo files, then fix it up in ngraph.ncfg
icon_image_tag ' dot.png' alt="###ALT###" border="0"></a><A TARGET="_blank" HREF="graphs.cgi?###URL###"><img src="###IMAGESRC###" '
icon_image_script /nagios/cgi-bin/rrd2-system.cgi?###URL###&start=-5400&end=now&title=Actual&width=20&height=20&type=AVERAGE&only-graph=true
icon_image_static false
Hope this helps someone!
Cheers,
James