Commit graph

51 commits

Author SHA1 Message Date
tew42
8572ae032f luci-app-statistics: ping module, Update MaxMissed data type
MaxMissed was implemented with positive integers only, whereas I think it should also allow the option of "-1" (disabled state)

Signed-off-by: tew42 <2049715+tew42@users.noreply.github.com>
[slightly edited the proposed text]
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-01-02 11:45:18 +02:00
Hannu Nyman
f4dd8b6413 luci-app-statistics: re-order CPU utilization graph classes
Reorder the CPU utilization classes to be in a more logical order
(from hardware toward user) instead of alphabetical order.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-12-04 21:18:39 +02:00
Hannu Nyman
c21c6668ed luci-app-statistics: increase default amount of data items in RRD
Increase the default number of data items in the RRD database
from 144 to 288. This leads to smaller summarising/averaging periods,
visible especially in the day & week graphs. The averaging intervals
will be: 30s, 5min, 35min, 2h35min, 1d6h30min

(Note: this change only applies in a live router if the RRD database is
empty. E.g after reboot or after emptying the RRD database dir.)

Reference to discussion at #4065

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-11-28 20:22:27 +02:00
Hannu Nyman
5b3fa3cdc7 luci-app-statistics: adjust graph size fallback to defaults
Adjust the fallback timespan and graph width to the current config
defaults. (The default width in /etc/config/luci_statistics has been
600 already since commit 7ab8b51bd in March 2010.)

Expose the graph height in the config file and
increase it from 100 to 150 to keep the original aspect ratio.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-11-10 22:27:43 +02:00
Martin Schitter
d91702cb22 luci-app-statistics: protect nested formating litteral
Signed-off-by: Martin Schitter <ms+git@mur.at>
2021-11-06 12:52:51 +01:00
Martin Schitter
b0279f474e luci-app-statistics: trivial fix of wrong varible name
Signed-off-by: Martin Schitter <ms+git@mur.at>
[Fixed the commit title]
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-11-05 20:30:10 +02:00
Jo-Philipp Wich
e9039ae8f5 luci-app-statistics: fix process graph tab captions
Plugins that provide both detail and non-detail instances led to a mismatch
between the instance list to render and the plugin instance list, causing
tab captions to be wrongly assigned.

Fixes: #5387
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-10-23 00:33:54 +02:00
Hannu Nyman
12b13fe89a luci-app-statistics: standardise newline usage
Fix newline usage in a few graph definitions.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-09-28 23:02:35 +03:00
John Kohl
1b715d2515 luci-app-statistics: add support for MaxMissed
Signed-off-by: John Kohl <jtk.git@bostonpog.org>
2021-08-15 10:39:31 +03:00
Anderson McKinley
97424d57af luci-app-statistics: fix read of hostname
Existing javascript did not read a non-default statistics hostname due to
incorrect config ids.

Signed-off-by: Anderson McKinley <coyoso@tuta.io>
2021-05-26 07:01:59 +00:00
Jo-Philipp Wich
8816c8fff7 luci-app-statistics: treat APC UPS "host" setting as single value option
Existing Lua code incorrectly stated that the "Host" option takes a space
sparated list of hostnames which is not the case since the collect plugin
does not handle multiple hosts.

This change reverts the configuration to a simple value as proposed by
the original PR and adjusts the config summary accordingly, while retaining
the translation string.

Ref: https://github.com/openwrt/luci/pull/5010#issuecomment-827285319
Fixes: dd5d96afd ("luci-app-statistics: fix APC UPS host configuration")
Fixes: e7d22dce5 ("luci-app-statistics: convert collectd configuration to client side views")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-04-27 10:17:05 +02:00
Jo-Philipp Wich
dd5d96afdb luci-app-statistics: fix APC UPS host configuration
Ensure that list of hosts is stored as space separated list, like it was
done in the previous Lua implementation.

Fixes: #5010
Fixes: e7d22dce5 ("luci-app-statistics: convert collectd configuration to client side views")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-04-26 17:40:23 +02:00
Hannu Nyman
0d25e3869a
Merge pull request #4358 from plm/remove-rrd-path-triple-escape
luci-app-statistics: remove rrd path triple escape
2021-03-23 17:30:33 +02:00
Hannu Nyman
5da8a0d23f luci-app-statistics: Fix ipstatistics plugin (fix 6ae138c2)
Fix the newly added ipstatistics plugin

* add config definition
* add configSummary
* remove unnecessary option config form
  (no plugin-specific options)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-02-05 21:27:14 +02:00
Nick Hainke
6ae138c2fe luci-app-statistics: add ipstatistics plugin
Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-02-04 16:35:13 +02:00
Giovanni Giacobbi
dfa82b4494 luci-mod-status,luci-app-statistics: Fix case for 'Bit/s' to 'bit/s'
Signed-off-by: Giovanni Giacobbi <giovanni@giacobbi.net>
[fix conflict, reword commit title]
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-01-19 23:11:33 +02:00
Nick Hainke
c7756834b7 luci-app-statistics: add snmp6 collector
Add IPv6 statistics.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-01-09 18:53:01 +02:00
Hannu Nyman
af20ec8e07 luci-app-statistics: Add initial support for chrony
Add initial support for chrony statistics.
At this point introduce time offset and stratum stats.

