mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix to avoid triggering this bug: http://sourceforge.net/p/mysql-python/bugs/325/
We remove miliseconds from datetime.
This commit is contained in:
@@ -195,18 +195,24 @@ poller_group = ('and poller_group IN({0}) '
|
|||||||
# Add last_polled and last_polled_timetaken so we can sort by the time the last poll started, with the goal
|
# Add last_polled and last_polled_timetaken so we can sort by the time the last poll started, with the goal
|
||||||
# of having each device complete a poll within the given time range.
|
# of having each device complete a poll within the given time range.
|
||||||
dev_query = ('SELECT device_id, status, '
|
dev_query = ('SELECT device_id, status, '
|
||||||
|
'CAST( '
|
||||||
' DATE_ADD( '
|
' DATE_ADD( '
|
||||||
' DATE_SUB( '
|
' DATE_SUB( '
|
||||||
' last_polled, '
|
' last_polled, '
|
||||||
' INTERVAL last_polled_timetaken SECOND '
|
' INTERVAL last_polled_timetaken SECOND '
|
||||||
' ), '
|
' ), '
|
||||||
' INTERVAL {0} SECOND) AS next_poll, '
|
' INTERVAL {0} SECOND) '
|
||||||
|
' AS DATETIME(0) '
|
||||||
|
') AS next_poll, '
|
||||||
|
'CAST( '
|
||||||
' DATE_ADD( '
|
' DATE_ADD( '
|
||||||
' DATE_SUB( '
|
' DATE_SUB( '
|
||||||
' last_discovered, '
|
' last_discovered, '
|
||||||
' INTERVAL last_discovered_timetaken SECOND '
|
' INTERVAL last_discovered_timetaken SECOND '
|
||||||
' ), '
|
' ), '
|
||||||
' INTERVAL {1} SECOND) AS next_discovery '
|
' INTERVAL {1} SECOND) '
|
||||||
|
' AS DATETIME(0) '
|
||||||
|
') as next_discovery '
|
||||||
'FROM devices WHERE '
|
'FROM devices WHERE '
|
||||||
'disabled = 0 '
|
'disabled = 0 '
|
||||||
'AND IS_FREE_LOCK(CONCAT("polling.", device_id)) '
|
'AND IS_FREE_LOCK(CONCAT("polling.", device_id)) '
|
||||||
|
|||||||
Reference in New Issue
Block a user