|
From: | Martin Pala |
Subject: | Re: monit unresponsive to status requests? |
Date: | Tue, 26 Jul 2005 10:39:59 +0200 |
User-agent: | Mozilla Thunderbird 1.0.6 (Windows/20050716) |
Provided that there will be API for external testing modules, i agree that it could be useful and may integrate with monit well (of course if others will agree :)
The API probably should have at least these features: 1.) when monit execs the testing module, it will wait for: - either it to finish normaly (return code?)- or optional method execution timeout will occure (by default for exmaple 5s) => monit will fire 'method timeout' event
2.) the method have to return all informations that monit needs to set for event, i.e. for example:
- general method return code (method failed to execute?) - service state (service failed/passed?) - error level (how bad the state is e.g. critical/warning/info/...) - event type (one of event types known to monit) - event description (details what happened)Monit API can handle some method states automaticaly (for example 'method timed out', 'method failed', etc.), otherwise the method will be responsible to specify what happened. The above described method API iterface should be required - in the case that some information is missing, the method is incompatible.
This is just raw image ... what about it? Martin Randy Bias wrote:
I like this hack, but the problem is that it adds in another process that I have to rely on. It's better if I am only relying on init and monit.--Randy Randy Bias randy-at-netenrich-dot-com Director of Application Engineering & Support On Jul 24, 2005, at 2:08 PM, Martin Pala wrote:It is possible to use general 'trick' for this by using custom script running from cron for example, which updates the timestamp of some state file.Monit then checks the timestamp of this file using the timestamp rule, for example:--8<-- check file nfs_proc_count with path /tmp/nfs_state if timestamp > 10 minutes then ... --8<--The script running from cron for example each 5 minutes, could be simple, something like:--8<-- if [ `pgrep nfsd | wc -l` -ge 4 ]; then touch /tmp/nfs_state; fi --8<--=> in the case that there are at least four nfs processes, timestamp of the /tmp/nfs_state file will be updated. In the case that there are less then four process, state file timestamp will not be updated and monit will trigger event.Martin Marco Ermini wrote:This is what the OpenView sysadmin sometimes did. They have the agent running an external script using, for instance, Korn shell. In this script you can put anything, for instance, check that you have at least 4 Java processes, or grep a log file, or whatever. Then the result (0 as positive, other values as wrong) will trigger the alarm or not.-- To unsubscribe: http://lists.nongnu.org/mailman/listinfo/monit-general-- To unsubscribe: http://lists.nongnu.org/mailman/listinfo/monit-general
[Prev in Thread] | Current Thread | [Next in Thread] |