# File lib/smart_proxy_monitoring_icinga2/icinga2_initial_importer.rb, line 33 def import_hosts results = Icinga2Client.get('/objects/hosts?attrs=name&attrs=last_check_result&attrs=acknowledgement') results = JSON.parse(results) results['results'].each do |result| parsed = { host: result['attrs']['name'], result: result['attrs']['last_check_result']['state'], timestamp: result['attrs']['last_check_result']['schedule_end'], acknowledged: (result['attrs']['acknowledgement'] != 0), initial: true, type: '_parsed' } @queue.push(parsed) end end