Commit graph

56 commits

Author SHA1 Message Date
Jo-Philipp Wich
46794ea2fb luci-app-statistics: stat-genconfig: don't emit bools for absent uci options
Do not emit native collectd.conf boolean false options if the corresponding
uci option is unset in order to honour collectd's implicit defaults.

This fixes certain options, such as the memory plugins `ValuesAbsolute`,
being without effect if declared as default-enabled in the related plugin
uci forms.

Fixes: #5777
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f16037cec5)
2022-04-25 21:00:20 +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
Hannu Nyman
2c27f5c941 luci-app-statistics: Remove erroneous include from default config
Remove the unnecessary Include line from the default config.
It causes error at collectd start, as the directory is missing.
  daemon.err collectd[9722]: configfile: stat (/etc/collectd/conf.d) failed: No such file or directory

Leave the line as a comment/example.

Fixes #5373

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-10-05 21:42:30 +03:00
k-ronny
dc25703053 luci-app-statistics: irq plugin: handle numeric interrupt names
the `irq` plugin does not show the right data if the interrupt name is only numeric

Signed-off-by: Ronny Kotzschmar <ro.ok@me.com>
2021-08-16 21:27:31 +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
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
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
c052818ee9 luci-app-statistics: correct/tidy default config
Tidy up the current default config for statistics:

* df: use /overlay as the example mount point instead of /jffs
* openvpn: add missing section
* syslog: remove leading whitespaces

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-12-13 11:05:29 +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
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
591b918ea4 luci-app-statistics: modify default amount of data items in RRD
Increase the default number of data items in the RRD database
from 100 to 144. That leads to better matching summarising/averaging
moments between day & week and week & month at the averaging intervals:
30sec, 10min, 70 min, 5h10min, 2d13h

Previous 100 led too easily to situations, where the longer period's
more scarce data gets selected for displaying in the graph. That could
happen if the longer period's last data point was stored more recently
than the last data item in the originally required period.
(E.g. if the last "week data item" was more recent than the last
"day data item", the week data was used for the day chart.)

