From f7fc2728438e9eb35f1ee7ef61cebc835d7728f6 Mon Sep 17 00:00:00 2001 From: VoipTelCH <118352982+VoipTelCH@users.noreply.github.com> Date: Tue, 27 Feb 2024 15:24:31 +0100 Subject: [PATCH] Fixed graphs for icmp service showing PL 4 times (#15856) --- includes/services/check_icmp.inc.php | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/includes/services/check_icmp.inc.php b/includes/services/check_icmp.inc.php index 2f2209fb5f..3202c0c698 100644 --- a/includes/services/check_icmp.inc.php +++ b/includes/services/check_icmp.inc.php @@ -5,25 +5,25 @@ $check_cmd = \LibreNMS\Config::get('nagios_plugins') . '/check_icmp ' . $service if (isset($rrd_filename)) { // Check DS is a json array of the graphs that are available - $check_ds = '{"rtt":"s","pl":"%"}'; + $check_ds = '{"rta":"s","rtmax":"s","rtmin":"s","pl":"%"}'; // Build the graph data $check_graph = []; - $check_graph['rtt'] = ' DEF:DS0=' . $rrd_filename . ':rta:AVERAGE '; - $check_graph['rtt'] .= ' LINE1.25:DS0#' . \LibreNMS\Config::get('graph_colours.mixed.0') . ":'" . str_pad(substr('Round Trip Average', 0, 15), 15) . "' "; - $check_graph['rtt'] .= ' GPRINT:DS0:LAST:%5.2lf%s '; - $check_graph['rtt'] .= ' GPRINT:DS0:AVERAGE:%5.2lf%s '; - $check_graph['rtt'] .= ' GPRINT:DS0:MAX:%5.2lf%s\\l '; - $check_graph['rtt'] .= ' DEF:DS1=' . $rrd_filename . ':rtmax:AVERAGE '; - $check_graph['rtt'] .= ' LINE1.25:DS1#' . \LibreNMS\Config::get('graph_colours.mixed.1') . ":'" . str_pad(substr('Round Trip Max', 0, 15), 15) . "' "; - $check_graph['rtt'] .= ' GPRINT:DS1:LAST:%5.2lf%s '; - $check_graph['rtt'] .= ' GPRINT:DS1:AVERAGE:%5.2lf%s '; - $check_graph['rtt'] .= ' GPRINT:DS1:MAX:%5.2lf%s\\l '; - $check_graph['rtt'] .= ' DEF:DS2=' . $rrd_filename . ':rtmin:AVERAGE '; - $check_graph['rtt'] .= ' LINE1.25:DS2#' . \LibreNMS\Config::get('graph_colours.mixed.2') . ":'" . str_pad(substr('Round Trip Min', 0, 15), 15) . "' "; - $check_graph['rtt'] .= ' GPRINT:DS2:LAST:%5.2lf%s '; - $check_graph['rtt'] .= ' GPRINT:DS2:AVERAGE:%5.2lf%s '; - $check_graph['rtt'] .= ' GPRINT:DS2:MAX:%5.2lf%s\\l '; + $check_graph['rta'] = ' DEF:DS0=' . $rrd_filename . ':rta:AVERAGE '; + $check_graph['rta'] .= ' LINE1.25:DS0#' . \LibreNMS\Config::get('graph_colours.mixed.0') . ":'" . str_pad(substr('Round Trip Average', 0, 15), 15) . "' "; + $check_graph['rta'] .= ' GPRINT:DS0:LAST:%5.2lf%s '; + $check_graph['rta'] .= ' GPRINT:DS0:AVERAGE:%5.2lf%s '; + $check_graph['rta'] .= ' GPRINT:DS0:MAX:%5.2lf%s\\l '; + $check_graph['rtmax'] .= ' DEF:DS1=' . $rrd_filename . ':rtmax:AVERAGE '; + $check_graph['rtmax'] .= ' LINE1.25:DS1#' . \LibreNMS\Config::get('graph_colours.mixed.1') . ":'" . str_pad(substr('Round Trip Max', 0, 15), 15) . "' "; + $check_graph['rtmax'] .= ' GPRINT:DS1:LAST:%5.2lf%s '; + $check_graph['rtmax'] .= ' GPRINT:DS1:AVERAGE:%5.2lf%s '; + $check_graph['rtmax'] .= ' GPRINT:DS1:MAX:%5.2lf%s\\l '; + $check_graph['rtmin'] .= ' DEF:DS2=' . $rrd_filename . ':rtmin:AVERAGE '; + $check_graph['rtmin'] .= ' LINE1.25:DS2#' . \LibreNMS\Config::get('graph_colours.mixed.2') . ":'" . str_pad(substr('Round Trip Min', 0, 15), 15) . "' "; + $check_graph['rtmin'] .= ' GPRINT:DS2:LAST:%5.2lf%s '; + $check_graph['rtmin'] .= ' GPRINT:DS2:AVERAGE:%5.2lf%s '; + $check_graph['rtmin'] .= ' GPRINT:DS2:MAX:%5.2lf%s\\l '; $check_graph['pl'] = ' DEF:DS0=' . $rrd_filename . ':pl:AVERAGE '; $check_graph['pl'] .= ' AREA:DS0#' . \LibreNMS\Config::get('graph_colours.mixed.2') . ":'" . str_pad(substr('Packet Loss (%)', 0, 15), 15) . "' ";