[ZBX-7404] Zabbix API configuration.export is broken on node based setups Created: 2013 Nov 19 Updated: 2017 May 30 Resolved: 2014 May 10 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | API (A), Frontend (F) |
Affects Version/s: | 2.0.9 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Major |
Reporter: | Marc Schoechlin | Assignee: | Unassigned |
Resolution: | Won't fix | Votes: | 0 |
Labels: | api, distributed, frontend | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Zabbix 2.0.9 |
Attachments: |
![]() |
Description |
We are using the zabbix api to create xml backups of our zabbix templates. How to reproduce the problem: We wrote the following ruby code to backup the templates: #!/usr/bin/ruby # # sudo apt-get install ruby-dev ruby # gem install --user-install zabbixapi" # gem install --user-install inifile # gem install --user-install json # gem install --user-install rexml/document # gem install --user-install highline require "zabbixapi" require "inifile" require 'json' require "rexml/document" require "highline/import" def gatherTemplates(zbx, nodeid) templates = zbx.query( :method => "template.get", :params => { :output => :extend, :nodeids => nodeid, } ) for template in templates do #puts JSON.pretty_generate(template) printf "Filename : '%s/%s'\n", Dir.pwd(), template["host"]+".xml" template_xml = zbx.query( :method => "configuration.export", :params => { :options => { :templates => [ template["templateid"] ], }, :format => 'xml', }, ) #puts template_xml xml=REXML::Document.new(template_xml); formatter = REXML::Formatters::Pretty.new formatter.compact = true formatter.width = 1000000 File.open(template["host"]+".xml","w"){|file| file.puts formatter.write(xml.root,"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")} #exit 1 end end zbx = ZabbixApi.connect( :url => inifile['global']["url"], :user => inifile['global']["user"], :password => inifile['global']["password"], :http_user => inifile['global']["user"], :http_password => inifile['global']["password"], ) gatherTemplates(zbx, "1") gatherTemplates(zbx, "2") |
Comments |
Comment by richlv [ 2013 Nov 19 ] |
likely to be a dupe of |
Comment by Marc Schoechlin [ 2013 Nov 19 ] |
Yes, i do not think that this is exactly the same problem, but it seems that this problems is related/the same class of problem. |
Comment by richlv [ 2014 May 10 ] |
with node based distributed monitoring being removed for 2.4, this is unlikely to get looked into for earlier versions |