Collectd ping plugin, adding a min ping statistic possible?

I'm trying to collect ICMP statistics for different hosts on the internet but i'm missing a "Min" value.

So I would like to know if it's possible to add another title within the ping plugin that monitors the "min ping value" for the selected hosts.
Avg, Last, Min would be all i need.

Can anyone help me with this or tell me if it's even possible ?

edit: I can see a "Min + Max value" when looking at the example graph @collectd wiki.
https://collectd.org/wiki/index.php/Plugin:Ping
Why is this missing in my config ?
Installed packages: liboping 1.9.0-1, collectd-mod-ping 5.7.2-2

The defintion file @/usr/lib/lua/luci/statistics/rrdtool/definitions for ping looks like this:

module("luci.statistics.rrdtool.definitions.ping", package.seeall)

function rrdargs( graph, plugin, plugin_instance, dtype )
return {
-- Ping roundtrip time
{ title = "%H: ICMP Round Trip Time",
vlabel = "ms",
number_format = "%5.1lf ms",
data = {
sources = { ping = { "value" } },
options = { ping__value = {
noarea = true, overlay = true, title = "%di" } }
} },

  -- Ping droprate
  { title = "%H: ICMP Drop Rate",
    vlabel = "%",
    number_format = "%5.2lf %%",
    data = {
  	types   = { "ping_droprate" },
  	options = { ping_droprate = {
  		noarea = true, overlay = true, title = "%di" } }
  } }

}
end

The likely reason is the default setting in LuCI statistics that only average values are stored. You might toggle that, but that will increase the rrd database size.

Additionally, it might require modifying the graph definition in Luci, but I am not certain and can't test right now.

@hnyman
Thanks for your help...
I have unchecked "Only create average RRAs" @Statistics > Setup > Output Plugins > RRDTool and also checked "Show max values instead of averages" but i still get only Avg and Last values.
Also did /etc/init.d/collectd restart but still the same.

I'm searching the internet for the ping graph definition but no success so far...
Maybe i have to reboot the router but I cant do it right now because a few people are actively using my connection at the moment.

But what i found are a few pictures that proof it's possible, e.g.: https://forum.openwrt.org/viewtopic.php?id=60500

Got it working, a simple reboot got it done. Thanks @hnyman !

Also added "per_instance=true" to separate the graphs.
But now I have another problem, the individual graphs do not show the hostnames anymore (see screenshot)... :frowning:
Any Idea how to fix this ?

-- Ping roundtrip time
{ per_instance=true,
title = "%H: ICMP Round Trip Time",
vlabel = "ms",
number_format = "%5.1lf ms",
data = {
sources = { ping = { "value" } },
options = { ping__value = {
noarea = true, overlay = true, title = "%di" } }

collectd_ping_instances

As the graphs are now "per instance", you might need to change the title parameter. Instead of "%di" (data instance), try "%pi" (plugin instance). Not quite sure how that will play out with the exact parameters you have now, but worth testing in any case. (you might also try "%pi %di")

1 Like

Thanks i will give it a try and let you know.
At the moment i've got everything deactivated cause i was running out of free memory and my router seems to reboot at random times.
But not sure if that was related to collectd...
I need to figure out how to collect and log everything on a USB stick to get rid of my free mem issue.

I've fixed this problem by replacing "%H" with "%pi %di" in the title. Thanks hnyman for the suggestion!
Now my config looks like this:

module("luci.statistics.rrdtool.definitions.ping", package.seeall)

function rrdargs( graph, plugin, plugin_instance, dtype )
	return {
		-- Ping roundtrip time
		{ per_instance=true,
		  title = "%pi %di: ICMP Round Trip Time",
		  vlabel = "ms",
		  number_format = "%5.1lf ms",
		  data = {
			sources = { ping = { "value" } },
			options = { ping__value = {
				noarea = true, overlay = true, title = "%di" } }
		} },

		-- Ping droprate
		{ title = "%H: ICMP Drop Rate",
		  vlabel = "%",
		  number_format = "%5.2lf %%",
		  data = {
			types   = { "ping_droprate" },
			options = { ping_droprate = {
				noarea = true, overlay = true, title = "%di" } }
		} }
	}
end

Anyway is there maybe even a better way to log ICMP round trip times to certain hosts on my router?

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.