- Install monit from source.
- Include setting tools monitensite, monitdisite.
- Add LWRP for created configs.
- make (build-essential)
- ubuntu
- SmartOS
recipe[monit]
to default install.
include_recipe "monit_binaries"
----
put config from template to /etc/monit/conf.avail/
----
# enable
monit_binaries "myapp.conf"
# disable
monit_binaries "myapp.conf" do
enable false
end
These tools contorol monit setting like a2ensite,a2disite.
Put your confing to /etc/monit/conf.avail/
and...
** To enable setting**
monitensite postfix.conf
monit reload
** To disable setting**
monitdisite postfix.conf
monit reload
TODO: Write attributes...
Call monitensite and monit disite.
Example
monit_bin "postfix" do
action :enable
end
build config for system resource with poricy strings.
Example
monit_bin_check_system "localperf" do
action :create
policies ["if memory usage > 70 % then alert"]
end
build config for filesystem resource with poricy strings.
Example
monit_bin_check_filesystem "rootfs" do
action :create
path "/"
policies ["if space usage > 70 % then alert"]
end
build config for process resource with poricy strings.
Example
monit_bin_check_process "sshd" do
action :create
type "pid"
pidfile "/var/run/sshd.pid "
start_program "/usr/sbin/service ssh start"
stop_program "/usr/sbin/service ssh stop"
end
- default: install monit from souce.
- include: just define monit as service resource.
- services: monitoring services. setting from attributes.
- smartos_inittab: install and regist inittab for smartos. Smartos use this insted of default.
When using monit without m/monit
, You should set 127.0.0.1
or 0.0.0.0
to node[:monit][:monitrc][:'http_address]
attribute.
kitchen test
Author:: HiganWorks LLC ([email protected])