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
/* | |
* Somewhere in their bootstrap code, index.php or wherever, we'd register a shutdown | |
* callback that is executed when PHP completes serving the request (whether successfully, | |
* or in the event of a fatal error. | |
*/ | |
register_shutdown_function('requestShutdown'); | |
function requestShutdown() { | |
$error = error_get_last(); |
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
nssm_service "chef-client" do | |
application "C:/opscode/chef/embedded/bin/ruby.exe" | |
options "C:/opscode/chef/bin/chef-client -C C:/chef/client.rb -i 1800 -s 120" | |
end | |
service "chef-client" do | |
action :nothing | |
only_if { WMI::Win32_Service.find(:all).collect{|s| s.name}.include?("chef-client") } | |
end |
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
source 'http://rubygems.org' | |
gem 'rails', '3.2.9' | |
gem 'sqlite3' | |
# Use unicorn as the web server | |
# gem 'unicorn' | |
# Deploy with Capistrano | |
# gem 'capistrano' |
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
#!/bin/bash | |
outdir=$1 | |
if [ -z "${outdir}" ]; then | |
outdir=/tmp/ | |
fi | |
cd ${outdir} | |
openssl genrsa -out pk-amazon.pem 2048 |
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
59 current_account = '' | |
60 case line | |
61 when /^\[(.*)\]$/ | |
62 account_name = (line.match(/^\[(.*)\]$/).captures)[0] | |
63 p 'account_name = ' + account_name | |
64 current_account = account_name | |
65 p 'current_account = ' + current_account | |
66 @accounts[current_account] = {} unless @accounts.has_key? current_account | |
67 when /^aws_access_key_id=.*$/ | |
68 aws_access_key_id = (line.match(/^aws_access_key_id=(.*)$/).captures)[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
1. Installed using auto deploy tool | |
2. Stopped Zenoss | |
3. touch /opt/zenoss/etc/DAEMONS_TXT_ONLY | |
4. Create /opt/zenoss/etc/daemons.txt with: | |
zenping | |
zensyslog | |
zenstatus | |
zentrap | |
zenmodeler | |
zenrender |
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 python | |
import pprint | |
import Globals | |
from Products.ZenUtils.ZenScriptBase import ZenScriptBase | |
from transaction import commit | |
dmd = ZenScriptBase(connect=True).dmd | |
find = dmd.Devices.findDevice |
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 python | |
import pprint | |
import dns.resolver | |
hostname = "hostname here" | |
resolver = dns.resolver.Resolver() | |
resolved_ip_list = [] | |
answers = resolver.query(hostname, 'A') | |
for rdata in answers: |
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
factory_type_information = ( | |
{ | |
'immediate_view' : 'editHttpResolvingMonitorDataSource', | |
'actions' : | |
( | |
{ 'id' : 'edit', | |
'name' : 'Data Source', | |
'action' : 'editHttpResolvingMonitorDataSource', | |
'permissions' : ( Permissions.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
/usr/local/zenoss/common/libexec/check_http_by_hostname.py -H www.some_host_that_resolves.com -p 80 -t 60 -u / -f follow | |
Exit status is 1 which I had expected to raise an event, with the stdout of the command being the event message | |
zencommand run -d <device> -v10 | |
... | |
2013-02-14 11:44:36,515 DEBUG zen.zencommand: running '/usr/local/zenoss/common/libexec/check_http_by_hostname.py -H www.some_host_that_resolves.com -p 80 -t 60 -u / -f follow' | |
2013-02-14 11:44:36,515 DEBUG zen.zencommand: cmd line: '/bin/sh -c exec /usr/local/zenoss/common/libexec/check_http_by_hostname.py -H www.some_host_that_resolves.com -p 80 -t 60 -u / -f follow' | |
2013-02-14 11:44:36,540 DEBUG zen.zencommand: Process check_http_by_hostname.py -H www.some_host_that_resolves.com -p 80 -t 60 -u / -f follow started | |
2013-02-14 11:45:08,918 DEBUG zen.zencommand: Received exit code: 1 | |
2013-02-14 11:45:08,918 DEBUG zen.zencommand: Command: '/bin/sh -c exec /usr/local/zenoss/common/libexec/check_http_by_hostname.py -H www.some_host_that_resolves.c |