From 552be17e3987a7bc06a8443878ad4bc74da118f9 Mon Sep 17 00:00:00 2001 From: Andreas Bachlechner <62039342+bachandi@users.noreply.github.com> Date: Thu, 30 Sep 2021 08:41:55 +0200 Subject: [PATCH] Change refresh_interval from minutes to seconds. --- lib/du.pm | 6 +++--- man/man5/monitorix.conf.5 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/du.pm b/lib/du.pm index 339741c..1bbb11a 100644 --- a/lib/du.pm +++ b/lib/du.pm @@ -50,7 +50,7 @@ sub du_init { my $heartbeat = 120; my $refresh_interval = ($config->{du}->{refresh_interval} || 0); if($refresh_interval > 0) { - $heartbeat = 2 * $refresh_interval * 60; + $heartbeat = 2 * $refresh_interval; } if(-e $rrd) { @@ -171,10 +171,10 @@ sub du_update { my $refresh_interval = ($config->{du}->{refresh_interval} || 0); if($refresh_interval > 0) { - # If desired refreshed only every refresh_interval minutes. + # If desired refreshed only every refresh_interval seconds. # This logic will refresh atleast once a day. my (undef, $min, $hour) = localtime(time); - return if(($min + 60 * $hour) % $refresh_interval); + return if(60 * ($min + 60 * $hour) % $refresh_interval); } my $e = 0; diff --git a/man/man5/monitorix.conf.5 b/man/man5/monitorix.conf.5 index 17dcf11..9718f36 100644 --- a/man/man5/monitorix.conf.5 +++ b/man/man5/monitorix.conf.5 @@ -1637,7 +1637,7 @@ This is a comma-separated list of pool names. The number of pool names defined h .SS Directory usage statistics (du.pm) This graph is able to monitor the usage of an unlimited number of directories. .P -IMPORTANT NOTE: The \fIdu\fP command makes intensive disk I/O access that might slow down the whole system. Moreover, continued executions of this command will affect the buffer cache mechanism and this will also increase the system response time. To reduce executions \fIrefresh_interval\fP can be specified in minutes (Use 0 for default refresh interval). +IMPORTANT NOTE: The \fIdu\fP command makes intensive disk I/O access that might slow down the whole system. Moreover, continued executions of this command will affect the buffer cache mechanism and this will also increase the system response time. To reduce executions \fIrefresh_interval\fP can be specified in seconds (Use 0 for default refresh interval). .P .BI list .RS