0

For my backup, external disk space is mounted via cronjob as /mnt/backup on a Ubuntu machine every night. When the backup is complete, the disk is unmounted. No need to expose the backup drive to potential attackers on this webserver.

From time to time, this backup drive runs full, which is ... yep, Linux does not like full disks. So I told monit to alert on low disk space.

check filesystem backup with path /mnt/backup
        if space usage > 85% then alert

That works, but whenever the backup is complete and the disk is unmounted, monit goes into "Status: Does not exist" and raises a flag. Is there an option to tell monit not to send any alert, if the filesystem does not exist?

According to the monit manual, each possible action will do something "and send an alert".

BurninLeo
  • 860
  • 2
  • 11
  • 28

1 Answers1

2

According to https://www.mmonit.com/monit/documentation/monit.html#SERVICE-POLL-TIME, you can limit the time Monit will monitor the filesystem. As long as the backup start at the same time, this will prevent some useless messages.

lutzmad
  • 71
  • 3
  • The service is listed as "initializing" while waiting for the time to come, i.e., it does not throw an error and won't show up as warning in M/Monit. I think, that is the solution, I have been hoping for - thanks a lot! – BurninLeo Jul 14 '22 at 09:16
  • As long as the service is not monitored, the status is "initializing". A more useful status will shown after the first monitoring interval in the given time frame. Unfortunately, the status will reset to "initializing" with the next monitor reload. But this will prevent useless messages. – lutzmad Jul 14 '22 at 10:17