mirror of
https://github.com/librenms/librenms.git
synced 2024-09-29 06:16:43 +00:00
log progress to db every 5 minutes
This commit is contained in:
parent
0588ff41c3
commit
c65a160c18
@ -217,6 +217,15 @@ while True:
|
||||
log.debug('DEBUG: {} threads currently active'.format(threads))
|
||||
|
||||
if next_update < datetime.now():
|
||||
seconds_taken = (datetime.now() - (next_update - timedelta(minutes=5))).seconds
|
||||
update_query = ("insert into pollers set "
|
||||
"poller_name='%s', "
|
||||
"last_polled=NOW(), "
|
||||
"devices='%d', "
|
||||
"time_taken='%d' ").format(config['distributed_poller_name'],
|
||||
devices_scanned,
|
||||
seconds_taken)
|
||||
cursor.execute(update_query)
|
||||
log.info('INFO: {} devices scanned in the last 5 minutes'.format(devices_scanned))
|
||||
devices_scanned = 0
|
||||
next_update = datetime.now() + timedelta(minutes=5)
|
||||
|
Loading…
Reference in New Issue
Block a user