I'm facing a problem with the collectd-mod-ping as the defintion file has been moved and changed at some point in the development.
Build: OpenWrt SNAPSHOT r12394-1d4f2ca610 / LuCI Master git-20.061.59543-0d68d0a
collectd-mod-ping: 5.10.0-3
luci-app-statistics: git-20.061.59543-0d68d0a-1
I'm trying to monitor some hosts in seperate instances and put the hostnames/IP's as title.
In the past I was able to achieve this with the following config: Collectd ping plugin, adding a min ping statistic possible? but for some reason the definition file isn't stored under /usr/lib/lua/luci/statistics/rrdtool/definitions/ping.lua anymore, instead it's at /www/luci-static/resources/statistics/rrdtool/definitions/ping.js and the style of the defintion has been changed.
'use strict';return L.Class.extend({title:_('Ping'),rrdargs:function(graph,host,plugin,plugin_instance,dtype){var ping={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"}}}};var droprate={title:"%H: ICMP Drop Rate",vlabel:"%",number_format:"%5.2lf %%",data:{types:["ping_droprate"],options:{ping_droprate:{noarea:true,overlay:true,title:"%di",transform_rpn:"100,*"}}}};var stddev={title:"%H: ICMP Standard Deviation",vlabel:"ms",number_format:"%5.1lf ms",data:{types:["ping_stddev"],options:{ping_stddev:{noarea:true,overlay:true,title:"%di"}}}};return[ping,droprate,stddev];}});
So my goal is to implement the following into the new definition file:
{ per_instance=true,
title = "%pi %di: ICMP Round Trip Time",
Replacing ping={title:"%H: ICMP Round Trip Time"
with ping={title = "%pi %di: ICMP Round Trip Time"
works fine but I haven't figured out where I need to place per_instance=true
at the new definition file. I've tried to add it at the correct place but it made luci-statistik fail and I had to revert to the default config.
Last try: {var ping={per_instance=true,title:"%pi %di: ICMP Round Trip Time"....
It would be great if someone can give me a helping hand as I couldn't find anything in several search engines about it.