Skip to content

Instantly share code, notes, and snippets.

@ccooke
Created October 21, 2016 10:52
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ccooke/4091eea6db0acdcfcefadd631c0e9397 to your computer and use it in GitHub Desktop.
Save ccooke/4091eea6db0acdcfcefadd631c0e9397 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
# THIS FILE IS MANAGED BY PUPPET
require 'zbxapi'
require 'pp'
zbx = ZabbixAPI.new('http://localhost/zabbix/api_jsonrpc.php', verify_ssl: false, http_timeout: 300)
zbx.login('<%= @admin_user %>', '<%= @admin_password %>')
hostname = ARGV.first
hosts = zbx.host.get filter: { host: hostname }
hosts.each do |host|
zbx.host.update hostid: host['hostid'], tls_accept: 4, tls_connect: 4
end
@twilliamsH
Copy link

Would it be possible to give a real brief step by step where to put this and how to set it up for those quite new to Zabbix and not terribly familiar with Linux servers? I tried to follow your explanation here but its not working and I have no idea where the problem is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment