monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AW: counters?


From: Martin Pala
Subject: Re: AW: counters?
Date: Wed, 28 Jun 2006 16:10:39 +0200
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

... your example is worth to consider, since it may reuse the existing match code and simplify the integration (no need for wrapper script).

+1 for the mentioned example ;)

  CHECK STATUS OF printers WITH PATH "//usr/bin/lpc status"
    IF MATCH "disabled" THEN ALERT


(so either "IF FAILED ..." or multiple "IF MATCH ..." may be used)


Martin



Martin Pala wrote:
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 ALERT
May this is possible with the new feature?

Best regards
Andre

-----Urspr√ľngliche Nachricht-----
Von: address@hidden [mailto:address@hidden Im Auftrag von Martin Pala
Gesendet: 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 for
those obscure
situations where I need to check the value of something is
there a way
to 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





--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general






reply via email to

[Prev in Thread] Current Thread [Next in Thread]