Sha256: 22fe6df2b79fada49794425e587ae570f1d529d84b1284763c7cc39fecce7fd6
Contents?: true
Size: 724 Bytes
Versions: 5
Compression:
Stored size: 724 Bytes
Contents
#!/usr/bin/env ruby require 'rubygems' require 'getopt/std' require 'yaml' require 'zabbixapi' opt = Getopt::Std.getopts("g:E:") group_name = opt["g"] zabbix_env = opt["E"] template_name = "TMPL_Availability" # read config config = YAML::load(open('./config.yml')) api_url = config[zabbix_env]["api_url"] api_login = config[zabbix_env]["api_login"] api_password = config[zabbix_env]["api_password"] # Esablish new connection zbx = Zabbix::ZabbixApi.new(api_url, api_login, api_password) defaults = zbx.get_templates() p " * Delete all template ^Template_." defaults.each do |template| if template[1].match('^Template_') p " ** Delete template #{template[1]}" zbx.delete_template(template[1]) end end
Version data entries
5 entries across 5 versions & 1 rubygems