def import_services
results = Icinga2Client.get('/objects/services?attrs=name&attrs=last_check_result&attrs=acknowledgement&attrs=host_name')
results = JSON.parse(results)
results['results'].each do |result|
parsed = {
host: result['attrs']['host_name'],
service: 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