From 6b379afffc1d2d1b019a4a64db9140442ee812bd Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Mon, 19 Nov 2018 01:55:59 -0600 Subject: [PATCH] Change unpolled devices toast to be based on rrd step (#9391) * Change unpolled devices toast to be based on rrd step * Update message Change it back to 3x --- app/Checks.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Checks.php b/app/Checks.php index 81c21049d8..479fb7534e 100644 --- a/app/Checks.php +++ b/app/Checks.php @@ -82,8 +82,10 @@ class Checks Toastr::error("$notification->body", $notification->title); } - if (Device::isUp()->where('last_polled', '<=', Carbon::now()->subMinutes(15))->exists()) { - Toastr::warning('It appears as though you have some devices that haven\'t completed polling within the last 15 minutes, you may want to check that out :)', 'Devices unpolled'); + $warn_sec = Config::get('rrd.step', 300) * 3; + if (Device::isUp()->where('last_polled', '<=', Carbon::now()->subSeconds($warn_sec))->exists()) { + $warn_min = $warn_sec / 60; + Toastr::warning('It appears as though you have some devices that haven\'t completed polling within the last ' . $warn_min . ' minutes, you may want to check that out :)', 'Devices unpolled'); } // Directory access checks