Skip to content

Commit

Permalink
[chores] Save device status
Browse files Browse the repository at this point in the history
  • Loading branch information
purhan committed Aug 13, 2021
1 parent f071634 commit 7fca813
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openwisp_monitoring/check/classes/snmp_devicemonitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Chart = load_model('monitoring', 'Chart')
Metric = load_model('monitoring', 'Metric')
Device = load_model('config', 'Device')
DeviceData = load_model('device_monitoring', 'DeviceData')
Credentials = load_model('connection', 'Credentials')
AlertSettings = load_model('monitoring', 'AlertSettings')

Expand All @@ -27,6 +28,9 @@ def store_result(self, data):
store result in the DB
"""
pk = self.related_object.pk
device_data = DeviceData.objects.get(pk=pk)
device_data.data = data
device_data.save_data()
self._write(pk, data)

@cached_property
Expand Down

0 comments on commit 7fca813

Please sign in to comment.