Hello Everyone,
I am working on writing a resource type and provider for monit [1]. I
primarily use monit on Ubuntu. It is pretty easy to install and setup
monit on Ubuntu [2].
I want to write a resource type and provider for monit which would
take the names of service, PID files timeouts etc and populate the
monit configuration file "/etc/monit/monitrc" as follows:
===BEGIN_MONIT_CONFIG========
# Monitoring the apache2 web services.
# It will check process apache2 with given pid file.
# If process name or pidfile path is wrong then monit will
# give the error of failed. tough apache2 is running.
check process apache2 with pidfile /var/run/apache2.pid
#Below is actions taken by monit when service got stuck.
start program = “/etc/init.d/apache2 start”
stop program = “/etc/init.d/apache2 stop”
# Admin will notify by mail if below of the condition satisfied.
if cpu is greater than 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if totalmem > 200.0 MB for 5 cycles then restart
if children > 250 then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
if 3 restarts within 5 cycles then timeout
group server
===END_MONIT_CONFIG========
The monit resource type would be something on the lines of , but much
more powerful that the "Service" resource type [3].
I would typically like the user something like:
==SAMPLE site.pp ==
monitResource { "Apache":
start program => “/etc/init.d/apache2 start”,
stop program => “/etc/init.d/apache2 stop”,
cpuRestartCondition => "80%", "5 cycles",
totalMemRestartCondition => "200.0MB", "5 cycles",
loadAvgRestartCondition => "5min", "10", "8 cycles"
timeout => "3 restarts", "5 cycles"
}
and so on...
What would be the best way to go about implementing this stuff?
any tips/ideas/suggestions are more than welcome
Thanks in advance!
Manish Chakravarty
Links:
[1] = http://www.tildeslash.com/monit/
[2] = http://www.ubuntugeek.com/monitoring-ubuntu-services-using-monit.html
[3] = http://reductivelabs.com/trac/puppet/wiki/TypeReference#service
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---