This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default['MY_CUSTOM_NAMESPACE']['sensu']['checks']['some_portal_monitoring']['command'] = "check-http.rb -u #{node['MY_CUSTOM_NAMESPACE']['sensu']['monitoring']['SOME_portal_monitoring']['url']} -q SOME_STRING" | |
default['MY_CUSTOM_NAMESPACE']['sensu']['checks']['some_portal_monitoring']['handlers'] = ['pagerduty'] | |
default['MY_CUSTOM_NAMESPACE']['sensu']['checks']['some_portal_monitoring']['subscribers'] = ['MY_SUBSCRIPTION'] | |
default['MY_CUSTOM_NAMESPACE']['sensu']['checks']['some_portal_monitoring']['interval'] = 30 | |
default['MY_CUSTOM_NAMESPACE']['sensu']['checks']['some_portal_monitoring']['additional'] = { | |
'pager_team' => 'urgent', | |
'notification' => 'Some_PORTAL is not reachable', | |
'occurrences' => 4, | |
'runbook' => 'https://docs.google.com/document/d/<REDACTED>' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ knife cookbook cleanup --versions 5 --yes | |
The following cookbook versions will remain on the chef server: | |
7-zip: 1.0.2 | |
ant: | |
1.0.2 | |
1.0.3 | |
apache2: | |
3.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
require 'sensu-plugin/check/cli' | |
require 'active_support/all' | |
require 'json' | |
dir_to_check = Dir.glob('/tmp/testdir/*') | |
# Dir always returns an empty list even if the dir does not even exist | |
if dir_to_check.empty? | |
p 'this is an empty dir, does not exist, or have permissions to view' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# non-converge checks | |
default['MY_CUSTOM_NAMESPACE']['sensu']['checks']['chef_client']['command'] = "check-chef-nodes.rb -U #{Chef::Config[:chef_server_url]} -C :::chef.client.node|#{node.name}::: -K /etc/sensu/conf.d/chef-client.pem -t 1800" | |
default['MY_CUSTOM_NAMESPACE']['sensu']['checks']['chef_client']['handlers'] = ['pagerduty'] | |
default['MY_CUSTOM_NAMESPACE']['sensu']['checks']['chef_client']['subscribers'] = ['chef_server'] | |
default['MY_CUSTOM_NAMESPACE']['sensu']['checks']['chef_client']['interval'] = 60 | |
default['MY_CUSTOM_NAMESPACE']['sensu']['checks']['chef_client']['additional'] = { | |
'pager_team' => 'non_urgent', | |
'notification' => 'A chef client is not converging', | |
'occurrences' => 2, | |
'subdue' => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file needs to be named mkrf_conf.rb | |
# so that rubygems will recognize it as a ruby extension | |
# file and not think it is a C extension file | |
require 'rubygems/dependency_installer.rb' | |
# Load up the rubygem's dependency installer to | |
# installer the gems we want based on the version | |
# of Ruby the user has installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listing installed packages: | |
acl install | |
adduser install | |
apt install | |
base-files install | |
base-passwd install | |
bash install | |
binutils install | |
bsdutils install | |
build-essential install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get into a debian container | |
$ docker run -it debian:jessie /bin/bash | |
Unable to find image 'debian:jessie' locally | |
jessie: Pulling from library/debian | |
Digest: sha256:476959f29a17423a24a17716e058352ff6fbf13d8389e4a561c8ccc758245937 | |
Status: Downloaded newer image for debian:jessie | |
# install some pre-reqs | |
root@62b7a91a1fd8:/# apt-get update | |
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# same docker setup with installing deps first | |
$ docker run -it anroots/sensu-client /bin/bash | |
# install deps | |
root@8614d21723f2:/# apt-get update | |
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB] | |
Ign http://httpredir.debian.org jessie InRelease | |
Get:2 http://httpredir.debian.org jessie-updates InRelease [145 kB] | |
Get:3 http://security.debian.org jessie/updates/main amd64 Packages [510 kB] | |
Get:4 http://httpredir.debian.org jessie Release.gpg [2373 B] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run a docker image and shell in | |
$ docker run -it anroots/sensu-client /bin/bash | |
Unable to find image 'anroots/sensu-client:latest' locally | |
latest: Pulling from anroots/sensu-client | |
fdd5d7827f33: Pull complete | |
a3ed95caeb02: Pull complete | |
a050c2b80c6b: Pull complete | |
f4beaf51b556: Pull complete | |
992c0cff1787: Pull complete | |
a3a48c2b3aa6: Pull complete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in the repo root we checkout latest released version | |
$ git checkout 0.0.3 | |
Note: checking out '0.0.3'. | |
You are in 'detached HEAD' state. You can look around, make experimental | |
changes and commit them, and you can discard any commits you make in this | |
state without impacting any branches by performing another checkout. | |
If you want to create a new branch to retain commits you create, you may | |
do so (now or later) by using -b with the checkout command again. Example: |