Skip to content

Commit

Permalink
1.8 screen create fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjiskywalker committed Feb 3, 2013
1 parent 7654cea commit 0edc753
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions lib/zabbixapi/1.8/classes/screens.rb
Expand Up @@ -52,13 +52,17 @@ def delete(data)
end

def get_or_create_for_host(data)
screen_name = data[:host].to_s + "_graphs"
screen_name = data[:screen_name]
graphids = data[:graphids]
screenitems = []
hsize = data[:hsize] || 3
valign = data[:valign] || 2
halign = data[:halign] || 2
vsize = data[:vsize] || ((graphids.size/hsize) + 1).to_i
rowspan = data[:rowspan] || 0
colspan = data[:colspan] || 0
height = data[:height] || 320 # default 320
width = data[:width] || 200 # default 200
vsize = data[:vsize] || (graphids.size/hsize).to_i
screenid = get_id(:name => screen_name)
unless screenid
# Create screen
Expand All @@ -68,8 +72,12 @@ def get_or_create_for_host(data)
:resourceid => graphid,
:x => (index % hsize).to_i,
:y => (index % graphids.size/hsize).to_i,
:valign =>valign,
:halign =>halign
:valign => valign,
:halign => halign,
:rowspan => rowspan,
:colspan => colspan,
:height => height,
:width => width
}
end
screenid = create(
Expand Down

0 comments on commit 0edc753

Please sign in to comment.