Skip to content

Commit

Permalink
Add print of recent jobs running on nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
OleHolmNielsen committed Jul 1, 2022
1 parent f34efa3 commit 21ef8a6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions triggers/notify_nodes_down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ my_state=down
# This will make the trigger permanent:
# my_flags="--flags=PERM"

# sacct output fields
export SACCT_FORMAT="JobID,JobName,Partition,User,Account,NodeList,State,ExitCode"

# Check that we run as the slurm user
if test "`id -nu`" != "$slurm_user"
then
Expand All @@ -28,6 +31,16 @@ fi
function my_tasks() {
# Print node info
sinfo -lRN
# Select Nodelist with state $my_state
# (the paste command is from the coreutils package)
nodelist=`sinfo -h -t $my_state -o "%N" | paste -d ,`
if [[ -n "$nodelist" ]]
then
echo
echo "Recent jobs running on nodes $nodelist"
sacct --nodelist=$nodelist -S now-600
sinfo -N -n $nodelist
fi
# Submit trigger for next event ($0 = this script)
echo Setting new trigger --node --$my_state --program=$0
strigger --set --node --$my_state --program=$0 $my_flags
Expand Down

0 comments on commit 21ef8a6

Please sign in to comment.