<commit_before>#<
# Installs cron job and mysql account to poll mysql
#>

sensu = Chef::EncryptedDataBagItem.load('passwords', 'mysql')['sensu']

template '/root/.mysql.sensu.ini' do
  action :create
  source 'mysql_ini.erb'
  owner 'root'
  group 'root'
  mode '0600'
  variables(sensu)
  sensitive true
  only_if { sensu }
end

cron 'poll_mysql-graphite.rb' do
  action :create
  command '/opt/logstash/agent/bin/sensu_metrics.sh mysql/mysql-graphite -h 127.0.0.1 -i /root/.mysql.sensu.ini'
  user 'root'
  minute '*'
end<commit_msg>Bug fix in mysql metrics<commit_after>#<
# Installs cron job and mysql account to poll mysql
#>

sensu = Chef::EncryptedDataBagItem.load('passwords', 'mysql')['sensu']

template '/root/.mysql.sensu.ini' do
  action :create
  source 'mysql_ini.erb'
  owner 'root'
  group 'root'
  mode '0600'
  variables(sensu)
  sensitive true
  only_if { sensu }
end

cron 'poll_mysql-graphite.rb' do
  action :create
  command '/opt/logstash/agent/bin/sensu_metrics.sh mysql/mysql-graphite.rb -h 127.0.0.1 -i /root/.mysql.sensu.ini'
  user 'root'
  minute '*'
end
{'fraction_non_alphanumeric': 0.13745387453874539, 'fraction_numerical': 0.01845018450184502, 'mean_word_length': 3.9318181818181817, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '867784', 'n_tokens_mistral': 438, 'n_tokens_neox': 408, 'n_words': 99}