December 15, 20196 yr Is there any way to send attachments with the notify script? I'd like to send the rsync log with the e-mail if possible.
December 15, 20196 yr Attachments are not possible, but you can include messages (-m option). notify [-e "event"] [-s "subject"] [-d "description"] [-i "normal|warning|alert"] [-m "message"] [-x] [-t] [add] create a notification use -e to specify the event use -s to specify a subject use -d to specify a short description use -i to specify the severity use -m to specify a message (long description) use -x to create a single notification ticket use -r to specify recipients and not use default use -t to force send email only (for testing) all options are optional notify init Initialize the notification subsystem. notify smtp-init Initialize sendmail configuration (ssmtp in our case). notify get Output a json-encoded list of all the unread notifications. notify archive file Move file from 'unread' state to 'archive' state.
January 16, 20224 yr Hi, how exactly i can use -m parameter to add the content of the script log file to mail? Thanks Edited January 16, 20224 yr by Muzzy
January 16, 20224 yr -m "This is the message" A log file however may be pretty long to do this, and would no doubt include CRs, quotes etc that you would have to properly escape.
January 16, 20224 yr So I understand correctly that there is no way to send either the log file or its contents via the internal notification system?
January 16, 20224 yr Of course I can, but reading the log in an email anywhere in the world is easier than connecting to vpn via some secure device, logging in to the server, finding the log and checking. I'm just asking, it would just be easier.
January 16, 20224 yr The notify script was never designed for what you want to do. Investigate using the sendmail command or your own custom script using php's mail command etc...
February 22, 20224 yr On 1/16/2022 at 3:53 PM, Muzzy said: Hi, how exactly i can use -m parameter to add the content of the script log file to mail? Thanks This works for me: /usr/local/emhttp/plugins/dynamix/scripts/notify -e "test" -s "test2" -d "test3" -i "normal" -m "$(cat /path/to/logfile.log)"
February 22, 20224 yr The message with the -m option is only available in email notifications. The message can be indeed the content of a log file.
March 6, 20224 yr On 2/22/2022 at 7:34 PM, emvau said: /usr/local/emhttp/plugins/dynamix/scripts/notify -e "test" -s "test2" -d "test3" -i "normal" -m "$(cat /path/to/logfile.log)" Awesome, it works 🙂 Thanks
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.