<commit_before># Author:: <NAME> (<<EMAIL>>)
# Cookbook Name:: zabbix
# Recipe:: agent_registration
#
# Apache 2.0
#

chef_gem "zabbixapi" do
  action :install
  version "~> 0.5.8"
end

require 'zabbixapi'

zabbixServer = search(:node, "recipes:zabbix\\:\\:server").first
if port_open?(zabbixServer['zabbix']['web']['fqdn'], 80)

  zbx = ZabbixApi.connect(
    :url => "http://#{zabbixServer['zabbix']['web']['fqdn']}/api_jsonrpc.php",
    :user => zabbixServer['zabbix']['web']['login'],
    :password => zabbixServer['zabbix']['web']['password']
  )

  groups_id = []
  node['zabbix']['agent']['groups'].each do |group|
    ruby_block "Create group on Zabbix server" do
      block do
        zbx.hostgroups.create(
          :host => group<commit_msg>resolve FC022<commit_after># Author:: <NAME> (<<EMAIL>>)
# Cookbook Name:: zabbix
# Recipe:: agent_registration
#
# Apache 2.0
#

chef_gem "zabbixapi" do
  action :install
  version "~> 0.5.8"
end

require 'zabbixapi'

zabbixServer = search(:node, "recipes:zabbix\\:\\:server").first
if port_open?(zabbixServer['zabbix']['web']['fqdn'], 80)

  zbx = ZabbixApi.connect(
    :url => "http://#{zabbixServer['zabbix']['web']['fqdn']}/api_jsonrpc.php",
    :user => zabbixServer['zabbix']['web']['login'],
    :password => zabbixServer['zabbix']['web']['password']
  )

  groups_id = []
  node['zabbix']['agent']['groups'].each do |group|
    ruby_block "Create group #{group} on Zabbix server" do
      block do
        zbx.hostgroups.create(
          :host => group
{'fraction_non_alphanumeric': 0.20369149637442321, 'fraction_numerical': 0.01120632827949901, 'mean_word_length': 4.440860215053763, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5190794', 'n_tokens_mistral': 584, 'n_tokens_neox': 563, 'n_words': 103}