https://github.com/meltwater/puppet-monit
https://github.com/meltwater/puppet-monit
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/meltwater/puppet-monit
- Owner: meltwater
- License: mit
- Created: 2014-08-05T00:55:27.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-11-18T17:31:50.000Z (11 months ago)
- Last Synced: 2024-12-26T22:40:58.000Z (9 months ago)
- Language: HTML
- Size: 26.4 KB
- Stars: 1
- Watchers: 30
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Puppet Monit Module
===================Module for configuring Monit and and setting up monitoring
of running processes.Tested on Debian GNU/Linux 6.0 Squeeze. Patches for other
operating systems welcome.Installation
------------Clone this repo to a monit directory under your Puppet
modules directory:git clone git://github.com/uggedal/puppet-module-monit.git monit
If you don't have a Puppet Master you can create a manifest file
based on the notes below and run Puppet in stand-alone mode
providing the module directory you cloned this repo to:puppet apply --modulepath=modules test_monit.pp
Usage
-----To install and configure Monit, include the module:
include monit
You can override defaults in the Monit config by including
the module with this special syntax:class { monit: admin => "eivind@uggedal.com but not on { instance pid ppid }", interval => 30, delay => 240 }
Setting up monitoring of processes is done with the `monit::site` resource.
Note that the name needs to be the same as an init script in `/etc/init.d`:monit::monitor { "ssh":
pidfile => "/var/run/sshd.pid",
}You can specify a IP port to check if you're running a network process:
monit::monitor { "nginx":
pidfile => "/var/run/nginx.pid",
ip_port => 22,
}Alternatively you can specify a Unix socket to check:
monit::monitor { "gunicorn-blog":
pidfile => "/var/run/gunicorn/blog.pid",
socket => "/var/run/gunicorn/blog.sock",
}You can also provide additional checks:
$reload_blog = "/etc/init.d/gunicorn-blog reload"
monit::monitor { "gunicorn-blog":
pidfile => "/var/run/gunicorn/blog.pid",
socket => "/var/run/gunicorn/blog.sock",
checks => ["if totalmem > 300 MB for 2 cycles then exec \"$reload_blog\"",
"if totalmem > 300 MB for 3 cycles then restart",
"if cpu > 50% for 2 cycles then alert"],
}