|
From: | Martin Pala |
Subject: | Re: AW: counters? |
Date: | Wed, 28 Jun 2006 16:00:36 +0200 |
User-agent: | Thunderbird 1.5.0.4 (Windows/20060516) |
Hi,the syntax as described on the roadmap is not stone carved, but i think the idea was to recognize either pass or error.
The script should be responsible for returning the error code to monit - its output is not analyzed in monit, but just used as the error description (for example in alert message, logs, etc.)
Thus for example it can be used this way: check_lpc script: --8<-- #!/bin/bash /usr/bin/lpc status | /usr/bin/awk '/disabled/ {print $0; exit 1}'; --8<-- monit integration: --8<-- check status lpc with path "/path/to/check_lpc" if failed then alert --8<-- Martin Andre Creutz wrote:
Hi Mike Hi Martin As example: CHECK STATUS OF printers WITH PATH "//usr/bin/lpc status" IF MATCH "disabled" THEN ALERTMay this is possible with the new feature? Best regards Andre-----Ursprüngliche Nachricht-----Von: address@hidden [mailto:address@hidden Im Auftrag von Martin PalaGesendet: Mittwoch, 28. Juni 2006 00:06 An: This is the general mailing list for monit Betreff: Re: counters? This feature is on the roadmap: http://www.tildeslash.com/monit/doc/next.php#33 Martin Mike wrote:I've been reading the manual, not finished yet, and forthose obscuresituations where I need to check the value of something isthere a wayto execute a script, accept the script's return value (either stdout or the return from (system()/255), then to use this value in a test within monit? Mike possible example: check counter widgets from "/opt/local/bin/getwidgetcount.sh" if widgets < 0 then alert if widgets > 1000 then alert
[Prev in Thread] | Current Thread | [Next in Thread] |