[slurm-users] Non-Standard Mail Notification in Job

61 views
Skip to first unread message

Daniel Miliate via slurm-users

unread,
Dec 4, 2024, 4:39:55 PM12/4/24
to slurm...@lists.schedmd.com
Newbie here, 

I'm trying to send myself an email notification with a custom body/subject for notification of important events. Is this possible? I've tried a few things in the script below.

Thanks in advance and apologies if this is not how this listing works! 
- Daniel

---- Script ---- 
....
#SBATCH --mail-user= exa...@example.example
#SBATCH --export=ALL
#SBATCH --mail-type=ALL

# Both of these work 
which mail
which mailx
EMAIL="exa...@example.example"

# Attempt 1
echo "Test email body" | mail -s "Test Subject" "$EMAIL"

# Attempt 2
mail -s "hello" "$EMAIL"   <<EOF
hello
world
EOF

# Attempt 3 
echo "Specific Information" | mail -s "SLURM Job information" $EMAIL
---- End ----

Kevin Buckley via slurm-users

unread,
Dec 4, 2024, 8:14:26 PM12/4/24
to slurm...@lists.schedmd.com
On 2024/12/05 05:37, Daniel Miliate via slurm-users wrote:
>
> I'm trying to send myself an email notification with a custom body/subject
> for notification of important events. Is this possible? I've tried a few
> things in the script below.
The bits you may have missed:

The emails that Slurm sends out, controlled by the SBATCH directives,
are not send from the node on which the jobs runs, but from the
controller, which will typically have been given a mail configuration
that allows it to do so.

In order to send email from a job, you would need to ensure that all
of your compute nodes can send email to the required destinations.

Onee way to test mail from your compute nodes would be to salloc an
interactive session, and see if you can run your mail/mailx commands,
from the command line, on the node you get allocated.

--
slurm-users mailing list -- slurm...@lists.schedmd.com
To unsubscribe send an email to slurm-us...@lists.schedmd.com

John Hearns via slurm-users

unread,
Dec 5, 2024, 3:34:03 AM12/5/24
to Kevin Buckley, Slurm User Community List
I used to configure Postfix on the head node.
All compute nodes are then configured to use the head node as a relay.
Reply all
Reply to author
Forward
0 new messages