[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [EXTERNAL] Re: Generate a Test Message
From: |
Faine, Mark R. (MSFC-IS40)[NICS] |
Subject: |
RE: [EXTERNAL] Re: Generate a Test Message |
Date: |
Wed, 10 Jun 2020 16:56:44 +0000 |
Excellent idea, don't know why I didn't think of that.
Thanks!
-Mark
-----Original Message-----
From: monit-general <monit-general-bounces+mark.faine=nasa.gov@nongnu.org> On
Behalf Of Ron Kelley
Sent: Wednesday, June 10, 2020 11:53
To: monit-general@nongnu.org
Subject: [EXTERNAL] Re: Generate a Test Message
Quick and dirty way: Setup a cron job to log a message to /var/log/syslog and
then setup monit to watch for the message.
Example:
/etc/monit.d/monit.conf
------------------------
###############################################################################
# Send daily test message
###############################################################################
check file messages with path /var/log/message
if match "Daily monit alert" then alert
crontab file
------------------------
0 0 * * * /bin/logger "Daily monit alert"
------------------------
Hope this helps!
-Ron
On 6/10/20 12:48 PM, Faine, Mark R. (MSFC-IS40)[NICS] wrote:
> I am looking for a way to generate a message from Monit as a routine test
> just to ensure it is working and that we will receive alerts should any be
> generated.The problem is that if we have it configured properly and things
> are running well it can be a while before we see any messages from Monit. In
> this time, it is possible, even if unlikely, that there is a problem with
> Monit somewhere that has gone unnoticed and when something does happen we
> won't be notified.In order to prevent this, we are looking for a way to make
> Monit generate a test notice at least once per day to ensure it is
> functioning properly. I have googled for this and seen a few ideas for
> forcing a failure and changing the message but I was hoping that there may be
> a better way.
>
> Thanks,
>
> -Mark
>