There is something strange with the host option.
Anything else than 'localhost' or '127.0.0.1' causes an error at
collectd start, even when /tmp/collectd/conf is directly edited

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-12-22 17:54:18 +02:00
Hannu Nyman
b43a5da43e luci-app-statistics: shorten delay at graph endpoint to 15s
Shorten the visible delay at the statistics graph endpoint
from 60 seconds to 15 seconds.

The 60s delay was recently added as a way to remove a possible
visible gap at the end of the hourly graph due to absence of
recent data. Default data collection interval is 30s, so that
60s guarantees that there is data upto to the end of the graph.

However, that 60s makes any recent activity to get displayed
really slowly, after a 60-89 second delay.

Shortening the gap to 15s, half of the default data collection
period, should balance things:
* Half of the time there may be a really narrow gap visible and
  half of the time there is no gap at all.
* The most recent displayed data point is from 15-44 seconds ago
  (instead of 60-89 seconds ago).

Neither 15 or 60 seconds makes any impact to the longer graphs.
To accommodate to possibly shorter timespans, and to avoid the
occasional wrong data series selected for longer period graphs
(see #4065) the endpoint delay might be relative to the timespan.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-12-18 17:41:18 +02:00
Florian Eckert
833e25d24a luci-app-statistics: allow host name for data push
Up do now only an ip address was a allowd.

Fixes: #4288

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-12-16 15:55:39 +01:00
Hannu Nyman
1da78c0d03 luci-app-statistics: Add help text to RRD time spans
Add clarifying help text to the RRD time span definition.

Only a few strings are allowed and it is easy to cause uninteded
results especially with minutes as only "min" is for minute while
("m" or "month") are for month.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-12-13 11:50:54 +02:00
Hannu Nyman
f7e5b56649 luci-app-statistics: Adjust UI defaults to match config file
Adjust the defaults shown in the LuCI user interface to match
the real default values in the default config file.

(If a plugin is disabled and config values get deleted from
the config file, user has been offered incorrect default
values from UI defaults when the plugin is later re-enabled.)

* dns: set br-lan as the interface
* email: socket in /var/run/collectd/ dir
* interface: set br-lan as the interface
* ping: TTL 127, interval 30
* rrdtool: 1hour as shortest period, 144 RRArows
* tcpconns: Do not monitor all, only 22 80
* unixsock: socket in /var/run/collectd/ dir

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-12-13 11:23:09 +02:00
Nick Hainke
f8552afb1c luci-app-statistics: add dhcpleases
Add the dhcpleases plugin:
https://github.com/openwrt/packages/pull/14204

Added-Frontend-by: Hannu Nyman <hannu.nyman@iki.fi>
Signed-off-by: Nick Hainke <vincent@systemli.org>

[Minor changes to graph: alt_autoscale, precision, label]
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-12-12 18:29:54 +02:00
Hannu Nyman
1cff100221 luci-app-statistics: CPU plugin: hide 'idle', tweak defaults
* Add functionality to hide the metric of 'idle' state
  from the chart and data table. Many routers are mostly idle,
  and the 98% 'idle' dominates the graph reducing its usefulness.
  Without 'idle', the smaller CPU usage spikes are visible.

* Hide 'idle' by default. Provide config option to show it.
  (note: the option in inside LuCI, and has no impact on actual
   data collection by collectd.)

* Tweak the defaults to use the percentage data by default.
  It makes more sense to average users than jiffies.

* Set the current LuCI defaults also in the config file.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-11-08 09:29:03 +02:00
Hannu Nyman
b95ac83ffd luci-app-statistics: fix comment
Update comment to reflect 'noavg' option introduced by 64bb82d03

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-09-08 08:21:55 +03:00
Florian Eckert
4d3f61d7c7 luci-app-statistics: add noavg option
It is sometimes useful not to display avg values int the graph.
This option is used to prevent this from appearing in the graph.
In a graph definition this option must be set to *true*,
 if the avg values should not be displayed.

```
options = {
	gauge = {
		title = "Status",
		color = "0000ff",
		noarea = true,
		noavg = true
	}
```

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-09-08 07:57:35 +03:00
Philip L. McMahon
d44302b3ac luci-app-statistics: remove rrd path triple escape
Fixes rendering errors when RRD file names contain IPv6 addresses and the
colon (":") characters are triple escaped.

Adapts the Lua-specific fix in #4340 to Javascript.

Signed-off-by: Philip L. McMahon <philip.l.mcmahon@gmail.com>
2020-08-16 23:57:34 -07:00
Florian Eckert
7a2b8174cc luci-app-statistics: add missing ValuesPercentage option
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-07-13 13:32:52 +02:00
Hannu Nyman
4f80f9542f luci-app-statistics: remove quotemark from comment
Apparently " in a comment may cause an error in some conditions.
Reference to issue #4020

Remove also ";" just in case...

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-05-06 18:14:25 +03:00
Kevin Darbyshire-Bryant
9c4f3454d2 luci-app-statistics: add graphs for sqm-collect
Add graphs for sqm data collected by 'sqm_collect.sh'

An overall sqm graph displays bandwidth (Kb/s), Backlog (Bytes) and
drops for each supported qdisc.

Sqm-cake supports cake's tin structure and displays many(!) graphs per
tin:

Bandwidth: Bandwidth (Kb/s), bandwidth threshold (Kb/s).
Latency: Target latency, Peak, Average, Sparse flow latency
Backlog v Drops: Backlog (Bytes), Drops, ECN marks, Ack-filter drops
Flow counts: Sparse flows, Bulk flows, Unresponsive flows

Fun for all the family :-)

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2020-05-05 12:02:01 +01:00
Tobias Waldvogel
7eb63dfc27 luci-app-statistics: add syslog plugin
Signed-off-by: Tobias Waldvogel <tobias.waldvogel@gmail.com>
2020-04-21 18:36:56 +02:00
Tobias Waldvogel
9277333930 Add missing variable declaration for luci_app_statistics plugin df
Signed-off-by: Tobias Waldvogel <tobias.waldvogel@gmail.com>
2020-04-18 15:27:54 +02:00
ce-4
4be05a5fb8 luci-app-statistics: splash_leases.js: fix typo in configSummary string
Suggested-by: ce-4 <chr.egger@gmail.com>
[reword commit subject]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-08 09:05:13 +02:00
Jo-Philipp Wich
3c4bc228a1 treewide: import utility classes explicitly
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-03 10:00:06 +02:00
Jo-Philipp Wich
3d96519592 luci-app-statistics: minor bugfixes in IRQ and OpenVPN plugin config
- Fix cfgvalue loading in IRQ selection
 - Fix cfgbalue loading in OpenVPN status file selection
 - Fix typo in OpenVPN config translation string

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-03-29 14:17:55 +02:00
Jo-Philipp Wich
6d17667524 luci-app-statistics: rework markup and CSS classes for easier styling
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-03-23 22:19:26 +01:00
Jo-Philipp Wich
12e1d9411d luci-app-statistics: fix APC UPS graph rendering
Fixes: #3743
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-03-16 12:11:01 +01:00
Kevin Darbyshire-Bryant
7b52ff85a7 luci-app-statistics: conntrack: add percent usage graph
The existing graph shows a conntrack entry usage value but doesn't show
a conntrack table size figure so you don't know if you're close to
filling the table.  Add a percent usage graph to show conntrack table
percent used.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2020-03-02 10:04:01 +00:00
Jo-Philipp Wich
0c3ce36ea8 luci-app-statistics: cpufreq: re-add ExtraItems config
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-23 12:10:35 +01:00
Jo-Philipp Wich
72da3c4c55 luci-app-statistics: rearrange graph display
- Add a per-plugin overview tab that contains the (non-detail) graphs of
   each plugin instance, similar to the old Lua based implementation
 - Numerically order plugin instances starting with numbers
 - Avoid multiple renderings of the same graphs
 - Fix legend of tcpconns graphs
 - Move cpufreq distribution and transition charts to detail tabs

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-22 23:32:44 +01:00
Jo-Philipp Wich
d4a475163e luci-app-statistics: clean and fix plugin configurations
- Remove redundant form flags
 - Fix various default values
 - Add some new collect options and remove options that do not exist anymore

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-22 23:26:49 +01:00
Jo-Philipp Wich
96dcae3a34 luci-app-statistics: use stable random seed for dynamic graph colors
Fixes: #3666
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-21 23:01:22 +01:00
Jo-Philipp Wich
27d63e7e71 luci-app-statistics: iptables.js: fix rule match expression
Fixes: #3658
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-21 08:57:29 +01:00
Jo-Philipp Wich
c16f91ccb9 luci-app-statistics: df.js: fix null access in configSummary()
Fixes: #3657
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-21 08:57:29 +01:00
Jo-Philipp Wich
756c894d70 luci-app-statistics: fix graph power/noise ordering
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-20 14:35:20 +01:00
Jo-Philipp Wich
4b1a43fc86 luci-app-statistics: fix data source ordering
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-20 13:48:20 +01:00
Jo-Philipp Wich
eec30a2b7d luci-app-statistics: fix datasource selection in graph rendering
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-19 14:28:35 +01:00
Jo-Philipp Wich
56e77ab817 luci-app-statistics: auto-create missing plugin entries
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-14 12:11:00 +01:00
Jo-Philipp Wich
c71ae18671 luci-app-statistics: config ui tweaks
- Synchronize enabled checkboxes in overview and modals
  - Auto-open modal if enabling plugin with extended config

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-14 11:39:28 +01:00
Jo-Philipp Wich
9680fdea9e luci-app-statistics: convert graph rendering to client side js
This conversion requires cgi-io >= version 17 and uhttpd version >= 2020-02-12
to function properly.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-13 20:45:26 +01:00