Skip to content

Instantly share code, notes, and snippets.

2011-02-10_23:55:26.74852 sh: Syntax error: "(" unexpected
2011-02-10_23:55:26.75520 sh: Syntax error: "(" unexpected
2011-02-10_23:55:26.77078 sh: Syntax error: "(" unexpected
2011-02-10_23:55:26.78066 sh: Syntax error: "(" unexpected
2011-02-10_23:55:26.78552 sh: Syntax error: "(" unexpected
2011-02-10_23:55:26.79013 sh: Syntax error: "(" unexpected
2011-02-10_23:55:26.79475 sh: Syntax error: "(" unexpected
2011-02-10_23:55:26.81420 sh: Syntax error: "(" unexpected
2011-02-10_23:55:26.85343 sh: Syntax error: "(" unexpected
2011-02-10_23:55:26.85928 sh: Syntax error: "(" unexpected
[Thu, 10 Feb 2011 13:51:41 -0800] WARN: *****************************************
[Thu, 10 Feb 2011 13:51:41 -0800] WARN: Can not find config file: /etc/chef/client.rb, using defaults.
[Thu, 10 Feb 2011 13:51:41 -0800] WARN: undefined method `[]' for nil:NilClass
[Thu, 10 Feb 2011 13:51:41 -0800] WARN: *****************************************
[Thu, 10 Feb 2011 13:51:43 -0800] INFO: Client key /etc/chef/client.pem is not present - registering
[Thu, 10 Feb 2011 13:51:43 -0800] FATAL: Failed to read the private key /etc/chef/validation.pem: #<Errno::ENOENT: No such file or directory - /etc/chef/validation.pem>, /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/rest/auth_credentials.rb:59:in `read'/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/rest/auth_credentials.rb:59:in `load_signing_key'/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/rest/auth_credentials.rb:33:in `initialize'/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/..
2011-02-10_21:12:17.81813 sh: Syntax error: "(" unexpected
2011-02-10_21:12:17.82319 sh: Syntax error: "(" unexpected
2011-02-10_21:12:17.82999 sh: Syntax error: "(" unexpected
2011-02-10_21:12:17.85169 sh: Syntax error: "(" unexpected
2011-02-10_21:12:17.88475 sh: Syntax error: "(" unexpected
2011-02-10_21:12:17.89229 sh: Syntax error: "(" unexpected
2011-02-10_21:12:17.89786 sh: Syntax error: "(" unexpected
2011-02-10_21:12:17.90354 sh: Syntax error: "(" unexpected
2011-02-10_21:12:17.90969 sh: Syntax error: "(" unexpected
2011-02-10_21:12:17.91580 sh: Syntax error: "(" unexpected
#!/opt/ruby-enterprise/bin/ruby
# Chef Client Config File
# Automatically grabs configuration from ohai ec2 metadata.
require 'ohai'
require 'json'
o = Ohai::System.new
o.all_plugins
chef_config = JSON.parse(o[:ec2][:userdata])
#!/bin/sh
PATH=/opt/ruby-enterprise/lib/ruby/gems/1.8/bin:/opt/ruby-enterprise/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
exec 2>&1
exec /usr/bin/env chef-client -i 1800 -s 20
# Chef Client Config File
# Automatically grabs configuration from ohai ec2 metadata.
require 'ohai'
require 'json'
o = Ohai::System.new
o.all_plugins
chef_config = JSON.parse(o[:ec2][:userdata])
if chef_config.kind_of?(Array)
#source code is from: http://community.nagios.org/2010/10/06/quick-ruby-class-for-writing-nagios-plugins/
# by Aaron Brown
class NagiosCheck
OK,WARN,CRIT,UNKNOWN = 0,1,2,3
OK_STR = "OK"
WARN_STR = "WARNING"
CRIT_STR = "CRITICAL"
UNKNOWN_STR = "UNKNOWN"
attr_reader :exit_code
[Thu, 07 Oct 2010 15:48:21 -0700] INFO: Starting Chef Run
[Thu, 07 Oct 2010 15:48:44 -0700] INFO: Storing updated cookbooks/configure-site/recipes/default.rb in the cache.
[Thu, 07 Oct 2010 15:48:55 -0700] INFO: Ran execute[apt-get-update] successfully
Installing lib mysq client...
Installing mysql-common...
Installing mysql-client...
Installing mysql gem...
x86_64
[Thu, 07 Oct 2010 15:48:59 -0700] INFO: backend-app
[Thu, 07 Oct 2010 15:49:00 -0700] INFO: Ran execute[apt-get-update] successfully
@Aslan
Aslan / ec21.sh
Created September 16, 2010 21:26
#!/bin/bash
DEBUG=1;
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
GREP="`which grep`";
2010-08-26_22:33:34.25302 /usr/local/lib/site_ruby/1.8/rubygems.rb:233:in `activate': can't activate json (<= 1.4.2, runtime) for ["ohai-0.5.6", "chef-0.8.10"], already activated json-1.4.6 for ["chef-server-0.8.10"] (Gem::LoadError)
2010-08-26_22:33:34.25306 from /usr/local/lib/site_ruby/1.8/rubygems.rb:249:in `activate'
2010-08-26_22:33:34.25307 from /usr/local/lib/site_ruby/1.8/rubygems.rb:248:in `each'
2010-08-26_22:33:34.25308 from /usr/local/lib/site_ruby/1.8/rubygems.rb:248:in `activate'
2010-08-26_22:33:34.25309 from /usr/local/lib/site_ruby/1.8/rubygems.rb:249:in `activate'2010-08-26_22:33:34.25310 from /usr/local/lib/site_ruby/1.8/rubygems.rb:248:in `each'
2010-08-26_22:33:34.25311 from /usr/local/lib/site_ruby/1.8/rubygems.rb:248:in `activate'
2010-08-26_22:33:34.25311 from /usr/local/lib/site_ruby/1.8/rubygems.rb:1082:in `gem'
2010-08-26_22:33:34.25312 from /usr/lib/ruby/gems/1.8/gems/chef-server-0.8.10/bin/chef-server:39
2010-08-26_22:33:34.25312