Fix daily.php not deleting device_perf entries #2755

Merged
merged 1 commit into from Jan 12, 2016

Projects

None yet

3 participants

@ekoyle
Contributor
ekoyle commented Jan 11, 2016

Add -d option to daily.php to show SQL and fix bug where daily.php does
not delete device_perf entries because a unix timestamp (integer) can't
be cast to a datetime.

MariaDB [librenms]> select * from device_perf where timestamp < UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL '7' DAY));
Empty set, 1 warning (1.20 sec)

MariaDB [librenms]> show warnings;
+---------+------+----------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------+
| Warning | 1292 | Incorrect datetime value: '1451944875' |
+---------+------+----------------------------------------+
1 row in set (0.00 sec)

MariaDB [librenms]>

@ekoyle ekoyle Fix daily.php not deleting device_perf entries
Add -d option to daily.php to show SQL and fix bug where daily.php does
not delete device_perf entries because a unix timestamp (integer) can't
be cast to a datetime.

MariaDB [librenms]> select * from device_perf where timestamp < UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL '7' DAY));
Empty set, 1 warning (1.20 sec)

MariaDB [librenms]> show warnings;
+---------+------+----------------------------------------+
| Level   | Code | Message                                |
+---------+------+----------------------------------------+
| Warning | 1292 | Incorrect datetime value: '1451944875' |
+---------+------+----------------------------------------+
1 row in set (0.00 sec)

MariaDB [librenms]>
ceb3c22
@f0o f0o merged commit 8baf724 into librenms:master Jan 12, 2016

2 checks passed

Auto-Deploy Build finished. No test results found.
Details
Scrutinizer No new issues
Details
@ekoyle ekoyle deleted the ekoyle:daily_php_fix branch Jan 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment