On 6/5/2015 4:30 AM, Guillaume François wrote:
> Hi all,
>
> I'm trying inside a check process rule to make a check on a port
> of this process using the following rule:
>
> if failed port 1186 for 3 times within 4 cycles then alert
>
> Unfortunately it seems that monit default behavior it to look for
> this port on "localhost" as reported by interface but my process
> only listen on "real" IP.
>
>     failed to *[localhost]*:1186 type TCP/IP protocol DEFAULT
>
>

This works for me with monit 5.13 (and several previous versions, 
can't remember when I added this)

check process apache with path /var/run/httpd.pid
   if failed host 10.0.0.100 port 80
        protocol HTTP request "/path/token" then alert

The same syntax should work for other processes.



  -- Noel Jones


> I tried to change the rule according to documentation
>
>     TCP/UDP port test syntax:
>
>     | IF FAILED
>         [host]
>         <port>
>         [ipversion]
>         [type]
>         [protocol | {send/expect}+]
>         [timeout]
>         [retry]
>      THEN action|
>
> where *host *seems allowed but monit reject it each time
>
>     if failed port 10.2.0.201 1186 for 3 times within 4 cycles
>     then alert           -> syntax error '10.2.0.201'
>     if failed 10.2.0.201 1186 for 3 times within 4 cycles then
>     alert        -> syntax error '10.2.0.201'
>
>
> I also tried  "with adress" but it lead to the same rejection
>
>     if failed port 1186 with address 10.2.0.201 for 3 times within
>     4 cycles then alert            -> syntax error 'address'
>
>  
>
> It that possible ? If yes what is the correct syntax ?
>
> Best Regards,
> GF
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Reply via email to