|
From: | Raymond Boswel (RPH) |
Subject: | RE: Feature request |
Date: | Thu, 23 Aug 2012 11:26:49 +0000 |
Thanks Martin! From: monit-general-bounces+address@hidden [mailto:monit-general-bounces+address@hidden
On Behalf Of Martin Pala Hi, you can use the "check program" statement (available in monit version 5.3+) to integrate your test scripts with monit and set the action based on the return value. Example: check program mytest with path "/usr/bin/mytest.sh" if status == 10 then alert Regards, Martin On Aug 23, 2012, at 10:08 AM, Raymond Boswel (RPH) <address@hidden> wrote:
Hi All, I’ve been successfully using monit for about a month. I have however been misusing Monit somewhat to run more complex tests while still using Monit’s alerts to send out emails. My (hack) is as follows : I monitor the monit control file for size, a test which it will fail, every x minutes. When this test fails monit calls a perl script which performs an input vs output test
on an application server, to ensure that the application is still in a sane state. If the test fails I stop the offending service from the script. Monit then notices that the service is stopped and restarts the service and sends out alerts. This works fine,
but it would be nice if the script could just pass a return value back to monit. Monit can then take the appropriate action itself. I’m also currently working on a second test on this server. When this test fails I would like to let Monit simply send out an email. I haven’t figured out a simple way to
do this yet. I therefore propose that a command line action to Monit is added, for example $monit alert <Service> <Message>, which then sends out an email in the format as defined in the control file. I couldn’t find any similar suggestions, so I hope these are useful. Kind regards, Raymond Boswel Engineer/technologist Telkom Development Laboratory Tel: +27 12 529 7379
|
[Prev in Thread] | Current Thread | [Next in Thread] |