Skip to content

Commit

Permalink
Merge pull request #36 from AlmZ/patch-1
Browse files Browse the repository at this point in the history
Changed the way to get a host_id
  • Loading branch information
ikurochkin authored Jun 8, 2017
2 parents 9b902a4 + 675a87a commit e3f5ec7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions providers/connect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,16 @@ def get_item_id(key, host_id)

def create_screens
get_hosts do |host|
_, values = host['zabbix']['hosts'].to_a.first
host_id = values['host_id']
fqdn, values = host['zabbix']['hosts'].to_a.first
host_id = @@zbx.query(
method: 'host.get',
params: {
filter: {
host: fqdn,
},
selectInterfaces: 'extend',
}
).first['hostid']

(values['screens'] || []).each do |screen_name, screen_data|
screen = @@zbx.query(
Expand Down

0 comments on commit e3f5ec7

Please sign in to comment.