I would like an email to be sent with the subject of that email being link is up at time xxxx.
then the body of the email to have the log file attached or printed.
currently, my script is as follows.
on the up
:global myVarDownTime
:log error “WAN link is up.”
/tool e-mail send to=“My Email address” subject=“$[/system identity get name] WAN Link is up on $[/system clock get time].”
this works perfectly and am receiving the email however when I try to add the log file the email will not send and no error message is reported
Simply add this to the end of the netwatch script after the email
:log info “My Connection is now UP”
Also my script is similar but not quite the same.
:local sub1 ([/system clock get time])
/tool e-mail send from=“myemail@addresss.ca” body=“At $sub1 WAN Link is Up[” subject=“Wan Link is Up-QUAD9” to=“myemail@address.ca”
:log info “My Connection is Back Up!”
You may be interested in my script “Notify on host up and down”.
It gives some extra functionality (like simple state machine and dependencies) and sends nicely formatted notifications via e-mail, telegram and matrix.