OPNsense Forum

English Forums => General Discussion => Topic started by: xxavvv123 on December 26, 2023, 03:59:42 PM

Title: Using Monit to Email a Notification when script is ran
Post by: xxavvv123 on December 26, 2023, 03:59:42 PM
Merry day after Christmas to everyone!

I have email notifications setup and working as expected in Monit.
I have a crontab setup to run a certain script 1-2 times a month.

How can I have monit send out an email everytime this script is ran?
Title: Re: Using Monit to Email a Notification when script is ran
Post by: Fright on December 29, 2023, 07:22:33 PM
Hi
I would try to add logging to a file to the script (something like "super-duper script completed successfully/with an error"), then add log-file monitoring (https://docs.opnsense.org/manual/monit.html#example-3) in monit for "super-duper" content: in this case the line from the log will be sent to your email  ;)