monit-general
[Top][All Lists]
Advanced

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

Re: Syntax for else if


From: Mehul Ved
Subject: Re: Syntax for else if
Date: Thu, 16 Jun 2016 15:00:06 +0000

monit -V

This is Monit version 5.18
Built with ssl, with pam and with large files
Copyright (C) 2001-2016 Tildeslash Ltd. All Rights Reserved.


From: monit-general <monit-general-bounces+address@hidden> on behalf of Martin Pala <address@hidden>
Sent: Thursday, June 16, 2016 4:51:04 PM
To: This is the general mailing list for monit
Subject: Re: Syntax for else if
 
The following test configuration file works fine (tested with monit 5.18):

--8<--
set daemon 5

set httpd port 2812 allow localhost

check process "httpd" matching "httpd"
  if does not exist for 3 cycles
        then exec "/etc/monit/pagerduty-trigger crond"
  else if passed for 3 cycles
        then exec "/etc/monit/pagerduty-resolve crond"
--8<--

Which monit version do you use? (monit -V)

Best regards,
Martin


> On 16 Jun 2016, at 12:17, Mehul Ved <address@hidden> wrote:
>
> Hello,
>   I am configuring pagerduty integration with monit and have run into a roadblock while setting it up. As per the pagerduty documentation,
> - to trigger a new incident, we need to add
> if does not exist for 3 cycles
>         then exec "/etc/monit/pagerduty-trigger crond"
>
> which works fine.
>
> - to automatically mark the issue as resolved, we need to add
>     else if passed for 3 cycles
>         then exec "/etc/monit/pagerduty-resolve crond"
>
> but this causes syntax error.
>
> So, I looked up the monit documentation at https://mmonit.com/monit/documentation/monit.html and it shows the following syntax:
> IF <test> THEN <action> [ELSE IF SUCCEEDED THEN <action>]
> and this causes validation error as well.
> I went through the changelog as well as the issue list on bitbucket but failed to find any information on the same. Has anything changed? Did I miss something here?
> documentation - M/Monit
> mmonit.com
> Version 5.18. NAME; SYNOPSIS; DESCRIPTION; WHAT TO MONITOR? GENERAL OPERATION. Options; Arguments; THE MONIT CONTROL FILE. Service checks. Process; File; Fifo; Filesystem
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

reply via email to

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