-
Notifications
You must be signed in to change notification settings - Fork 99
/
Copy pathnotify_slurmdbd_resumed
executable file
·35 lines (28 loc) · 1.08 KB
/
notify_slurmdbd_resumed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
# Slurm trigger script for resumed slurmdbd daemon
# Homepage: https://github.com/OleHolmNielsen/Slurm_tools/
# MUST be executed by the slurm user, consistent with:
# scontrol show config | grep SlurmUser
# Configure these variables for your system:
slurm_user=slurm
slurm_notify=root
my_mail=/usr/bin/mailx
# This will make the trigger permanent:
# my_flags="--flags=PERM"
# Check that we run as the slurm user
if test "`id -nu`" != "$slurm_user"
then
echo ERROR: The strigger command must be executed by the $slurm_user user
exit -1
fi
# Commands to be run for notification
function my_tasks() {
echo The slurmdbd configuration in slurm.conf:
scontrol show config | grep AccountingStorageHost
# Submit trigger for next event ($0 = this script)
# Possible DBD triggers: --primary_slurmdbd_failure --primary_slurmdbd_resumed_operation
echo Setting new trigger --primary_slurmdbd_resumed --program=$0
strigger --set --primary_slurmdbd_resumed --program=$0 $my_flags
}
# Notify Slurm administrator of node state
my_tasks 2>&1 | $my_mail -s "Slurmdbd resumed: $@" $slurm_notify