From c797f39a6abd6294e222b01d9be5d53ef442462a Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 26 Jun 2016 16:30:04 +0200 Subject: [PATCH] make default fetch return the last entry and make sure we return C formatting; add recording of last alert messages and message on recovers; add alerting of btrfs cleanup needs --- include/classes/rrdstat.php-class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/classes/rrdstat.php-class b/include/classes/rrdstat.php-class index 55d0c37..aa7079d 100644 --- a/include/classes/rrdstat.php-class +++ b/include/classes/rrdstat.php-class @@ -440,11 +440,11 @@ class rrdstat { if (!is_numeric($end)) { $end = $this->last_update(); } elseif ($end < 0) { $end += $this->last_update(); } $end = intval($end/$resolution)*$resolution; - if (!is_numeric($start)) { $start = $end; } + if (!is_numeric($start)) { $start = $end-$resolution; } elseif ($start < 0) { $start += $end; } $start = intval($start/$resolution)*$resolution; - $fetch_cmd = $this->rrdtool_bin.' fetch '.$this->rrd_file.' '.$cf.' --resolution '.$resolution + $fetch_cmd = 'LANG=C '.$this->rrdtool_bin.' fetch '.$this->rrd_file.' '.$cf.' --resolution '.$resolution .' --start '.$start.' --end '.$end; $return = `$fetch_cmd 2>&1`; -- 2.35.3