source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
lbeder/health-monitor-rails
https://github.com/lbeder/health-monitor-rails
lib/health_monitor/monitor.rb
Ruby
mit
219
master
1,922
# frozen_string_literal: true require 'health_monitor/configuration' module HealthMonitor STATUSES = { ok: 'OK', warning: 'WARNING', error: 'ERROR' }.freeze extend self attr_accessor :configuration def configure self.configuration ||= Configuration.new yield configuration if block_gi...
github
lbeder/health-monitor-rails
https://github.com/lbeder/health-monitor-rails
lib/health_monitor/providers/database.rb
Ruby
mit
219
master
1,728
# frozen_string_literal: true require 'health_monitor/providers/base' module HealthMonitor module Providers class DatabaseException < StandardError; end class Database < Base class Configuration < Base::Configuration DEFAULT_CONFIG_NAME = nil attr_reader :config_name def ini...
github
lbeder/health-monitor-rails
https://github.com/lbeder/health-monitor-rails
lib/health_monitor/providers/sidekiq.rb
Ruby
mit
219
master
3,232
# frozen_string_literal: true require 'health_monitor/providers/base' require 'sidekiq/api' module HealthMonitor module Providers class SidekiqException < StandardError; end class Sidekiq < Base class Configuration < Base::Configuration DEFAULT_QUEUE_NAME = 'default' DEFAULT_LATENCY_T...
github
lbeder/health-monitor-rails
https://github.com/lbeder/health-monitor-rails
lib/health_monitor/providers/cache.rb
Ruby
mit
219
master
684
# frozen_string_literal: true require 'health_monitor/providers/base' module HealthMonitor module Providers class CacheException < StandardError; end class Cache < Base EXPIRED_TIME_SECONDS = 3 def check! time = Time.now.to_formatted_s(:rfc2822) Rails.cache.write(key, time, ex...
github
lbeder/health-monitor-rails
https://github.com/lbeder/health-monitor-rails
lib/health_monitor/providers/redis.rb
Ruby
mit
219
master
2,351
# frozen_string_literal: true require 'health_monitor/providers/base' module HealthMonitor module Providers CONNECTION_POOL_SIZE = 1 class RedisException < StandardError; end class Redis < Base EXPIRED_TIME_SECONDS = 3 class Configuration < Base::Configuration DEFAULT_URL = nil ...
github
lbeder/health-monitor-rails
https://github.com/lbeder/health-monitor-rails
lib/health_monitor/providers/base.rb
Ruby
mit
219
master
790
# frozen_string_literal: true require 'forwardable' module HealthMonitor module Providers class Base extend Forwardable class Configuration attr_accessor :name, :critical def initialize(provider) @name = provider.class.name.demodulize @critical = true en...
github
lbeder/health-monitor-rails
https://github.com/lbeder/health-monitor-rails
lib/health_monitor/providers/delayed_job.rb
Ruby
mit
219
master
989
# frozen_string_literal: true require 'health_monitor/providers/base' require 'delayed_job' module HealthMonitor module Providers class DelayedJobException < StandardError; end class DelayedJob < Base class Configuration < Base::Configuration DEFAULT_QUEUES_SIZE = 100 attr_accessor :...
github
lbeder/health-monitor-rails
https://github.com/lbeder/health-monitor-rails
lib/health_monitor/providers/file_absence.rb
Ruby
mit
219
master
731
# frozen_string_literal: true require 'health_monitor/providers/base' module HealthMonitor module Providers class FileAbsenceException < StandardError; end class FileAbsence < Base class Configuration < Base::Configuration DEFAULT_FILENAME = nil attr_accessor :filename def in...
github
lbeder/health-monitor-rails
https://github.com/lbeder/health-monitor-rails
lib/health_monitor/providers/solr.rb
Ruby
mit
219
master
2,204
# frozen_string_literal: true require 'health_monitor/providers/base' module HealthMonitor module Providers class SolrException < StandardError; end class Solr < Base class Configuration < Base::Configuration DEFAULT_URL = nil DEFAULT_COLLECTION = nil attr_accessor :url, :coll...
github
lbeder/health-monitor-rails
https://github.com/lbeder/health-monitor-rails
lib/health_monitor/providers/resque.rb
Ruby
mit
219
master
341
# frozen_string_literal: true require 'health_monitor/providers/base' require 'resque' module HealthMonitor module Providers class ResqueException < StandardError; end class Resque < Base def check! ::Resque.info rescue Exception => e raise ResqueException.new(e.message) e...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
Berksfile
Ruby
apache-2.0
219
develop
214
source 'https://supermarket.chef.io' metadata group :integration do cookbook "sensu-test", path: "test/cookbooks/sensu-test" end # changes in chef-vault 3.0 have broken our tests cookbook 'chef-vault', '< 3.0'
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
Gemfile
Ruby
apache-2.0
219
develop
694
# This gemfile provides additional gems for testing and releasing this cookbook # It is meant to be installed on top of ChefDK which provides the majority # of the necessary gems for testing this cookbook # # Run 'chef exec bundle install' to install these dependencies source "https://rubygems.org" group :develop do ...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
metadata.rb
Ruby
apache-2.0
219
develop
1,103
name "sensu" maintainer "Heavy Water Operations" maintainer_email "support@sensuapp.com" license "Apache-2.0" description "Installs/Configures Sensu" long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version "6.0.0" # available @ https://supermarket.chef....
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
Guardfile
Ruby
apache-2.0
219
develop
1,288
# A sample Guardfile # More info at https://github.com/guard/guard#readme # guard 'kitchen' do # watch(%r{test/.+}) # watch(%r{^recipes/(.+)\.rb$}) # watch(%r{^attributes/(.+)\.rb$}) # watch(%r{^files/(.+)}) # watch(%r{^templates/(.+)}) # watch(%r{^providers/(.+)\.rb}) # watch(%r{^resources/(.+)\.rb}) # ...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
Rakefile
Ruby
apache-2.0
219
develop
818
#!/usr/bin/env rake task default: [:spec] # stove helps us ship the cookbook begin require 'stove/rake_task' Stove::RakeTask.new rescue LoadError puts '>>>>> Stove gem not loaded, omitting tasks' unless ENV['CI'] end begin require 'foodcritic' FoodCritic::Rake::LintTask.new do |t| t.options = { :tags =...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
providers/plugin.rb
Ruby
apache-2.0
219
develop
677
def manage_sensu_asset(resource_action) attributes = Sensu::Helpers.select_attributes( new_resource, %w[ cookbook source source_directory checksum path mode owner group rights ] ) a = sensu_asset new_resource.name do asset_directory new_resource.asset_directory || ::File.join(node["se...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
providers/json_file.rb
Ruby
apache-2.0
219
develop
1,254
action :create do sensu_service_trigger = !!node.run_context.resource_collection.detect do |r| r.to_s == "ruby_block[sensu_service_trigger]" end directory "create_dir_for_#{new_resource.path}" do path ::File.dirname(new_resource.path) recursive true owner lazy { new_resource.owner || node["sensu"...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
providers/mutator.rb
Ruby
apache-2.0
219
develop
718
def load_current_resource definition_directory = ::File.join(node["sensu"]["directory"], "conf.d", "mutators") @definition_path = ::File.join(definition_directory, "#{new_resource.name}.json") end action :create do mutator = Sensu::Helpers.select_attributes( new_resource, %w[command timeout] ) defin...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
providers/snippet.rb
Ruby
apache-2.0
219
develop
573
def load_current_resource definition_directory = ::File.join(node["sensu"]["directory"], "conf.d") @definition_path = ::File.join(definition_directory, "#{new_resource.name}.json") end action :create do definition = { new_resource.name => new_resource.content } f = sensu_json_file @definition_path do ...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
providers/dashboard_config.rb
Ruby
apache-2.0
219
develop
676
action :create do definitions = Sensu::Helpers.select_attributes( node["sensu"]["enterprise-dashboard"], %w[dashboard sensu] ) data_bag_name = node["sensu"]["enterprise-dashboard"]["data_bag"]["name"] config_item = node["sensu"]["enterprise-dashboard"]["data_bag"]["config_item"] config = Sensu::Help...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
providers/base_config.rb
Ruby
apache-2.0
219
develop
2,498
action :create do definitions = Sensu::Helpers.select_attributes( node["sensu"], %w[transport rabbitmq redis api] ) data_bag_name = node["sensu"]["data_bag"]["name"] config_item = node["sensu"]["data_bag"]["config_item"] config = Sensu::Helpers.data_bag_item(config_item, true, data_bag_name) if c...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
providers/client.rb
Ruby
apache-2.0
219
develop
973
action :create do client_attrs = %w[ name address subscriptions ] # exclude these attributes from being included in client definition # unless they have non-default values %w[ keepalive redact socket registration deregistration ].each do |attr| client_attrs << attr unles...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
providers/service.rb
Ruby
apache-2.0
219
develop
1,050
def sensu_path "/opt/sensu" end def load_current_resource @sensu_svc = run_context.resource_collection.lookup("service[#{new_resource.service}]") rescue nil @sensu_svc ||= service new_resource.service do supports :status => true, :restart => true retries 3 retry_delay 5 action :nothing subscr...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
providers/check.rb
Ruby
apache-2.0
219
develop
1,450
def load_current_resource definition_directory = ::File.join(node["sensu"]["directory"], "conf.d", "checks") @definition_path = ::File.join(definition_directory, "#{new_resource.name}.json") end action :create do if new_resource.type == 'status' Chef::Log.warn("sensu_check[#{new_resource.name}]: type 'statu...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
providers/handler.rb
Ruby
apache-2.0
219
develop
820
def load_current_resource definition_directory = ::File.join(node["sensu"]["directory"], "conf.d", "handlers") @definition_path = ::File.join(definition_directory, "#{new_resource.name}.json") end action :create do handler = Sensu::Helpers.select_attributes( new_resource, %w[ type filters mutator s...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
providers/api_stash.rb
Ruby
apache-2.0
219
develop
1,214
def load_current_resource @current_resource = Chef::Resource::SensuApiStash.new(new_resource.name) @current_resource.api_uri(new_resource.api_uri) api = Sensu::API::Stash.new(@current_resource.api_uri) @current_resource.payload(api.get("/stashes/#{@current_resource.name}")) end action :create do api = Sensu:...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
providers/gem.rb
Ruby
apache-2.0
219
develop
1,037
action :install do g = gem_package new_resource.name do gem_binary Sensu::Helpers.gem_binary version new_resource.version source new_resource.source options new_resource.options package_name new_resource.package_name unless new_resource.package_name.nil? end new_resource.updated_by_last_acti...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
providers/asset.rb
Ruby
apache-2.0
219
develop
1,530
def load_current_resource @owner = new_resource.owner || node["sensu"]["admin_user"] @uri = URI.parse(new_resource.name) asset_directory = case when new_resource.asset_directory new_resource.asset_directory when new_resource.path ::File.dirname(new_resource.path) else ::File.dirname(@uri.path)...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
providers/filter.rb
Ruby
apache-2.0
219
develop
854
def load_current_resource definition_directory = ::File.join(node["sensu"]["directory"], "conf.d", "filters") @definition_path = ::File.join(definition_directory, "#{new_resource.name}.json") end action :create do filter = Sensu::Helpers.select_attributes( new_resource, %w(attributes negate days) ) i...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
recipes/server_service.rb
Ruby
apache-2.0
219
develop
696
# # Cookbook Name:: sensu # Recipe:: server_service # # Copyright 2014, Sonian Inc. # # 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 # # Unle...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
recipes/_linux.rb
Ruby
apache-2.0
219
develop
4,634
# # Cookbook Name:: sensu # Recipe:: _linux # # Copyright 2014, Sonian Inc. # # 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 requi...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
recipes/default.rb
Ruby
apache-2.0
219
develop
3,025
# # Cookbook Name:: sensu # Recipe:: default # # Copyright 2014, Sonian Inc. # # 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 requ...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
recipes/rabbitmq.rb
Ruby
apache-2.0
219
develop
3,483
# # Cookbook Name:: sensu # Recipe:: rabbitmq # # Copyright 2014, Sonian Inc. # # 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 req...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
recipes/_windows.rb
Ruby
apache-2.0
219
develop
2,083
# # Cookbook Name:: sensu # Recipe:: _windows # # Copyright 2014, Sonian Inc. # # 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 req...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
recipes/client_service.rb
Ruby
apache-2.0
219
develop
794
# # Cookbook Name:: sensu # Recipe:: client_service # # Copyright 2014, Sonian Inc. # # 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 # # Unle...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
recipes/enterprise.rb
Ruby
apache-2.0
219
develop
1,077
# # Cookbook Name:: sensu # Recipe:: enterprise # # Copyright 2014, Heavy Water Operations, LLC. # # 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...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
recipes/_aix.rb
Ruby
apache-2.0
219
develop
998
# # Cookbook Name:: sensu # Recipe:: _aix # # Copyright 2016, Heavy Water Operations, LLC. # # 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 #...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
recipes/redis.rb
Ruby
apache-2.0
219
develop
808
# # Cookbook Name:: sensu # Recipe:: redis # # Copyright 2014, Sonian Inc. # # 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 requir...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
recipes/api_service.rb
Ruby
apache-2.0
219
develop
690
# # Cookbook Name:: sensu # Recipe:: api_service # # Copyright 2014, Sonian Inc. # # 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 ...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
recipes/enterprise_service.rb
Ruby
apache-2.0
219
develop
1,053
# # Cookbook Name:: sensu # Recipe:: enterprise_service # # Copyright 2014, Heavy Water Operations, LLC. # # 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...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
recipes/enterprise_dashboard_service.rb
Ruby
apache-2.0
219
develop
911
# # Cookbook Name:: sensu # Recipe:: enterprise_dashboard_service # # Copyright 2014, Heavy Water Operations, LLC. # # 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.or...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
recipes/enterprise_dashboard.rb
Ruby
apache-2.0
219
develop
835
# # Cookbook Name:: sensu # Recipe:: enterprise_dashboard # # Copyright 2014, Heavy Water Operations, LLC. # # 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/licens...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
recipes/_enterprise_repo.rb
Ruby
apache-2.0
219
develop
1,695
data_bag_name = node["sensu"]["data_bag"]["name"] enterprise_item = node["sensu"]["data_bag"]["enterprise_item"] begin unless get_sensu_state(node, "enterprise") enterprise = Sensu::Helpers.data_bag_item(enterprise_item, true, data_bag_name) set_sensu_state(node, "enterprise", enterprise) end rescue => e ...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
libraries/sensu_json_file.rb
Ruby
apache-2.0
219
develop
418
module Sensu class JSONFile class << self def load_json(path) JSON.parse(File.read(path)) rescue Hash.new end def dump_json(raw_hash) JSON.pretty_generate(raw_hash) + "\n" end def to_mash(raw_hash) Mash.from_hash(raw_hash) end def compare_conten...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
libraries/sensu_helpers.rb
Ruby
apache-2.0
219
develop
6,534
require "openssl" module Sensu class Helpers extend ChefVaultCookbook if Kernel.const_defined?("ChefVaultCookbook") class << self def select_attributes(attributes, keys) attributes.to_hash.reject do |key, value| !Array(keys).include?(key.to_s) || value.nil? end end ...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
libraries/sensu_run_state.rb
Ruby
apache-2.0
219
develop
1,896
module Sensu module ChefRunState # Initialize 'sensu' in node.run_state hash # # @param node [Chef::Node] node object to mutate def init_sensu_state(node) node.run_state["sensu"] ||= Mash.new end # Get value at given path # # @param node [Chef::Node] node object to mutate #...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
libraries/sensu_api.rb
Ruby
apache-2.0
219
develop
2,250
require 'uri' require 'net/http' require 'json' module Sensu class API class Stash def initialize(api_uri) @server_uri = URI(api_uri) end def get(path) req = Net::HTTP::Get.new(path) response = Net::HTTP.start(@server_uri.host, @server_uri.port) do |http| http...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
libraries/matchers.rb
Ruby
apache-2.0
219
develop
3,513
if defined?(ChefSpec) def create_sensu_api_stash(name) ChefSpec::Matchers::ResourceMatcher.new(:sensu_api_stash, :create, name) end def delete_sensu_api_stash(name) ChefSpec::Matchers::ResourceMatcher.new(:sensu_api_stash, :delete, name) end def create_sensu_asset(name) ChefSpec::Matchers::Resou...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/unit/common_examples.rb
Ruby
apache-2.0
219
develop
1,446
RSpec.shared_examples 'sensu default recipe' do it "creates the log directory" do expect(chef_run).to create_directory(log_directory).with( :owner => 'sensu', :group => 'sensu', :recursive => true, :mode => "0750" ) end %w[ conf.d plugins handlers extensio...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/unit/client_service_spec.rb
Ruby
apache-2.0
219
develop
875
require_relative "spec_helper" describe "sensu::client_service" do cached(:chef_run) do ChefSpec::SoloRunner.new(:platform => "ubuntu", :version => "14.04").converge(described_recipe) end it "enables the sensu-client service in ubuntu 14.04" do expect(chef_run).to enable_sensu_service("sensu-client") ...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/unit/check_spec.rb
Ruby
apache-2.0
219
develop
2,817
require_relative 'spec_helper' describe 'sensu-test::good_checks' do let(:chef_run) { ChefSpec::SoloRunner.new(:platform => 'ubuntu', :version => '16.04').converge( described_recipe ) } it "creates valid_check_with_default_interval" do expect(chef_run).to create_sensu_check("valid_check_with_d...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/unit/enterprise_repo.rb
Ruby
apache-2.0
219
develop
3,846
require_relative "spec_helper" describe "sensu::_enterprise_repo" do let(:data_bag_item) do { "enterprise" => { "repository" => { "credentials" => { "user" => "chefspec", "password" => "moartests!" } } } } end %w(stable unstable).ea...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/unit/spec_helper.rb
Ruby
apache-2.0
219
develop
535
require 'chefspec' require 'chefspec/berkshelf' RSpec.shared_context('sensu data bags') do let(:ssl_data_bag_item) do # JSON.parse( # File.read(File.join(File.dirname(__FILE__), '../integration/data_bags/sensu/ssl.json')) # ) { 'ssl' => { 'client' => { 'cert' => '', ...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/unit/default_spec.rb
Ruby
apache-2.0
219
develop
4,885
require_relative "spec_helper" require_relative "common_examples" describe "sensu::default" do include_context("sensu data bags") context "when running on unix-like platforms" do let(:sensu_pkg_name) { 'sensu' } let(:sensu_directory) { '/etc/sensu' } let(:log_directory) { '/var/log/sensu' } conte...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/unit/libraries/sensu_helpers_spec.rb
Ruby
apache-2.0
219
develop
7,307
require 'rspec' require 'fauxhai' require_relative '../../../libraries/sensu_helpers.rb' describe Sensu::Helpers do let(:node) { Fauxhai.mock(:platform => 'ubuntu', :version => '14.04').data } let(:unix_omnibus_gem_path) { '/opt/sensu/embedded/bin/gem' } let(:windows_omnibus_gem_path) { 'c:\opt\sensu\embedded\b...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/unit/libraries/sensu_json_file_spec.rb
Ruby
apache-2.0
219
develop
1,914
require 'chefspec' require_relative '../../../libraries/sensu_json_file.rb' describe 'Sensu::JSONFile' do let(:config) do { "client" => { "name" => "test", "address" => "localhost", "subscriptions" => [ "test" ] }, "rabbitmq" => { "host" => "172.16.100.100", "port" => 5671, "vhost" => "/sensu", "use...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/unit/definitions/rabbitmq_credentials.rb
Ruby
apache-2.0
219
develop
796
require_relative "../spec_helper" describe "sensu-test::rabbitmq_credentials" do let(:chef_run) do ChefSpec::ServerRunner.new( :platform => "ubuntu", :version => "16.04" ).converge(described_recipe) end let(:rmq_state_set) do chef_run.node.run_state['sensu']['rabbitmq_credentials']['test...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/unit/lwrps/json_file_spec.rb
Ruby
apache-2.0
219
develop
844
require_relative "../spec_helper" describe 'sensu_json_file' do let(:test_content) { { :lol => "wtfbbq" } } let(:test_directory_mode) { "0755" } let(:chef_run) do ChefSpec::SoloRunner.new( :step_into => ['sensu_json_file'], :file_cache_path => '/tmp', :platform => "ubuntu", :version =...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/unit/lwrps/base_config_spec.rb
Ruby
apache-2.0
219
develop
3,823
require_relative "../spec_helper" require 'json' describe "sensu_base_config" do let(:single_broker_config) do { "host" => "10.0.0.6", "port" => 5671, "vhost" => "/sensu", "user" => "sensu", "password" => "secret", "heartbeat" => 30, "prefetch" => 50, "ssl" => { ...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/unit/lwrps/gem_spec.rb
Ruby
apache-2.0
219
develop
1,696
require_relative "../spec_helper" describe 'sensu_gem' do let(:chef_run) do ChefSpec::SoloRunner.new( :step_into => ['sensu_gem'], :file_cache_path => '/tmp', :platform => 'ubuntu', :version => '14.04' ).converge('sensu-test::gem_lwrp') end it 'defaults to action :install' do ...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/unit/lwrps/client_spec.rb
Ruby
apache-2.0
219
develop
3,424
require_relative '../spec_helper' describe 'sensu_client with minimum required attributes' do let(:chef_run) do ChefSpec::SoloRunner.new( :step_into => %w[sensu_client sensu_json_file], :platform => "ubuntu", :version => "14.04" ).converge('sensu-test::client_lwrp_defaults') end let(:m...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/unit/lwrps/filter_spec.rb
Ruby
apache-2.0
219
develop
2,732
require_relative "../spec_helper" describe 'sensu_filter' do let(:chef_run) do ChefSpec::SoloRunner.new( :step_into => ['sensu_filter'], :file_cache_path => '/tmp', :platform => 'ubuntu', :version => '14.04' ).converge('sensu-test::filter_lwrp') end it 'defaults to action :create...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/cookbooks/sensu-test/metadata.rb
Ruby
apache-2.0
219
develop
407
name "sensu-test" maintainer "Sonian, Inc." maintainer_email "chefs@sonian.net" license "Apache-2.0" description 'Installs sensu stack for cookbook testing' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '0.1.0' depends 'logrotate' dep...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/cookbooks/sensu-test/files/default/check-banner.rb
Ruby
apache-2.0
219
develop
1,757
#!/usr/bin/env ruby # # Check Banner # === # # Connect to a TCP port, read one line, test it against a pattern. # Useful for SSH, ZooKeeper, etc. # # Copyright 2012 Sonian, Inc <chefs@sonian.net> # # Released under the same terms as Sensu (the MIT license); see LICENSE # for details. require 'rubygems' if RUBY_VERSION...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/cookbooks/sensu-test/files/default/plugins/check-dns.rb
Ruby
apache-2.0
219
develop
2,654
#!/usr/bin/env ruby # # Checks DNS resolution # === # # DESCRIPTION: # This plugin checks DNS resolution using `dig`. # Note: if testing reverse DNS with -t PTR option, # results will end with trailing '.' (dot) # # OUTPUT: # plain-text # # PLATFORMS: # linux # bsd # # DEPENDENCIES: # sensu-plugin Ruby ge...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/cookbooks/sensu-test/recipes/filter_lwrp.rb
Ruby
apache-2.0
219
develop
537
sensu_filter 'always' do attributes(:check => { :timestamp => 'eval: true' }) end sensu_filter 'never' do attributes(:check => { :timestamp => 'eval: true' }) negate true end sensu_filter 'daytime' do attributes(:check => { :timestamp => 'eval: true' }) days(:all => [{ :begin => '09:00 AM', :end => '05:00 P...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/cookbooks/sensu-test/recipes/default.rb
Ruby
apache-2.0
219
develop
1,178
# # Cookbook Name:: sensu-test # Recipe:: default # # Copyright 2013, Sonian, Inc. # # 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 # # Unles...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/cookbooks/sensu-test/recipes/client_lwrp.rb
Ruby
apache-2.0
219
develop
469
sensu_client 'lwrp_client' do address '10.0.0.1' subscriptions ['all'] keepalives false keepalive('handler' => 'pagerduty', 'thresholds' => { 'warning' => 40, 'critical' => 60 }) safe_mode true redact ['obscure_api_token_name'] socket('bind' => '0.0.0.0', 'port' => 4040) registration('handler' => 'regis...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/cookbooks/sensu-test/recipes/enterprise.rb
Ruby
apache-2.0
219
develop
1,237
# # Cookbook Name:: sensu-test # Recipe:: enterprise # # Copyright 2014, Heavy Water Operations, LLC. # # 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/LI...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/cookbooks/sensu-test/recipes/run_state_helpers.rb
Ruby
apache-2.0
219
develop
7,755
# # Cookbook Name:: sensu-test # Recipe:: run_state_helpers # # Copyright 2013, Sonian, Inc. # # 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...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/cookbooks/sensu-test/recipes/enterprise_dashboard.rb
Ruby
apache-2.0
219
develop
1,176
# # Cookbook Name:: sensu-test # Recipe:: enterprise_dashboard # # Copyright 2014, Heavy Water Operations, LLC. # # 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/l...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/cookbooks/sensu-test/recipes/asset.rb
Ruby
apache-2.0
219
develop
2,014
# # Cookbook Name:: sensu-test # Recipe:: asset # # Copyright 2013, Sonian, Inc. # # 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 ...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/cookbooks/sensu-test/recipes/gem_lwrp.rb
Ruby
apache-2.0
219
develop
1,225
include_recipe 'build-essential' unless platform?('windows') # specify resource without action for testing default action == :install sensu_gem 'sensu-plugins-sensu' # explicitly specify :install action for additional tests sensu_gem 'sensu-plugins-slack' do action :install end # ensure we pass the specified versi...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/cookbooks/sensu-test/recipes/good_checks.rb
Ruby
apache-2.0
219
develop
607
sensu_check "valid_standalone_check" do interval 20 command 'true' standalone true end sensu_check "valid_pubsub_check" do interval 20 command 'true' subscribers ['all'] end sensu_check "removed_check" do action :delete end # proxy client sensu_check "valid_proxy_client_check" do interval 20 comman...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/integration/run-state-helpers/serverspec/run_state_helpers_spec.rb
Ruby
apache-2.0
219
develop
1,042
require 'serverspec' set :backend, :exec # These fingerprints match the statically defined credentials in # sensu-test::run_state_helpers.rb { '/etc/sensu/ssl/cert.pem' => 'e29124436dec99a0a3126f61a742605d9c3cbf77', '/etc/sensu/ssl/key.pem' => '43caa67add519458b1580dcc3a29b16335d49a15', '/etc/rabbitmq/ssl/cacert...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/integration/enterprise/serverspec/enterprise_spec.rb
Ruby
apache-2.0
219
develop
502
require 'spec_helper' require 'service_dependency_helper' describe file("/etc/default/sensu-enterprise") do it { should exist } its(:content) { should include('/var/cache/sensu-enterprise-nondefault') } end describe file("/var/cache/sensu-enterprise-nondefault") do it { should exist } it { should be_directory...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/integration/helpers/serverspec/service_dependency_helper.rb
Ruby
apache-2.0
219
develop
555
require "serverspec" require "net/http" require "uri" set :backend, :exec set :path, "/bin:/usr/bin:/sbin:/usr/sbin" describe file("/opt/sensu/embedded/bin/ruby") do it { should be_file } it { should be_executable } end describe command("ps aux | grep rabbitmq-server | grep -v grep") do its(:exit_status) { sho...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/integration/helpers/serverspec/spec_helper.rb
Ruby
apache-2.0
219
develop
637
require "net/http" require 'serverspec' require "uri" # h/t to @martinb3 for http://martinb3.io/testkitchen-serverspec-windows/ if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM).nil? set :backend, :exec set :path, "/bin:/usr/bin:/sbin:/usr/sbin:$PATH" else set :backend, :cmd set :os, :family => "wind...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/integration/default/serverspec/check_spec.rb
Ruby
apache-2.0
219
develop
557
require 'spec_helper' require 'serverspec' require 'json' set :backend, :exec unless windows? describe file('/etc/sensu/conf.d/checks/valid_proxy_client_check.json') do it { should be_file } its(:content_as_json) do should include('checks' => include('valid_proxy_client_check' => ...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/integration/default/serverspec/default_spec.rb
Ruby
apache-2.0
219
develop
539
require 'spec_helper' sensu_pkg_name = windows? ? 'Sensu' : 'sensu' sensu_gem_bin = '/opt/sensu/embedded/bin/gem' describe package(sensu_pkg_name) do it { should be_installed } end describe file(File.join(sensu_directory, "config.json")) do its(:content) { should match /"name": "test"/ } its(:content) { shoul...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/integration/encrypted/serverspec/encrypted_spec.rb
Ruby
apache-2.0
219
develop
489
require 'spec_helper' require 'service_dependency_helper' describe service("sensu-server") do it { should be_enabled } it { should be_running } end describe service("sensu-client") do it { should be_enabled } it { should be_running } end describe service("sensu-api") do it { should be_enabled } it { shou...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/integration/runit/serverspec/runit_spec.rb
Ruby
apache-2.0
219
develop
385
require 'spec_helper' require 'service_dependency_helper' describe file("/opt/sensu/sv/sensu-server/supervise/pid") do its(:content) { should match /^[0-9]+$/ } end describe file("/opt/sensu/sv/sensu-client/supervise/pid") do its(:content) { should match /^[0-9]+$/ } end describe file("/opt/sensu/sv/sensu-api/su...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/integration/runit/serverspec/runit_restart_spec.rb
Ruby
apache-2.0
219
develop
475
require 'spec_helper' service = "sensu-client" pid_file = "/opt/sensu/sv/#{service}/supervise/pid" describe file(pid_file) do its(:content) { should match /^[0-9]+$/ } end describe command("cp #{pid_file} /tmp/_pid_file") do its(:exit_status) { should eq 0 } end describe command("/opt/sensu/bin/sensu-ctl #{ser...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/integration/acls/serverspec/acls_spec.rb
Ruby
apache-2.0
219
develop
698
require 'spec_helper' require 'service_dependency_helper' describe service("sensu-server") do it { should be_enabled } it { should be_running } end describe service("sensu-client") do it { should be_enabled } it { should be_running } end describe service("sensu-api") do it { should be_enabled } it { shou...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/integration/vault/serverspec/encrypted_spec.rb
Ruby
apache-2.0
219
develop
437
require 'spec_helper' require 'service_dependency_helper' describe service("sensu-server") do it { should be_enabled } it { should be_running } end describe service("sensu-client") do it { should be_enabled } it { should be_running } end describe service("sensu-api") do it { should be_enabled } it { shou...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/integration/asset/serverspec/asset_spec.rb
Ruby
apache-2.0
219
develop
936
require 'spec_helper' %w[ check-http.rb check-haproxy.rb check-banner.rb check-socket.rb check-dns.rb ].each do |plugin| describe file(File.join(sensu_directory, "plugins", plugin)) do it { should be_file } it { should be_mode 755 } unless windows? it { should be_owned_by "root" } it { shou...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
test/integration/stack/serverspec/stack_spec.rb
Ruby
apache-2.0
219
develop
340
require 'spec_helper' require 'service_dependency_helper' describe service("sensu-server") do it { should be_enabled } it { should be_running } end describe service("sensu-client") do it { should be_enabled } it { should be_running } end describe service("sensu-api") do it { should be_enabled } it { shou...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
spec/spec_helper.rb
Ruby
apache-2.0
219
develop
385
require 'chefspec' require 'chefspec/berkshelf' class RSpecHelper class<<self attr_accessor :current_example end def self.reset! @current_example = nil end end RSpec.configure do |config| config.filter_run focus: true config.run_all_when_everything_filtered = true config.before :each do RSp...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
spec/sensu-chef/_linux_spec.rb
Ruby
apache-2.0
219
develop
2,928
require 'spec_helper' describe 'sensu::_linux' do # Test all the versions available in fauxhai # https://github.com/chefspec/fauxhai/tree/master/lib/fauxhai/platforms/amazon context 'amazon_linux_2' do let(:solo) do ChefSpec::SoloRunner.new(platform: 'amazon', version: '2...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
examples/ssl/generate_databag.rb
Ruby
apache-2.0
219
develop
612
#!/usr/bin/env ruby require 'rubygems' require 'json' def process_pem(filename) output = "" File.open(filename).each_line do |line| output << line end output end content = { :id => "ssl", :server => { :key => process_pem("server/key.pem"), :cert => process_pem("server/cert.pem"), :cacert ...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
resources/api_stash.rb
Ruby
apache-2.0
219
develop
236
actions :create, :delete default_action :create attribute :api_uri, :kind_of => String, :required => true attribute :payload, :kind_of => [Hash, FalseClass], :default => Hash.new attribute :expire, :kind_of => Integer, :default => nil
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
resources/plugin.rb
Ruby
apache-2.0
219
develop
635
actions :create, :create_if_missing, :delete default_action :create attribute :asset_directory, :kind_of => String attribute :cookbook, :kind_of => String attribute :source, :kind_of => String, :name_attribute => true attribute :source_directory, :kind_of => String attribute :checksum, ...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
resources/service.rb
Ruby
apache-2.0
219
develop
229
actions :enable, :disable, :start, :stop, :restart default_action :enable attribute :service, :name_attribute => true, :kind_of => String, :required => true, :equal_to => %w[sensu-server sensu-client sensu-api sensu-enterprise]
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
resources/client.rb
Ruby
apache-2.0
219
develop
883
actions :create default_action :create attribute :address, :kind_of => String, :required => true attribute :subscriptions, :kind_of => Array, :default => [] attribute :keepalive, :kind_of => Hash, :default => {} attribute :keepalives, :kind_of => [TrueClass, FalseClass], :default => true attribute :safe_mode, :kind_of...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
resources/handler.rb
Ruby
apache-2.0
219
develop
498
actions :create, :delete default_action :create attribute :type, :kind_of => String, :equal_to => %w[set pipe tcp udp transport] attribute :filters, :kind_of => Array attribute :mutator, :kind_of => String attribute :severities, :kind_of => Array attribute :handlers, :kind_of => Array attribute :command, :kind_of => S...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
resources/json_file.rb
Ruby
apache-2.0
219
develop
329
actions :create, :delete default_action :create attribute :path, :name_attribute => true # owner and group attributes have defaults set in the provider attribute :owner, :kind_of => String attribute :group, :kind_of => String attribute :mode, :kind_of => [String, Integer], :default => 0640 attribute :content, :kind_of...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
resources/gem.rb
Ruby
apache-2.0
219
develop
259
actions :install, :upgrade, :remove default_action :install attribute :version, :kind_of => String attribute :source, :kind_of => String attribute :options, :kind_of => [String, Hash] attribute :package_name, :kind_of => [String, NilClass], :default => nil
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
resources/check.rb
Ruby
apache-2.0
219
develop
1,973
actions :create, :delete default_action :create # 'standard' and 'status' types are synonymous attribute :additional, :kind_of => Hash, :default => Hash.new attribute :command, :kind_of => String, :required => true attribute :aggregate, :kind_of => [String, TrueClass, FalseClass] attribute :aggregates, :kind_of => Arr...
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
attributes/enterprise_dashboard.rb
Ruby
apache-2.0
219
develop
955
# Due to a packaging error, debian versions are prefixed with an epoch, i.e. # "1:", which is not present on the rpm packages. As a result, we use the # platform_family to determine correct default version. # default["sensu"]["enterprise-dashboard"]["version"] = node['platform_family'] == 'debian' ? "1:2.3.0-1" : "2.3....
github
sensu/sensu-chef
https://github.com/sensu/sensu-chef
attributes/enterprise.rb
Ruby
apache-2.0
219
develop
552
# installation default["sensu"]["enterprise"]["repo_protocol"] = "http" default["sensu"]["enterprise"]["repo_host"] = "enterprise.sensuapp.com" default["sensu"]["enterprise"]["version"] = "2.5.1-1" default["sensu"]["enterprise"]["use_unstable_repo"] = false default["sensu"]["enterprise"]["log_level"] = "info" default["...