deprec 1.9.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. data/CHANGELOG +280 -0
  2. data/COPYING +19 -0
  3. data/LICENSE +339 -0
  4. data/README +152 -0
  5. data/THANKS +17 -0
  6. data/bin/depify +128 -0
  7. data/docs/EXAMPLE-installing_tracks.txt +41 -0
  8. data/docs/README.nagios +22 -0
  9. data/docs/README.rails +17 -0
  10. data/docs/config_gen_explained.txt +39 -0
  11. data/docs/{README.quickstart → deprec-1.x/deprec-1.x.quickstart} +4 -1
  12. data/docs/{building_edge_capistrano.txt → deprec-1.x/notes.txt} +6 -3
  13. data/docs/old/deprec_banner.gif +0 -0
  14. data/docs/windows_linux.txt +350 -0
  15. data/docs/xen/traffic_monitoring_with_vnstat.txt +95 -0
  16. data/docs/xen/xen-tools-notes.txt +31 -0
  17. data/docs/xen/xen_on_hardy.txt +39 -0
  18. data/lib/deprec.rb +8 -1
  19. data/lib/deprec/capistrano_extensions.rb +442 -0
  20. data/lib/deprec/recipes.rb +50 -233
  21. data/lib/deprec/recipes/aoe.rb +79 -0
  22. data/lib/deprec/recipes/app/mongrel.rb +213 -0
  23. data/lib/deprec/recipes/app/passenger.rb +197 -0
  24. data/lib/deprec/recipes/apt_mirror.rb +99 -0
  25. data/lib/deprec/recipes/ar_sendmail.rb +67 -0
  26. data/lib/deprec/recipes/canonical.rb +68 -0
  27. data/lib/deprec/recipes/db/mysql.rb +144 -0
  28. data/lib/deprec/recipes/db/postgresql.rb +104 -0
  29. data/lib/deprec/recipes/db/sqlite.rb +37 -0
  30. data/lib/deprec/recipes/ddclient.rb +51 -0
  31. data/lib/deprec/recipes/deprec.rb +199 -0
  32. data/lib/deprec/recipes/deprecated.rb +71 -0
  33. data/lib/deprec/recipes/example.rb +115 -0
  34. data/lib/deprec/recipes/git.rb +97 -0
  35. data/lib/deprec/recipes/gitosis.rb +48 -0
  36. data/lib/deprec/recipes/heartbeat.rb +138 -0
  37. data/lib/deprec/recipes/logrotate.rb +54 -0
  38. data/lib/deprec/recipes/lvm.rb +20 -0
  39. data/lib/deprec/recipes/memcache.rb +6 -2
  40. data/lib/deprec/recipes/monit.rb +143 -0
  41. data/lib/deprec/recipes/nagios.rb +305 -0
  42. data/lib/deprec/recipes/network.rb +93 -0
  43. data/lib/deprec/recipes/ntp.rb +103 -0
  44. data/lib/deprec/recipes/php.rb +58 -0
  45. data/lib/deprec/recipes/postfix.rb +115 -0
  46. data/lib/deprec/recipes/rails.rb +300 -55
  47. data/lib/deprec/recipes/ruby/mri.rb +55 -0
  48. data/lib/deprec/recipes/ruby/ree.rb +41 -0
  49. data/lib/deprec/recipes/sphinx.rb +86 -0
  50. data/lib/deprec/recipes/ssh.rb +85 -18
  51. data/lib/deprec/recipes/ssl.rb +55 -0
  52. data/lib/deprec/recipes/starling.rb +119 -0
  53. data/lib/deprec/recipes/svn.rb +163 -183
  54. data/lib/deprec/recipes/trac.rb +239 -62
  55. data/lib/deprec/recipes/ubuntu.rb +18 -100
  56. data/lib/deprec/recipes/users.rb +90 -0
  57. data/lib/deprec/recipes/utils.rb +58 -0
  58. data/lib/deprec/recipes/vnstat.rb +85 -0
  59. data/lib/deprec/recipes/web/apache.rb +119 -0
  60. data/lib/deprec/recipes/web/nginx.rb +172 -0
  61. data/lib/deprec/recipes/wordpress.rb +96 -0
  62. data/lib/deprec/recipes/wpmu.rb +103 -0
  63. data/lib/deprec/recipes/xen.rb +267 -0
  64. data/lib/deprec/recipes/xentools.rb +75 -0
  65. data/lib/deprec/templates/aoe/aoe-init +55 -0
  66. data/lib/deprec/templates/aoe/fence_aoemask +351 -0
  67. data/lib/deprec/templates/apache/namevirtualhosts.conf +5 -0
  68. data/lib/deprec/templates/apt/sources.list +18 -0
  69. data/lib/deprec/templates/apt_mirror/apt-mirror-cron +4 -0
  70. data/lib/deprec/templates/apt_mirror/mirror.list +33 -0
  71. data/lib/deprec/templates/ar_sendmail/logrotate.conf.erb +9 -0
  72. data/lib/deprec/templates/ar_sendmail/monit.conf.erb +5 -0
  73. data/lib/deprec/templates/ddclient/ddclient.conf.erb +11 -0
  74. data/lib/deprec/templates/ddclient/ddclient.erb +15 -0
  75. data/lib/deprec/templates/deprec/caprc.erb +14 -0
  76. data/lib/deprec/templates/heartbeat/authkeys.erb +2 -0
  77. data/lib/deprec/templates/heartbeat/ha.cf.erb +15 -0
  78. data/lib/deprec/templates/heartbeat/haresources.erb +1 -0
  79. data/lib/deprec/templates/logrotate/logrotate.conf.erb +32 -0
  80. data/lib/deprec/templates/mongrel/apache_vhost.erb +148 -0
  81. data/lib/deprec/templates/mongrel/logrotate.conf.erb +11 -0
  82. data/lib/deprec/{third_party/mongrel_cluster/resources/mongrel_cluster → templates/mongrel/mongrel_cluster-init-script} +19 -6
  83. data/lib/deprec/templates/mongrel/mongrel_cluster.yml.erb +10 -0
  84. data/lib/deprec/templates/mongrel/monit.conf.erb +17 -0
  85. data/lib/deprec/templates/mongrel/nginx_vhost.erb +41 -0
  86. data/lib/deprec/templates/monit/monit-init-script +104 -0
  87. data/lib/deprec/templates/monit/monitrc.erb +227 -0
  88. data/lib/deprec/templates/monit/nothing +0 -0
  89. data/lib/deprec/templates/mysql/create_databases.sql +20 -0
  90. data/lib/deprec/templates/mysql/database.yml.prod +6 -0
  91. data/lib/deprec/templates/mysql/database.yml.stage +6 -0
  92. data/lib/deprec/templates/mysql/my.cnf.erb +140 -0
  93. data/lib/deprec/templates/mysql/sphinx.conf.prod +542 -0
  94. data/lib/deprec/templates/mysql/sphinx.conf.stage +542 -0
  95. data/lib/deprec/templates/nagios/cgi.cfg.erb +321 -0
  96. data/lib/deprec/templates/nagios/check_linux_free_memory.pl +118 -0
  97. data/lib/deprec/templates/nagios/check_mongrel_cluster.rb +82 -0
  98. data/lib/deprec/templates/nagios/commands.cfg.erb +240 -0
  99. data/lib/deprec/templates/nagios/contacts.cfg.erb +57 -0
  100. data/lib/deprec/templates/nagios/hosts.cfg.erb +143 -0
  101. data/lib/deprec/templates/nagios/htpasswd.users +1 -0
  102. data/lib/deprec/templates/nagios/localhost.cfg.erb +157 -0
  103. data/lib/deprec/templates/nagios/nagios.cfg.erb +1274 -0
  104. data/lib/deprec/templates/nagios/nagios_apache_vhost.conf.erb +45 -0
  105. data/lib/deprec/templates/nagios/nrpe.cfg.erb +210 -0
  106. data/lib/deprec/templates/nagios/nrpe.xinetd.erb +16 -0
  107. data/lib/deprec/templates/nagios/resource.cfg.erb +34 -0
  108. data/lib/deprec/templates/nagios/services.cfg.erb +79 -0
  109. data/lib/deprec/templates/nagios/templates.cfg.erb +9 -0
  110. data/lib/deprec/templates/nagios/timeperiods.cfg.erb +94 -0
  111. data/lib/deprec/templates/network/hostname.erb +1 -0
  112. data/lib/deprec/templates/network/hosts.erb +2 -0
  113. data/lib/deprec/templates/network/interfaces.erb +18 -0
  114. data/lib/deprec/templates/network/resolv.conf.erb +6 -0
  115. data/lib/deprec/templates/nginx/logrotate.conf.erb +13 -0
  116. data/lib/deprec/templates/nginx/mime.types.erb +70 -0
  117. data/lib/deprec/templates/nginx/nginx-init-script +62 -0
  118. data/lib/deprec/templates/nginx/nginx.conf.erb +125 -0
  119. data/lib/deprec/templates/nginx/nginx.logrotate.d +12 -0
  120. data/lib/deprec/templates/nginx/nothing.conf +1 -0
  121. data/lib/deprec/templates/nginx/rails_nginx_vhost.conf.erb +41 -0
  122. data/lib/deprec/templates/ntp/ntp.conf.erb +42 -0
  123. data/lib/deprec/templates/passenger/apache_vhost.erb +21 -0
  124. data/lib/deprec/templates/passenger/passenger.conf.erb +21 -0
  125. data/lib/deprec/templates/passenger/passenger.load.erb +3 -0
  126. data/lib/deprec/templates/postfix/aliases.erb +3 -0
  127. data/lib/deprec/templates/postfix/dynamicmaps.cf.erb +8 -0
  128. data/lib/deprec/templates/{postfix_main.conf → postfix/main.cf.erb} +6 -8
  129. data/lib/deprec/templates/postfix/master.cf.erb +77 -0
  130. data/lib/deprec/templates/sphinx/monit.conf.erb +5 -0
  131. data/lib/deprec/templates/ssh/ssh_config.erb +50 -0
  132. data/lib/deprec/templates/ssh/sshd_config.erb +78 -0
  133. data/lib/deprec/templates/ssl/make-ssl-cert +138 -0
  134. data/lib/deprec/templates/ssl/ssl-cert-snakeoil.key +15 -0
  135. data/lib/deprec/templates/ssl/ssl-cert-snakeoil.pem +19 -0
  136. data/lib/deprec/templates/starling/monit.conf.erb +14 -0
  137. data/lib/deprec/templates/starling/starling-init-script.erb +71 -0
  138. data/lib/deprec/templates/subversion/svn.apache.vhost.erb +43 -0
  139. data/lib/deprec/templates/trac/apache_vhost.conf.erb +24 -0
  140. data/lib/deprec/templates/trac/nginx_vhost.conf.erb +26 -0
  141. data/lib/deprec/templates/trac/trac.ini.erb +169 -0
  142. data/lib/deprec/templates/trac/trac_deprec.png +0 -0
  143. data/lib/deprec/templates/trac/tracd-init.erb +43 -0
  144. data/lib/deprec/templates/trac/users.htdigest.erb +0 -0
  145. data/lib/deprec/templates/vnstat/config.php +57 -0
  146. data/lib/deprec/templates/wordpress/apache2_wordpress_vhost.conf.erb +31 -0
  147. data/lib/deprec/templates/wordpress/wp-config.php.erb +31 -0
  148. data/lib/deprec/templates/wpmu/apache_vhost.conf.erb +13 -0
  149. data/lib/deprec/templates/xen/network-bridge-wrapper +3 -0
  150. data/lib/deprec/templates/xen/xend-config.sxp.erb +195 -0
  151. data/lib/deprec/templates/xen/xend-init.erb +57 -0
  152. data/lib/deprec/templates/xen/xendomains.erb +137 -0
  153. data/lib/deprec/templates/xentools/15-disable-hwclock +40 -0
  154. data/lib/deprec/templates/xentools/40-setup-networking +145 -0
  155. data/lib/deprec/templates/xentools/xen-tools.conf.erb +276 -0
  156. data/lib/deprec/templates/xentools/xm.tmpl.erb +138 -0
  157. data/lib/deprec_cmd_completion.sh +26 -0
  158. data/lib/vmbuilder_plugins/all.rb +20 -0
  159. data/lib/vmbuilder_plugins/apt.rb +93 -0
  160. data/lib/vmbuilder_plugins/emerge.rb +76 -0
  161. data/lib/{deprec/third_party/vmbuilder/plugins → vmbuilder_plugins}/gem.rb +10 -17
  162. data/lib/{deprec/third_party/vmbuilder/plugins → vmbuilder_plugins}/std.rb +69 -19
  163. metadata +204 -55
  164. data/bin/deprec +0 -35
  165. data/docs/README.slicehost +0 -14
  166. data/docs/README.svn_trac +0 -19
  167. data/lib/deprec/capistrano_extensions/actor_extensions.rb +0 -89
  168. data/lib/deprec/capistrano_extensions/cli_extensions.rb +0 -38
  169. data/lib/deprec/capistrano_extensions/deprec_extensions.rb +0 -137
  170. data/lib/deprec/generators/deprec/USAGE +0 -11
  171. data/lib/deprec/generators/deprec/deprec_generator.rb +0 -24
  172. data/lib/deprec/generators/deprec/templates/deploy.rb +0 -90
  173. data/lib/deprec/generators/loader.rb +0 -20
  174. data/lib/deprec/recipes/apache.rb +0 -91
  175. data/lib/deprec/recipes/cache_svn.rb +0 -74
  176. data/lib/deprec/recipes/vmware.rb +0 -114
  177. data/lib/deprec/templates/trac.ini.erb +0 -106
  178. data/lib/deprec/third_party/THIRD_PARTY_README +0 -12
  179. data/lib/deprec/third_party/mongrel_cluster/LICENSE +0 -506
  180. data/lib/deprec/third_party/mongrel_cluster/recipes.rb +0 -96
  181. data/lib/deprec/third_party/railsmachine/LICENSE +0 -506
  182. data/lib/deprec/third_party/railsmachine/recipes/apache.rb +0 -92
  183. data/lib/deprec/third_party/railsmachine/recipes/mysql.rb +0 -73
  184. data/lib/deprec/third_party/railsmachine/recipes/templates/httpd-ssl.conf +0 -80
  185. data/lib/deprec/third_party/railsmachine/recipes/templates/httpd.conf +0 -57
  186. data/lib/deprec/third_party/vmbuilder/plugins.rb +0 -8
  187. data/lib/deprec/third_party/vmbuilder/plugins/apt.rb +0 -144
  188. data/resources/capistrano_include_dotfiles.patch +0 -17
