<commit_before>#
# Cookbook Name:: sa_monitoring
# Recipe:: default
#
# Copyright 2011, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#

gem_package "sa-monitoring" do
  version node.sa_monitoring.version
end

directory "/etc/sa-monitoring"

remote_directory "/etc/sa-monitoring/plugins" do
  files_mode 0755
end

file "/etc/sa-monitoring/config.json" do
  content SAM.generate_config(node, data_bag_item("sa_monitoring", "config"))
  mode 0644
end

%w{server api client}.each do |service|
  template "/etc/init/sa-monitoring-#{service}.conf" do
    source "upstart.erb"
    variables :service => service
    mode 0644
  end
end

%w{
  nagios-plugins
  nagios-plugins-basic
  nagios-plugins-standard
}.each do |pkg|
  package pkg
end<commit_msg>ssl data bag<commit_after>#
# Cookbook Name:: sa_monitoring
# Recipe:: default
#
# Copyright 2011, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#

gem_package "sa-monitoring" do
  version node.sa_monitoring.version
end

directory "/etc/sa-monitoring/"

remote_directory "/etc/sa-monitoring/plugins" do
  files_mode 0755
end

directory "/etc/sa-monitoring/ssl"

ssl = data_bag_item("sa_monitoring", "ssl")

%w{
  cert
  key
}.each do |file|
  file "/etc/sa-monitoring/ssl/#{file}.key" do
    content ssl[file]
    mode 0644
  end
end

file "/etc/sa-monitoring/config.json" do
  content SAM.generate_config(node, data_bag_item("sa_monitoring", "config"))
  mode 0644
end

%w{
  server
  api
  client
}.each do |service|
  template "/etc/init/sa-monitoring-#{service}.conf" do
    source "upstart.erb"
    variables :service => service
    mode 0644
  end
end

%w{
  nagios-plugins
  nagios-plugins-basic
  nagios-plugins-standard
}.each do |pkg|
  package pkg
end
{'fraction_non_alphanumeric': 0.11703958691910499, 'fraction_numerical': 0.020654044750430294, 'mean_word_length': 3.997134670487106, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7577766', 'n_tokens_mistral': 651, 'n_tokens_neox': 625, 'n_words': 155}