<commit_before>#
# Cookbook Name:: monitor
# Recipe:: _handler_chef_node
#
# Copyright 2013, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

include_recipe 'build-essential::default'

if File.exist?('/etc/chef/client.rb') && File.exist?('/etc/chef/client.pem')

  case node['platform_family']
  when 'debian'
    apt_package 'ruby-dev' do
      action :install
    end
  when 'rhel'
    yum_package 'ruby-devel' do
      action :install
    end
  end

  sensu_gem 'sensu-plugins-chef' do
    version '1.0.0'
  end

  handler_path = '/opt/sensu/embedded/bin/handler-chef-node.rb'

  node.override['monitor']['sudo_commands'] =
    node['monitor']['sudo_commands'] + [handler_path]

  include_recipe 'monitor::_sudo'
<commit_msg>Downgrading from incompatible Sensu (due to ruby 2.4 breaking gems), addendum<commit_after>#
# Cookbook Name:: monitor
# Recipe:: _handler_chef_node
#
# Copyright 2013, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

include_recipe 'build-essential::default'

if File.exist?('/etc/chef/client.rb') && File.exist?('/etc/chef/client.pem')

  sensu_gem 'sensu-plugins-chef' do
    version '1.0.0'
  end

  handler_path = '/opt/sensu/embedded/bin/handler-chef-node.rb'

  node.override['monitor']['sudo_commands'] =
    node['monitor']['sudo_commands'] + [handler_path]

  include_recipe 'monitor::_sudo'

{'fraction_non_alphanumeric': 0.11348122866894197, 'fraction_numerical': 0.010238907849829351, 'mean_word_length': 4.211111111111111, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5423627', 'n_tokens_mistral': 750, 'n_tokens_neox': 710, 'n_words': 239}