Periodic Heartbeat Emails

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

Periodic Heartbeat Emails

Paul Tiseo
What would be the best way to configure monit to send a "heartbeat" email on a fixed time span?

I tried "check host heartbeat-check address 127.0.0.1 every 5 cycles if failed ping then alert else if succeeded then alert"

I expected an email every 5 min (cycle = 60 seconds) with a success/fail message, but got nothing. (Emails work, as other checks do result in emails.)
--
Thanks.

_______________________________
Paul Tiseo, [hidden email]

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

Re: Periodic Heartbeat Emails

Guillaume François
Hello

You are missing the "reminder" part on the alert https://mmonit.com/monit/documentation/monit.html#Setting-an-error-reminder

alert foo@bar with reminder on 10 cycles

Best Regards,

2017-01-19 20:44 GMT+01:00 Paul Tiseo <[hidden email]>:
What would be the best way to configure monit to send a "heartbeat" email on a fixed time span?

I tried "check host heartbeat-check address 127.0.0.1 every 5 cycles if failed ping then alert else if succeeded then alert"

I expected an email every 5 min (cycle = 60 seconds) with a success/fail message, but got nothing. (Emails work, as other checks do result in emails.)
--
Thanks.

_______________________________
Paul Tiseo, [hidden email]

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



--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d(+) s++:- a C++$ ULC(+)>+++$ !P--- L+>$ !E---? W+++$ !N* !o-- K--? w(+) !O---? !M- !V--? PS+? !PE Y+ PGP++>+++ !t-- !5 !X- R(+)>++* tv-? b(-) DI !D- G(+)>+ e+++ h--() r->$ y?*
------END GEEK CODE BLOCK------

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

Re: Periodic Heartbeat EMails

