Are cron definitions for host/port checks supported?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Are cron definitions for host/port checks supported?

Michael.Hadorn

Hi there

 

We need to monitor a website (host / port) only between a specific time range (e.g. while 08:00-18:00 on workdays).

 

Is it possible to add something like for the services:

check host [host] with address [fqdn]

  if failed ping then alert

  if failed port 80 protocol http request "/index.php" then alert

    every "* 8-18 * * 1-5"

 

This would be great. If not, I have to use a curl script… :/

 

Thank you for your effort.

 

Best regrads
mha


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

smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Are cron definitions for host/port checks supported?

Noel Jones
On 6/22/2018 3:46 AM, [hidden email] wrote:

Hi there

 

We need to monitor a website (host / port) only between a specific time range (e.g. while 08:00-18:00 on workdays).

 

Is it possible to add something like for the services:

check host [host] with address [fqdn]

  if failed ping then alert

  if failed port 80 protocol http request "/index.php" then alert

    every "* 8-18 * * 1-5"

 

This would be great. If not, I have to use a curl script… :/

 

Thank you for your effort.

 

Best regrads
mha




Yes, monit supports cron-style scheduling.  See the manual for details.

https://mmonit.com/monit/documentation/monit.html#SERVICE-POLL-TIME



  -- Noel Jones


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

RE: Are cron definitions for host/port checks supported?

Michael.Hadorn

Thank you for your quick answer.

 

I saw this section already, but thought that this would only count for service checks.

 

Now I understand it, and solved my requirement like this (in .monitrc):

 

check host [server]_ping with address myserver.com

  if failed ping then alert

 

check host [server]_website with address myserver.com

  if failed port 80 protocol http request "/ " then alert

  every "* 8-18 * * 1-5"

 

Now everything works fine.

 

 

From: monit-general [mailto:monit-general-bounces+michael.hadorn=[hidden email]] On Behalf Of Noel
Sent: Freitag, 22. Juni 2018 15:41
To: [hidden email]
Subject: Re: Are cron definitions for host/port checks supported?

 

On 6/22/2018 3:46 AM, [hidden email] wrote:

Hi there

 

We need to monitor a website (host / port) only between a specific time range (e.g. while 08:00-18:00 on workdays).

 

Is it possible to add something like for the services:

check host [host] with address [fqdn]

  if failed ping then alert

  if failed port 80 protocol http request "/index.php" then alert

    every "* 8-18 * * 1-5"

 

This would be great. If not, I have to use a curl script… :/

 

Thank you for your effort.

 

Best regrads
mha



 

Yes, monit supports cron-style scheduling.  See the manual for details.

https://mmonit.com/monit/documentation/monit.html#SERVICE-POLL-TIME

 

 

  -- Noel Jones


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

smime.p7s (7K) Download Attachment