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
gcp-compliance ➤ cat controls/example.rb | |
describe google_compute_instance(project: 'my-proj', zone: 'us-east1-b', name: 'inspec-test') do | |
it { should exist } | |
its('name') { should eq 'inspec-test' } | |
its('machine_type') { should eq 'f1-micro' } | |
its('cpu_platform') { should match 'Intel' } | |
its('status') { should eq 'RUNNING' } | |
end | |
gcp-compliance ➤ cat inspec.yml |
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
[greg@hop ~]$ ssh eventmq01 sudo /usr/sbin/rabbitmqctl cluster_status | |
Cluster status of node rabbit@eventmq01 ... | |
[{nodes,[{disc,[rabbit@eventmq01]},{ram,[rabbit@eventmq02]}]}, | |
{running_nodes,[rabbit@eventmq02,rabbit@eventmq01]}, | |
{partitions,[]}] | |
...done. | |
[greg@hop ~]$ ssh eventmq02 sudo /usr/sbin/rabbitmqctl cluster_status | |
Cluster status of node rabbit@eventmq02 ... | |
[{nodes,[{disc,[rabbit@eventmq01]},{ram,[rabbit@eventmq02]}]}, | |
{running_nodes,[rabbit@eventmq01,rabbit@eventmq02]}, |
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
{"version"=>"0.9.8-1", "rabbitmq"=>{"host"=>"sensu.XXXXXX.com", "port"=>5671, "ssl"=>{"cert_chain_file"=>"/etc/sensu/ssl/cert.pem", "private_key_file"=>"/etc/sensu/ssl/key.pem"}, "vhost"=>"/sensu", "user"=>"sensu", "password"=>"XXXX", "heartbeat"=>20}, "redis"=>{"host"=>"localhost", "port"=>6379}, "api"=>{"host"=>"localhost", "port"=>4567}, "dashboard"=>{"host"=>"localhost", "port"=>8080, "user"=>"admin", "password"=>"XXXX"}, "client"=>{"name"=>"sensu.XXXX.com", "address"=>"10.X.XX.21", "subscriptions"=>["Base", "Redis", "SensuServer"]}, "checks"=>{"chef_client"=>{"notification"=>"Chef client daemon is not running.", "interval"=>60, "custom_attribute_here"=>"value", "subscribers"=>["sensu_client", "Base"], "command"=>"/etc/sensu/plugins/check-procs.rb -p chef-client -W 1 -w 2 -c 3"}, "disk_usage"=>{"notification"=>"Disk usage is too high.", "interval"=>60, "subscribers"=>["Base"], "command"=>"/etc/sensu/plugins/check-disk.rb -w 90 -c 95 -x nfs,tmpfs,fuse -i /boot,/mnt/data_imports"}, "redis_memory"=>{"notific |
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
[root@sensu handlers]# cat /tmp/data | /etc/sensu/handlers/mailer.rb | |
Loading precompiled parsers from ruby source | |
/etc/sensu/handlers/mailer.rb:27:in `handle': undefined method `[]' for nil:NilClass (NoMethodError) | |
from /opt/sensu/embedded/lib/ruby/gems/1.9.1/gems/sensu-plugin-0.1.5/lib/sensu-handler.rb:41:in `block in <class:Handler>' |
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
[root@sensu handlers]# more mailer.json | |
{ | |
"mailer": { | |
"mail_from": "sensu@XXX.com", | |
"mail_to": "greg@XXXX.com", | |
"smtp_address": "localhost", | |
"smtp_port": "25", | |
"smtp_domain": "XXXX.com" | |
} | |
} |
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
{ | |
"version": "0.9.8-1", | |
"rabbitmq": { | |
"host": "sensu.XXXX.com", | |
"port": 5671, | |
"ssl": { | |
"cert_chain_file": "/etc/sensu/ssl/cert.pem", | |
"private_key_file": "/etc/sensu/ssl/key.pem" | |
}, | |
"vhost": "/sensu", |
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
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab: | |
# Author: Avishai Ish-Shalom <avishai@fewbytes.com> | |
# We need to specify GNU sed for OS X, BSDs, etc. | |
if [[ "$(uname -s)" == "Darwin" ]]; then | |
SED=gsed | |
else | |
SED=sed | |
fi |