Paul Tiseo
In reply to this post by Paul Tiseo
So, I set monitrc to the below. Not sure where I am to add the "reminder" clause so that the heartbeat service is the one that emails me without fail (don't want this to apply to other services). Suggestions?

set daemon    60 with start delay 15
set logfile   /apps/monit.log
set pidfile   /apps/monit.pid
set idfile    /apps/monit.id
set statefile /apps/state

set mailserver smtp.gmail.com port 587
  username "[hidden email]" password "aaa"
  using tlsv12

set httpd port 2182
  allow aaa:aaa
  signature disable

set alert [hidden email]

#-- HEARTBEAT ---------------------------------------------------------
check host agp-heartbeat address 127.0.0.1 every 2 cycles
  if failed ping then alert
  else if succeeded then alert
--
Thanks.

_______________________________
Paul Tiseo, [hidden email]

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

Re: Periodic Heartbeat EMails

martinp@tildeslash.com
Hi,

monit sends the error event after ok->failure state change and the success event only when the service had error and recovered. If monit is started and the service is running fine, monit won't send any event.

Best regards,
Martin


On 23 Jan 2017, at 17:59, Paul Tiseo <[hidden email]> wrote:

So, I set monitrc to the below. Not sure where I am to add the "reminder" clause so that the heartbeat service is the one that emails me without fail (don't want this to apply to other services). Suggestions?

set daemon    60 with start delay 15
set logfile   /apps/monit.log
set pidfile   /apps/monit.pid
set idfile    /apps/monit.id
set statefile /apps/state

set mailserver smtp.gmail.com port 587
  username "[hidden email]" password "aaa"
  using tlsv12

set httpd port 2182
  allow aaa:aaa
  signature disable

set alert [hidden email]

#-- HEARTBEAT ---------------------------------------------------------
check host agp-heartbeat address 127.0.0.1 every 2 cycles
  if failed ping then alert
  else if succeeded then alert
--
Thanks.

_______________________________
Paul Tiseo, [hidden email]
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: Periodic Heartbeat EMails

Paul Tiseo
So, the only way to have a heartbeat would be with a check that will always fail (ex: check for known non-existent file) and the reminder clause?

On Tue, Jan 24, 2017 at 12:56 PM Martin Pala <[hidden email]> wrote:
Hi,

monit sends the error event after ok->failure state change and the success event only when the service had error and recovered. If monit is started and the service is running fine, monit won't send any event.

Best regards,
Martin


On 23 Jan 2017, at 17:59, Paul Tiseo <[hidden email]> wrote:

So, I set monitrc to the below. Not sure where I am to add the "reminder" clause so that the heartbeat service is the one that emails me without fail (don't want this to apply to other services). Suggestions?

set daemon    60 with start delay 15
set logfile   /apps/monit.log
set pidfile   /apps/monit.pid
set idfile    /apps/monit.id
set statefile /apps/state

set mailserver smtp.gmail.com port 587
  username "[hidden email]" password "aaa"
  using tlsv12

set httpd port 2182
  allow aaa:aaa
  signature disable

set alert [hidden email]

#-- HEARTBEAT ---------------------------------------------------------
check host agp-heartbeat address 127.0.0.1 every 2 cycles
  if failed ping then alert
  else if succeeded then alert
--
Thanks.

_______________________________
Paul Tiseo, [hidden email]
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
--
Thanks.

_______________________________
Paul Tiseo, [hidden email]

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

Re: Periodic Heartbeat EMails

Tino Hendricks
In reply to this post by Paul Tiseo
Just out of curiosity, what is the benefit of having mails sent to you regardless of the system state?
I always consider it the biggest advantage of a monitoring that it _alerts_ you actively in case of emergency.


Am 23. Januar 2017 um 17:59:56, Paul Tiseo ([hidden email](mailto:[hidden email])) schrieb:

> So, I set monitrc to the below. Not sure where I am to add the "reminder" clause so that the heartbeat service is the one that emails me without fail (don't want this to apply to other services). Suggestions?
>
> set daemon 60 with start delay 15
> set logfile /apps/monit.log
> set pidfile /apps/monit.pid
> set idfile /apps/monit.id(http://monit.id)
> set statefile /apps/state
>
> set mailserver smtp.gmail.com(http://smtp.gmail.com) port 587
> username "[hidden email](mailto:[hidden email])" password "aaa"
> using tlsv12
>
> set httpd port 2182
> allow aaa:aaa
> signature disable
>
> set alert [hidden email](mailto:[hidden email])
>
> #-- HEARTBEAT ---------------------------------------------------------
> check host agp-heartbeat address 127.0.0.1 every 2 cycles
> if failed ping then alert
> else if succeeded then alert
> --
> Thanks.
>
> _______________________________
> Paul Tiseo, [hidden email](mailto:[hidden email])
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: Periodic Heartbeat EMails

Geoff Goas
Is the "heartbeat" just a periodic email? Why not put that in a cron job?

On Wed, Jan 25, 2017 at 11:36 AM, Tino Hendricks <[hidden email]> wrote:
Just out of curiosity, what is the benefit of having mails sent to you regardless of the system state?
I always consider it the biggest advantage of a monitoring that it _alerts_ you actively in case of emergency.


Am 23. Januar 2017 um 17:59:56, Paul Tiseo ([hidden email](mailto:[hidden email])) schrieb:

> So, I set monitrc to the below. Not sure where I am to add the "reminder" clause so that the heartbeat service is the one that emails me without fail (don't want this to apply to other services). Suggestions?
>
> set daemon 60 with start delay 15
> set logfile /apps/monit.log
> set pidfile /apps/monit.pid
> set idfile /apps/monit.id(http://monit.id)
> set statefile /apps/state
>
> set mailserver smtp.gmail.com(http://smtp.gmail.com) port 587
> username "[hidden email](mailto:[hidden email])" password "aaa"
> using tlsv12
>
> set httpd port 2182
> allow aaa:aaa
> signature disable
>
> set alert [hidden email](mailto:[hidden email])
>
> #-- HEARTBEAT ---------------------------------------------------------
> check host agp-heartbeat address 127.0.0.1 every 2 cycles
> if failed ping then alert
> else if succeeded then alert
> --
> Thanks.
>
> _______________________________
> Paul Tiseo, [hidden email](mailto:[hidden email])



--
Geoff Goas
Systems Engineer


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

Re: Periodic Heartbeat EMails

Guillaume François
I suppose the goal is to ensure, monit is able to report issue -> up and running and SMTP functionnal.

Let's suppose one of these two "dies" for any reason, an issue raises but you get never notified cause you are not aware that the system is down.

Having regular heartbeat from the monitoring system helps to know that it is up and running.

Again it just a personal guess but i can understand the need.

Like they says on some movies: 
bodyguards: "we are going to protect you VIP."
VIP "Ok but who is gonna to protect you (bodyguard)" 

2017-01-26 16:29 GMT+01:00 Geoff Goas <[hidden email]>:
Is the "heartbeat" just a periodic email? Why not put that in a cron job?

On Wed, Jan 25, 2017 at 11:36 AM, Tino Hendricks <[hidden email]> wrote:
Just out of curiosity, what is the benefit of having mails sent to you regardless of the system state?
I always consider it the biggest advantage of a monitoring that it _alerts_ you actively in case of emergency.


Am 23. Januar 2017 um 17:59:56, Paul Tiseo ([hidden email](mailto:[hidden email])) schrieb:

> So, I set monitrc to the below. Not sure where I am to add the "reminder" clause so that the heartbeat service is the one that emails me without fail (don't want this to apply to other services). Suggestions?
>
> set daemon 60 with start delay 15
> set logfile /apps/monit.log
> set pidfile /apps/monit.pid
> set idfile /apps/monit.id(http://monit.id)
> set statefile /apps/state
>
> set mailserver smtp.gmail.com(http://smtp.gmail.com) port 587
> username "[hidden email](mailto:[hidden email])" password "aaa"
> using tlsv12
>
> set httpd port 2182
> allow aaa:aaa
> signature disable
>
> set alert [hidden email](mailto:[hidden email])
>
> #-- HEARTBEAT ---------------------------------------------------------
> check host agp-heartbeat address 127.0.0.1 every 2 cycles
> if failed ping then alert
> else if succeeded then alert
> --
> Thanks.
>
> _______________________________
> Paul Tiseo, [hidden email](mailto:[hidden email])



--
Geoff Goas
Systems Engineer


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



--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d(+) s++:- a C++$ ULC(+)>+++$ !P--- L+>$ !E---? W+++$ !N* !o-- K--? w(+) !O---? !M- !V--? PS+? !PE Y+ PGP++>+++ !t-- !5 !X- R(+)>++* tv-? b(-) DI !D- G(+)>+ e+++ h--() r->$ y?*
------END GEEK CODE BLOCK------

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

Re: Periodic Heartbeat EMails

martinp@tildeslash.com
You can try M/Monit (https://mmonit.com) ... it has Monit heartbeat support and sends alert if monit is down. It has also better support for alternative alert channels (examples: https://mmonit.com/wiki/Notification/Notification) in addition to native mail+xmpp alerts.

Best regards,
Martin


On 26 Jan 2017, at 16:44, Guillaume François <[hidden email]> wrote:

I suppose the goal is to ensure, monit is able to report issue -> up and running and SMTP functionnal.

Let's suppose one of these two "dies" for any reason, an issue raises but you get never notified cause you are not aware that the system is down.

Having regular heartbeat from the monitoring system helps to know that it is up and running.

Again it just a personal guess but i can understand the need.

Like they says on some movies: 
bodyguards: "we are going to protect you VIP."
VIP "Ok but who is gonna to protect you (bodyguard)" 

2017-01-26 16:29 GMT+01:00 Geoff Goas <[hidden email]>:
Is the "heartbeat" just a periodic email? Why not put that in a cron job?

On Wed, Jan 25, 2017 at 11:36 AM, Tino Hendricks <[hidden email]> wrote:
Just out of curiosity, what is the benefit of having mails sent to you regardless of the system state?
I always consider it the biggest advantage of a monitoring that it _alerts_ you actively in case of emergency.


Am 23. Januar 2017 um 17:59:56, Paul Tiseo ([hidden email](mailto:[hidden email])) schrieb:

> So, I set monitrc to the below. Not sure where I am to add the "reminder" clause so that the heartbeat service is the one that emails me without fail (don't want this to apply to other services). Suggestions?
>
> set daemon 60 with start delay 15
> set logfile /apps/monit.log
> set pidfile /apps/monit.pid
> set idfile /apps/monit.id(http://monit.id)
> set statefile /apps/state
>
> set mailserver smtp.gmail.com(http://smtp.gmail.com) port 587
> username "[hidden email](mailto:[hidden email])" password "aaa"
> using tlsv12
>
> set httpd port 2182
> allow aaa:aaa
> signature disable
>
> set alert [hidden email](mailto:[hidden email])
>
> #-- HEARTBEAT ---------------------------------------------------------
> check host agp-heartbeat address 127.0.0.1 every 2 cycles
> if failed ping then alert
> else if succeeded then alert
> --
> Thanks.
>
> _______________________________
> Paul Tiseo, [hidden email](mailto:[hidden email])



--
Geoff Goas
Systems Engineer


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



--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d(+) s++:- a C++$ ULC(+)>+++$ !P--- L+>$ !E---? W+++$ !N* !o-- K--? w(+) !O---? !M- !V--? PS+? !PE Y+ PGP++>+++ !t-- !5 !X- R(+)>++* tv-? b(-) DI !D- G(+)>+ e+++ h--() r->$ y?*
------END GEEK CODE BLOCK------
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: Periodic Heartbeat EMails

Weedy
In reply to this post by Guillaume François
On 26 January 2017 at 10:44, Guillaume François
<[hidden email]> wrote:

> I suppose the goal is to ensure, monit is able to report issue -> up and
> running and SMTP functionnal.
>
> Let's suppose one of these two "dies" for any reason, an issue raises but
> you get never notified cause you are not aware that the system is down.
>
> Having regular heartbeat from the monitoring system helps to know that it is
> up and running.
>
> Again it just a personal guess but i can understand the need.

If this is all you need cron a "monit monitor <something>", a generic
check of some kind that would never time out. Maybe the default system
one?

## Check general system resources such as load average, cpu and memory
## usage. Each test specifies a resource, conditions and the action to be
## performed should a test fail.
#
#  check system $HOST
#    if loadavg (1min) > 4 then alert
#    if loadavg (5min) > 2 then alert
#    if cpu usage > 95% for 10 cycles then alert
#    if memory usage > 75% then alert
#    if swap usage > 25% then alert

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

Re: Periodic Heartbeat EMails

Paul Tiseo
In reply to this post by Guillaume François
Exactly. I don't want to add another layer of monitoring so that I can monitor the monitor. ;)

cron would be acceptable as a fallback if monit can't do it, I guess, except that I have to add another potential point of failure to be able to get emails out, ultimately to or through our mailserver, which is Gmail. I'd need some mail client of some sort.

m/monit seems like a "pricey" tool to have a worker that runs two small Node apps get me a heartbeat email (although I understand it's value in more complex scenarios)

Since monit can email, I was hoping to lasso it into serving me up a heartbeat, but it seems it can't do it. It will email me on state transitions only, which I get is the design intent.

PS: I had setup a heartbeat based on a check for a file that doesn't and will not exist, but it sends an ominous, alert-y email. :) Fine for me, but now I have to explain to others to not ignore alerts except one... yeah, minor thing, but I like to avoid death by a thousand cuts. :)

On Thu, Jan 26, 2017 at 10:48 AM Guillaume François <[hidden email]> wrote:
I suppose the goal is to ensure, monit is able to report issue -> up and running and SMTP functionnal.

Let's suppose one of these two "dies" for any reason, an issue raises but you get never notified cause you are not aware that the system is down.

Having regular heartbeat from the monitoring system helps to know that it is up and running.

Again it just a personal guess but i can understand the need.

Like they says on some movies: 
bodyguards: "we are going to protect you VIP."
VIP "Ok but who is gonna to protect you (bodyguard)" 

2017-01-26 16:29 GMT+01:00 Geoff Goas <[hidden email]>:
Is the "heartbeat" just a periodic email? Why not put that in a cron job?

On Wed, Jan 25, 2017 at 11:36 AM, Tino Hendricks <[hidden email]> wrote:
Just out of curiosity, what is the benefit of having mails sent to you regardless of the system state?
I always consider it the biggest advantage of a monitoring that it _alerts_ you actively in case of emergency.


Am 23. Januar 2017 um 17:59:56, Paul Tiseo ([hidden email](mailto:[hidden email])) schrieb:

> So, I set monitrc to the below. Not sure where I am to add the "reminder" clause so that the heartbeat service is the one that emails me without fail (don't want this to apply to other services). Suggestions?
>
> set daemon 60 with start delay 15
> set logfile /apps/monit.log
> set pidfile /apps/monit.pid
> set idfile /apps/monit.id(http://monit.id)
> set statefile /apps/state
>
> set mailserver smtp.gmail.com(http://smtp.gmail.com) port 587
> username "[hidden email](mailto:[hidden email])" password "aaa"
> using tlsv12
>
> set httpd port 2182
> allow aaa:aaa
> signature disable
>
> set alert [hidden email](mailto:[hidden email])
>
> #-- HEARTBEAT ---------------------------------------------------------
> check host agp-heartbeat address 127.0.0.1 every 2 cycles
> if failed ping then alert
> else if succeeded then alert
> --
> Thanks.
>
> _______________________________
> Paul Tiseo, [hidden email](mailto:[hidden email])



--
Geoff Goas
Systems Engineer


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



--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d(+) s++:- a C++$ ULC(+)>+++$ !P--- L+>$ !E---? W+++$ !N* !o-- K--? w(+) !O---? !M- !V--? PS+? !PE Y+ PGP++>+++ !t-- !5 !X- R(+)>++* tv-? b(-) DI !D- G(+)>+ e+++ h--() r->$ y?*
------END GEEK CODE BLOCK------
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
--
Thanks.

_______________________________
Paul Tiseo, [hidden email]

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