(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>
2020-05-18 09:43:45 +03:00
Florian Eckert
e05c219b24 luci-app-statistics: remove not needed tmp atribute change
We are generating the PNG images on the fly and and the rrdimg directory
itself is not used anymore. Therefore the no longer needed code section
is removed with this commit.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-05-07 11:32:28 +02: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
Hannu Nyman
d04b8bfc82 luci-app-statistics: fix ACL name
Fix the ACL name.
Instead of referencing openvpn, use the statistics ACL.
Fixes commit 8f34e105c0

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-04-18 14:37:36 +03:00
Jo-Philipp Wich
8f34e105c0 treewide: add ACL annotations to menu entries
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-17 12:40:31 +02:00
Jo-Philipp Wich
1dad678379 luci-app-statistics: allow /etc/group and /etc/passwd access
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-14 17:50:41 +02:00
Jo-Philipp Wich
c099344013 treewide: reorganize base ACLs
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-09 23:23:33 +02: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
Florian Eckert
07f6822b66
Merge pull request #3631 from TDT-AG/pr/20200214-luci-build
build: unify and clean up the  uci-defaults scripts
2020-02-15 13:05:21 +01:00
Jo-Philipp Wich
108b78525a luci-app-statistics: stat-genconfig: handle RRATimespans in list notation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-14 10:06:50 +01:00
Florian Eckert
1f8a3c0417 luci.mk: move /tmp/luci-indexcache remove to package postinst script
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-02-14 09:20:33 +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
Jo-Philipp Wich
1d47f0c1a9 luci-app-statistics: add missing ACL rules
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-13 19:37:26 +01:00
Jo-Philipp Wich
e7d22dce50 luci-app-statistics: convert collectd configuration to client side views
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-12 11:59:41 +01:00
Jo-Philipp Wich
faabe98312 luci-app-statistics: fix config generation
Fixes: 556e14c74 ("luci-app-statistics: convert plugin definitions to JSON")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-07 11:46:53 +01:00
Jo-Philipp Wich
556e14c743 luci-app-statistics: convert plugin definitions to JSON
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-06 12:54:07 +01:00
Jo-Philipp Wich
8a84b63dc9 luci-app-statistics: stat-genconfig: add missing i18n module import
Fixes the following runtime error:

    /usr/bin/lua: /usr/bin/stat-genconfig:289: attempt to index field 'i18n' (a nil value)
    stack traceback:
        /usr/bin/stat-genconfig:289: in main chunk

Reported-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-11-03 20:03:01 +01:00
Hannu Nyman
95ea1e67fe luci-app-statistics: fix memory plugin config
Fix d064cbcf9 by actually enabling ValuesAbsolute in the
config file and also prevent removing that option by LuCI.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2019-10-05 18:59:08 +03:00
Florian Eckert
0633fb23c8 luci-app-statistics: fix collectd config generation
Fix config generation for the following sections:

* curl
* exec
* network
* iptables

Ref: https://github.com/openwrt/packages/issues/9427
Fixes: c1380ab ("make luci-app-statistics more extensible")

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-07-09 13:04:06 +02:00
Matthias Berndt
c1380ab367 make luci-app-statistics more extensible 2019-07-05 02:03:13 +02:00
Loïc Yhuel
af5771426b luci-app-statistics: add address family configuration for ping
It allows to force ipv4 or ipv6 when the DNS returns both addresses, but
only one works (for example if there is no ipv6 connectivity).

Signed-off-by: Loïc Yhuel <loic.yhuel@gmail.com>
2019-06-21 02:03:12 +02:00
Branson Matheson
30ee65fcab adding ability for luci_stats config to have multiple UPS's 2019-02-05 13:21:31 -05:00
Chizhong Jin
2d1830422b pp-statistics: add support for cUrl
Add collectd-mod-curl plugin support. Which can do some complex track,
such as grab stock, but by now, only response time are supported.

Signed-off-by: Chizhong Jin <pjincz@gmail.com>
2018-10-14 02:34:49 +08:00
Jo-Philipp Wich
fa2975d7c5 luci-app-statistics: convert init script to procd
Convert init script to procd format in order to register reload triggers
on /etc/config/luci_statistics.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-02 07:15:58 +02:00
guidosarducci
808f261793 luci-app-statistics: add support for apcups plugin
OpenWRT/LEDE support for APC UPSes is only partial: although the collectd
apcups plugin is included, related lua/luci code is missing. These changes
add the lua side and have been used for ~2 years, both on OpenWRT and LEDE.

Reworked from patches submitted by James Klaas to the luci development list
in 2015.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2017-07-04 16:07:14 -07:00
Hannu Nyman
afa7a14caf luci-app-statistics: set logfile as first item in collectd.conf
Force logfile plugin to be evaluated first so that it gets placed
first in the collectd.conf file.

Reference to https://collectd.org/wiki/index.php/Plugin:LogFile

Fixes #1219

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2017-07-02 23:22:26 +03:00
Hannu Nyman
2bc2f935a0 luci-app-statistics: fix whitespace
* fix whitespace in config file
* place the contextswitch item corerrctly
  in the sorted options list

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2017-05-02 10:07:30 +03:00
fantom-x
5bf636732e Support for collectd-mod-contextswitch
Signed-off-by: Marc Benoit marcb6218@gmail.com
2017-04-29 12:38:23 -04:00
Hannu Nyman
3c988cf16c treewide: cleanup references to madwifi from LuCI
Remove the code related to the deprecated madwifi driver.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2017-02-28 18:55:11 +02:00
Hannu Nyman
1c27f6b462 luci-app-statistics: add support for thermal stats
Add support for temperature data from collect-mod-thermal

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2016-11-19 16:10:57 +02:00
Hannu Nyman
df3c8728b9 luci-app-statistics: add support for CPU frequency scaling stats
Add support for 'cpufreq' plugin in collectd, which monitors
the CPU cores' frequencies. Some platforms enable dynamic
frequency scaling according to CPU load.

'cpufreq' plugin can currently be built for x86 and mvebu.
(and it should likely be enabled also for ipq806x)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2016-11-08 22:24:56 +02:00
Hannu Nyman
a69bd4202e luci-app-statistics: Add cpu and memory plugins to the default set
Add cpu and memory statistics plugins to the default set included
in Luci statistics and enable them in the default config. They are
useful small collectd plugins for resource usage monitoring.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2016-09-04 13:18:59 +03:00
Jo-Philipp Wich
8eaac4b637 Use numeric prefixes for uci-defaults scripts
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-01-27 16:50:19 +01:00
Jo-Philipp Wich
3289e13495 luci-app-statistics: add initial support for collectd-mod-openvpn
This changeset covers compression and traffic stats, not every combination has
been tested yet.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-10-05 18:55:28 +02:00
Jo-Philipp Wich
cff2b99b4f luci-app-statistics: add initial support for collect-mod-sensors
Due to a lack of a test environment this support only covers thermal graphs
so far. Please send the output of "rrdtool info /tmp/rrd/*/sensors-*/*.rrd"
if your system happens to support voltage, power or fanspeed sensors.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-10-05 15:13:44 +02:00