Created
October 21, 2016 10:52
-
-
Save ccooke/4091eea6db0acdcfcefadd631c0e9397 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.