@@ -0,0 +1,104 @@
1
+ #!/bin/sh
2
+ # /etc/init.d/monit start and stop monit daemon monitor process.
3
+ # Fredrik Steen, stone@debian.org
4
+ :
5
+ PATH=/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
6
+ DAEMON=/usr/local/bin/monit
7
+ CONFIG="/etc/monitrc"
8
+ NAME=monit
9
+ DESC="daemon monitor"
10
+
11
+ set -e
12
+
13
+ # Check if DAEMON binary exist
14
+ test -f $DAEMON || exit 0
15
+
16
+ ARGS="-c $CONFIG"
17
+
18
+ monit_not_configured () {
19
+ echo -e "monit won't be started/stopped\n\tunless it it's configured"
20
+ if [ "$1" != "stop" ]
21
+ then
22
+ echo -e "\tplease configure monit and then edit /etc/default/monit"
23
+ echo -e "\tand set the \"startup\" variable to 1 in order to allow "
24
+ echo -e "\tmonit to start"
25
+ fi
26
+ exit 0
27
+ }
28
+
29
+ monit_check_config () {
30
+ # Check for emtpy config, probably default configfile.
31
+ if [ "`grep -s -v \"^#\" $CONFIG`" = "" ]; then
32
+ echo "empty config, please edit $CONFIG."
33
+ exit 0
34
+ fi
35
+ }
36
+
37
+ monit_check_perms () {
38
+ # Check the permission on configfile.
39
+ # The permission must not have more than -rwx------ (0700) permissions.
40
+
41
+ # Skip checking, fix perms instead.
42
+ /bin/chmod go-rwx $CONFIG
43
+
44
+ }
45
+
46
+ monit_delayed_monitoring () {
47
+ if [ -x $DELAY ]; then
48
+ $DELAY &
49
+ elif [ -f $DELAY ]; then
50
+ echo
51
+ echo "[WARNING] A delayed start file exists ($DELAY) but it is not executable."
52
+ fi
53
+ }
54
+
55
+ monit_check_syntax () {
56
+ $DAEMON -t;
57
+ # if [ $? ] ; then
58
+ # echo "syntax good"
59
+ # else
60
+ # echo "syntax bad"
61
+ # fi
62
+ }
63
+
64
+
65
+ monit_checks () {
66
+ # Check for emtpy configfile
67
+ monit_check_config
68
+ # Check permissions of configfile
69
+ monit_check_perms
70
+ }
71
+
72
+ case "$1" in
73
+ start)
74
+ echo -n "Starting $DESC: "
75
+ monit_checks $1
76
+ echo -n "$NAME"
77
+ start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
78
+ --exec $DAEMON > /dev/null 2>&1 -- $ARGS
79
+ monit_delayed_monitoring
80
+ echo "."
81
+ ;;
82
+ stop)
83
+ echo -n "Stopping $DESC: "
84
+ #monit_checks $1
85
+ echo -n "$NAME"
86
+ start-stop-daemon --retry 5 --oknodo --stop --quiet --pidfile /var/run/$NAME.pid \
87
+ --exec $DAEMON > /dev/null 2>&1
88
+ echo "."
89
+ ;;
90
+ restart|force-reload)
91
+ $0 stop
92
+ $0 start
93
+ ;;
94
+ syntax)
95
+ monit_check_syntax
96
+ ;;
97
+ *)
98
+ N=/etc/init.d/$NAME
99
+ echo "Usage: $N {start|stop|restart|force-reload|syntax}" >&2
100
+ exit 1
101
+ ;;
102
+ esac
103
+
104
+ exit 0
@@ -0,0 +1,227 @@
1
+ ###############################################################################
2
+ ## Monit control file
3
+ ###############################################################################
4
+ ##
5
+ ## Comments begin with a '#' and extend through the end of the line. Keywords
6
+ ## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
7
+ ##
8
+ ## Below you will find examples of some frequently used statements. For
9
+ ## information about the control file, a complete list of statements and
10
+ ## options please have a look in the monit manual.
11
+ ##
12
+ ##
13
+ ###############################################################################
14
+ ## Global section
15
+ ###############################################################################
16
+ ##
17
+ ## Start monit in the background (run as a daemon) and check services at
18
+ ## 2-minute intervals.
19
+ #
20
+ set daemon <%= monit_check_interval %>
21
+ #
22
+ #
23
+ ## Set syslog logging with the 'daemon' facility. If the FACILITY option is
24
+ ## omitted, monit will use 'user' facility by default. If you want to log to
25
+ ## a stand alone log file instead, specify the path to a log file
26
+ #
27
+ set logfile <%= monit_log %>
28
+ #
29
+ #
30
+ ## Set the list of mail servers for alert delivery. Multiple servers may be
31
+ ## specified using comma separator. By default monit uses port 25 - this
32
+ ## is possible to override with the PORT option.
33
+ #
34
+ <%= '# ' unless monit_mailserver %>set mailserver <%= monit_mailserver || 'localhost' %> # primary mailserver (append a comma
35
+ # # to this line if you add more.)
36
+ # backup.bar.baz port 10025, # backup mailserver on port 10025
37
+ # localhost # fallback relay
38
+ #
39
+ #
40
+ ## By default monit will drop alert events if no mail servers are available.
41
+ ## If you want to keep the alerts for a later delivery retry, you can use the
42
+ ## EVENTQUEUE statement. The base directory where undelivered alerts will be
43
+ ## stored is specified by the BASEDIR option. You can limit the maximal queue
44
+ ## size using the SLOTS option (if omitted, the queue is limited by space
45
+ ## available in the back end filesystem).
46
+ #
47
+ # set eventqueue
48
+ # basedir /var/monit # set the base directory where events will be stored
49
+ # slots 100 # optionaly limit the queue size
50
+ #
51
+ #
52
+ ## Monit by default uses the following alert mail format:
53
+ ##
54
+ ## --8<--
55
+ ## From: monit@$HOST # sender
56
+ ## Subject: monit alert -- $EVENT $SERVICE # subject
57
+ ##
58
+ ## $EVENT Service $SERVICE #
59
+ ## #
60
+ ## Date: $DATE #
61
+ ## Action: $ACTION #
62
+ ## Host: $HOST # body
63
+ ## Description: $DESCRIPTION #
64
+ ## #
65
+ ## Your faithful employee, #
66
+ ## monit #
67
+ ## --8<--
68
+ ##
69
+ ## You can override this message format or parts of it, such as subject
70
+ ## or sender using the MAIL-FORMAT statement. Macros such as $DATE, etc.
71
+ ## are expanded at runtime. For example, to override the sender:
72
+ #
73
+ <%= '# ' unless monit_mailserver %>set mail-format { from: <%= monit_mail_from %> }
74
+ #
75
+ #
76
+ ## You can set alert recipients here whom will receive alerts if/when a
77
+ ## service defined in this file has errors. Alerts may be restricted on
78
+ ## events by using a filter as in the second example below.
79
+ #
80
+ <% monit_alert_recipients.each do |recipient| %>
81
+ <%= '# ' unless monit_mailserver %>set alert <%= recipient %> # receive all alerts
82
+ <% end %>
83
+ <% monit_timeout_recipients.each do |recipient| %>
84
+ <%= '# ' unless monit_mailserver %>set alert <%= recipient %> only on { timeout } # receive just service-
85
+ # timeout alert
86
+ <% end %>
87
+
88
+ #
89
+ #
90
+ ## Monit has an embedded web server which can be used to view status of
91
+ ## services monitored, the current configuration, actual services parameters
92
+ ## and manage services from a web interface.
93
+ #
94
+ <% if monit_webserver_enabled %>
95
+ set httpd port <%= monit_webserver_port %> and
96
+ use address <%= monit_webserver_address %> # listen on <%= monit_webserver_address %>
97
+ <% monit_webserver_allowed_hosts_and_networks.each do |host| %>
98
+ allow <%= host %> # allow <%= host %> to connect to the server
99
+ <% end %>
100
+ allow <%= monit_webserver_auth_user %>:<%= monit_webserver_auth_pass %> # require user <%= monit_webserver_auth_user %> with password <%= monit_webserver_auth_pass %>
101
+ <% end %>
102
+ #
103
+ #
104
+ ###############################################################################
105
+ ## Services
106
+ ###############################################################################
107
+ ##
108
+ ## Check general system resources such as load average, cpu and memory
109
+ ## usage. Each test specifies a resource, conditions and the action to be
110
+ ## performed should a test fail.
111
+ #
112
+ # check system myhost.mydomain.tld
113
+ # if loadavg (1min) > 4 then alert
114
+ # if loadavg (5min) > 2 then alert
115
+ # if memory usage > 75% then alert
116
+ # if cpu usage (user) > 70% then alert
117
+ # if cpu usage (system) > 30% then alert
118
+ # if cpu usage (wait) > 20% then alert
119
+ #
120
+ #
121
+ ## Check a file for existence, checksum, permissions, uid and gid. In addition
122
+ ## to alert recipients in the global section, customized alert will be sent to
123
+ ## additional recipients by specifying a local alert handler. The service may
124
+ ## be grouped using the GROUP option.
125
+ #
126
+ # check file apache_bin with path /usr/local/apache/bin/httpd
127
+ # if failed checksum and
128
+ # expect the sum 8f7f419955cefa0b33a2ba316cba3659 then unmonitor
129
+ # if failed permission 755 then unmonitor
130
+ # if failed uid root then unmonitor
131
+ # if failed gid root then unmonitor
132
+ # alert security@foo.bar on {
133
+ # checksum, permission, uid, gid, unmonitor
134
+ # } with the mail-format { subject: Alarm! }
135
+ # group server
136
+ #
137
+ #
138
+ ## Check that a process is running, in this case Apache, and that it respond
139
+ ## to HTTP and HTTPS requests. Check its resource usage such as cpu and memory,
140
+ ## and number of children. If the process is not running, monit will restart
141
+ ## it by default. In case the service was restarted very often and the
142
+ ## problem remains, it is possible to disable monitoring using the TIMEOUT
143
+ ## statement. This service depends on another service (apache_bin) which
144
+ ## is defined above.
145
+ #
146
+ # check process apache with pidfile /usr/local/apache/logs/httpd.pid
147
+ # start program = "/etc/init.d/httpd start"
148
+ # stop program = "/etc/init.d/httpd stop"
149
+ # if cpu > 60% for 2 cycles then alert
150
+ # if cpu > 80% for 5 cycles then restart
151
+ # if totalmem > 200.0 MB for 5 cycles then restart
152
+ # if children > 250 then restart
153
+ # if loadavg(5min) greater than 10 for 8 cycles then stop
154
+ # if failed host www.tildeslash.com port 80 protocol http
155
+ # and request "/monit/doc/next.php"
156
+ # then restart
157
+ # if failed port 443 type tcpssl protocol http
158
+ # with timeout 15 seconds
159
+ # then restart
160
+ # if 3 restarts within 5 cycles then timeout
161
+ # depends on apache_bin
162
+ # group server
163
+ #
164
+ #
165
+ ## Check device permissions, uid, gid, space and inode usage. Other services,
166
+ ## such as databases, may depend on this resource and an automatically graceful
167
+ ## stop may be cascaded to them before the filesystem will become full and data
168
+ ## lost.
169
+ #
170
+ # check device datafs with path /dev/sdb1
171
+ # start program = "/bin/mount /data"
172
+ # stop program = "/bin/umount /data"
173
+ # if failed permission 660 then unmonitor
174
+ # if failed uid root then unmonitor
175
+ # if failed gid disk then unmonitor
176
+ # if space usage > 80% for 5 times within 15 cycles then alert
177
+ # if space usage > 99% then stop
178
+ # if inode usage > 30000 then alert
179
+ # if inode usage > 99% then stop
180
+ # group server
181
+ #
182
+ #
183
+ ## Check a file's timestamp. In this example, we test if a file is older
184
+ ## than 15 minutes and assume something is wrong if its not updated. Also,
185
+ ## if the file size exceed a given limit, execute a script
186
+ #
187
+ # check file database with path /data/mydatabase.db
188
+ # if failed permission 700 then alert
189
+ # if failed uid data then alert
190
+ # if failed gid data then alert
191
+ # if timestamp > 15 minutes then alert
192
+ # if size > 100 MB then exec "/my/cleanup/script"
193
+ #
194
+ #
195
+ ## Check directory permission, uid and gid. An event is triggered if the
196
+ ## directory does not belong to the user with uid 0 and gid 0. In addition,
197
+ ## the permissions have to match the octal description of 755 (see chmod(1)).
198
+ #
199
+ # check directory bin with path /bin
200
+ # if failed permission 755 then unmonitor
201
+ # if failed uid 0 then unmonitor
202
+ # if failed gid 0 then unmonitor
203
+ #
204
+ #
205
+ ## Check a remote host network services availability using a ping test and
206
+ ## check response content from a web server. Up to three pings are sent and
207
+ ## connection to a port and a application level network check is performed.
208
+ #
209
+ # check host myserver with address 192.168.1.1
210
+ # if failed icmp type echo count 3 with timeout 3 seconds then alert
211
+ # if failed port 3306 protocol mysql with timeout 15 seconds then alert
212
+ # if failed url
213
+ # http://user:password@www.foo.bar:8080/?querystring
214
+ # and content == 'action="j_security_check"'
215
+ # then alert
216
+ #
217
+ #
218
+ ###############################################################################
219
+ ## Includes
220
+ ###############################################################################
221
+ ##
222
+ ## It is possible to include additional configuration parts from other files or
223
+ ## directories.
224
+ #
225
+ include /etc/monit.d/*
226
+ #
227
+ #
File without changes
@@ -0,0 +1,20 @@
1
+ create database <%= @username %>_prod;
2
+ GRANT USAGE ON *.* TO '<%= @username %>_db'@'%';
3
+
4
+ GRANT ALL PRIVILEGES
5
+ ON <%= @username %>_prod.*
6
+ TO <%= @username %>_db@'%'
7
+ IDENTIFIED BY '<%= @mysqlpass %>';
8
+
9
+ FLUSH PRIVILEGES;
10
+
11
+
12
+ create database <%= @username %>_stage;
13
+ GRANT USAGE ON *.* TO '<%= @username %>_db'@'%';
14
+
15
+ GRANT ALL PRIVILEGES
16
+ ON <%= @username %>_stage.*
17
+ TO <%= @username %>_db@'%'
18
+ IDENTIFIED BY '<%= @mysqlpass %>';
19
+
20
+ FLUSH PRIVILEGES;
@@ -0,0 +1,6 @@
1
+ production:
2
+ adapter: mysql
3
+ database: <%= @username %>_prod
4
+ username: <%= @username %>_db
5
+ password: <%= @mysqlpass %>
6
+ host: <%= @mysql_host %>
@@ -0,0 +1,6 @@
1
+ production:
2
+ adapter: mysql
3
+ database: <%= @username %>_stage
4
+ username: <%= @username %>_db
5
+ password: <%= @mysqlpass %>
6
+ host: <%= @mysql_host %>
@@ -0,0 +1,140 @@
1
+ #
2
+ # The MySQL database server configuration file.
3
+ #
4
+ # You can copy this to one of:
5
+ # - "/etc/mysql/my.cnf" to set global options,
6
+ # - "~/.my.cnf" to set user-specific options.
7
+ #
8
+ # One can use all long options that the program supports.
9
+ # Run program with --help to get a list of available options and with
10
+ # --print-defaults to see which it would actually understand and use.
11
+ #
12
+ # For explanations see
13
+ # http://dev.mysql.com/doc/mysql/en/server-system-variables.html
14
+
15
+ # This will be passed to all mysql clients
16
+ # It has been reported that passwords should be enclosed with ticks/quotes
17
+ # escpecially if they contain "#" chars...
18
+ # Remember to edit /etc/mysql/debian.cnf when changing the socket location.
19
+ [client]
20
+ port = 3306
21
+ socket = /var/run/mysqld/mysqld.sock
22
+
23
+ # Here is entries for some specific programs
24
+ # The following values assume you have at least 32M ram
25
+
26
+ # This was formally known as [safe_mysqld]. Both versions are currently parsed.
27
+ [mysqld_safe]
28
+ socket = /var/run/mysqld/mysqld.sock
29
+ nice = 0
30
+
31
+ [mysqld]
32
+ #
33
+ # * Basic Settings
34
+ #
35
+ user = mysql
36
+ pid-file = /var/run/mysqld/mysqld.pid
37
+ socket = /var/run/mysqld/mysqld.sock
38
+ port = 3306
39
+ basedir = /usr
40
+ datadir = /var/lib/mysql
41
+ tmpdir = /tmp
42
+ language = /usr/share/mysql/english
43
+ skip-external-locking
44
+ #
45
+ # Instead of skip-networking the default is now to listen only on
46
+ # localhost which is more compatible and is not less secure.
47
+ bind-address = 127.0.0.1
48
+ #
49
+ # * Fine Tuning
50
+ #
51
+ key_buffer = 16M
52
+ max_allowed_packet = 16M
53
+ thread_stack = 128K
54
+ thread_cache_size = 8
55
+ #max_connections = 100
56
+ #table_cache = 64
57
+ #thread_concurrency = 10
58
+ #
59
+ # * Query Cache Configuration
60
+ #
61
+ query_cache_limit = 1M
62
+ query_cache_size = 16M
63
+ #
64
+ # * Logging and Replication
65
+ #
66
+ # Both location gets rotated by the cronjob.
67
+ # Be aware that this log type is a performance killer.
68
+ #log = /var/log/mysql/mysql.log
69
+ #
70
+ # Error logging goes to syslog. This is a Debian improvement :)
71
+ #
72
+ # Here you can see queries with especially long duration
73
+ #log_slow_queries = /var/log/mysql/mysql-slow.log
74
+ #long_query_time = 2
75
+ #log-queries-not-using-indexes
76
+ #
77
+ # The following can be used as easy to replay backup logs or for replication.
78
+ # note: if you are setting up a replication slave, see README.Debian about
79
+ # other settings you may need to change.
80
+ #server-id = 1
81
+ log_bin = /var/log/mysql/mysql-bin.log
82
+ # WARNING: Using expire_logs_days without bin_log crashes the server! See README.Debian!
83
+ expire_logs_days = 10
84
+ max_binlog_size = 100M
85
+ #binlog_do_db = include_database_name
86
+ #binlog_ignore_db = include_database_name
87
+ #
88
+ # * BerkeleyDB
89
+ #
90
+ # Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
91
+ skip-bdb
92
+ #
93
+ # * InnoDB
94
+ #
95
+ # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
96
+ # Read the manual for more InnoDB related options. There are many!
97
+ # You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
98
+ #skip-innodb
99
+ #
100
+ # * Security Features
101
+ #
102
+ # Read the manual, too, if you want chroot!
103
+ # chroot = /var/lib/mysql/
104
+ #
105
+ # For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
106
+ #
107
+ # ssl-ca=/etc/mysql/cacert.pem
108
+ # ssl-cert=/etc/mysql/server-cert.pem
109
+ # ssl-key=/etc/mysql/server-key.pem
110
+
111
+
112
+
113
+ [mysqldump]
114
+ quick
115
+ quote-names
116
+ max_allowed_packet = 16M
117
+
118
+ [mysql]
119
+ #no-auto-rehash # faster start of mysql but no tab completition
120
+
121
+ [isamchk]
122
+ key_buffer = 16M
123
+
124
+ #
125
+ # * NDB Cluster
126
+ #
127
+ # See /usr/share/doc/mysql-server-*/README.Debian for more information.
128
+ #
129
+ # The following configuration is read by the NDB Data Nodes (ndbd processes)
130
+ # not from the NDB Management Nodes (ndb_mgmd processes).
131
+ #
132
+ # [MYSQL_CLUSTER]
133
+ # ndb-connectstring=127.0.0.1
134
+
135
+
136
+ #
137
+ # * IMPORTANT: Additional settings that can override those from this file!
138
+ #
139
+ !includedir /etc/mysql/conf.d/
140
+