Skip to content
Browse files

adding monit

  • Loading branch information...
1 parent 7c8a1b8 commit e5683faee09c18d5496ef1ef6d656f0d99c017c0 @theif theif committed Aug 25, 2010
Showing with 32 additions and 1 deletion.
  1. +2 −1 config/install.rb
  2. +12 −0 config/stack/config_files/monit
  3. +18 −0 config/stack/monitoring.rb
View
3 config/install.rb
@@ -1,7 +1,7 @@
$:<< File.join(File.dirname(__FILE__), 'stack')
# Require the stack base
-%w(essential goodies git scm ruby_enterprise memcached databases gemrc imagemagick rails deploy_user).each do |lib|
+%w(essential goodies git scm ruby_enterprise memcached databases gemrc imagemagick rails deploy_user monitoring).each do |lib|
require lib
end
@@ -37,6 +37,7 @@
requires :rails # RubyOnRails
requires :deploy_user # Deploy User
requires :deploy_keys # Deploy Keys
+ requires :monitoring # Monit Monitoring
end
deployment do
View
12 config/stack/config_files/monit
@@ -0,0 +1,12 @@
+# Defaults for monit initscript
+# sourced by /etc/init.d/monit
+# installed at /etc/default/monit by maintainer scripts
+# Stefan Alfredsson <alfs@debian.org>
+
+# You must set this variable to for monit to start
+startup=1
+
+# To change the intervals which monit should run,
+# edit the configuration file /etc/monit/monitrc
+# It can no longer be configured here.
+
View
18 config/stack/monitoring.rb
@@ -0,0 +1,18 @@
+package :monit, :provides => :monitoring do
+ description "Monit Monitoring"
+ apt "monit"
+
+ default_file = "/etc/default/monit"
+ transfer 'config/stack/config_files/monit', default_file, :sudo => true
+ # "~/monit" do
+ #post :install, "mv ~/monit #{default_file}"
+ #end
+
+ verify do
+ has_file '/usr/sbin/monit'
+ file_contains default_file, "startup=1"
+ end
+
+ requires :build_essential
+
+end

0 comments on commit e5683fa

Please sign in to comment.
Something went wrong with that request. Please try again.