diff --git a/roles/slurm-trigger/templates/node_down.sh.j2 b/roles/slurm-trigger/templates/node_down.sh.j2 index 679e18c7daa2b2f2e9dff282daf9d0a1f2967802..dba68ecf98d2fc4566e56d4a9da9425237eca3f0 100644 --- a/roles/slurm-trigger/templates/node_down.sh.j2 +++ b/roles/slurm-trigger/templates/node_down.sh.j2 @@ -1,8 +1,12 @@ #!/bin/bash # Notify the administrator of the failure using by e-mail -echo "On `hostname`:`date`:`whoami`: slurm-trigger event for NODE_FAILURE: $*" | `which mail` -s "NODE FAILURE $*" {{ admin_email }} +MESSAGE="On `hostname`:`date`:`whoami`: slurm-trigger event for NODE_FAILURE: $*" +MAIL_HEADER="NODE FAILURE $*" +echo "${MESSAGE}" | `which mail` -s "${MAIL_HEADER} FAILURE $*" {{ admin_email }} # Submit trigger for next primary slurmctld failure event TRIGGER_CMD="{{ slurm_dir }}/sbin/set_node_trigger.sh" +#write to syslog +logger "${MESSAGE}" FILE=/tmp/node_down.txt #COMMAND="su slurm -c $TRIGGER_CMD" diff --git a/roles/slurm-trigger/templates/primary_slurmctld_failure.sh.j2 b/roles/slurm-trigger/templates/primary_slurmctld_failure.sh.j2 index 61747379a436a63f89f8583d05ec5d8aa87cd9cb..aa64f934b929f49d073c6063e2fdd9acf2b4845a 100644 --- a/roles/slurm-trigger/templates/primary_slurmctld_failure.sh.j2 +++ b/roles/slurm-trigger/templates/primary_slurmctld_failure.sh.j2 @@ -1,8 +1,11 @@ #!/bin/bash # Notify the administrator of the failure using by e-mail -echo "On `hostname`:`date`:`who`: slurm-trigger event for Primary_SLURMCTLD_FAILURE" | `which mail` -s Primary_SLURMCTLD_FAILURE {{ admin_email }} +MESSASGE="On `hostname`:`date`:`who`: slurm-trigger event for Primary_SLURMCTLD_FAILURE" +echo "${MESSAGE}" | `which mail` -s Primary_SLURMCTLD_FAILURE {{ admin_email }} # Submit trigger for next primary slurmctld failure event TRIGGER_CMD="{{ slurm_dir }}/sbin/set_primary_slurmctld_failure_trigger.sh" +#log to syslog +logger "${MESSAGE}" FILE=/tmp/primary_down.txt #COMMAND="su slurm -c $TRIGGER_CMD" diff --git a/roles/slurm-trigger/templates/primary_slurmctld_resumed_operation.sh.j2 b/roles/slurm-trigger/templates/primary_slurmctld_resumed_operation.sh.j2 index b8e6788bccef5b36f65575c12b507ef9c624be09..e2a7ccb98443d17c6d6c91645279a1e5680088e2 100644 --- a/roles/slurm-trigger/templates/primary_slurmctld_resumed_operation.sh.j2 +++ b/roles/slurm-trigger/templates/primary_slurmctld_resumed_operation.sh.j2 @@ -1,8 +1,12 @@ #!/bin/bash # Notify the administrator of the failure using by e-mail -echo "On `hostname`:`date`:`whoami`: slurm-trigger event for Primary_SLURMCTLD_RESUMED" | `which mail` -s Primary_SLURMCTLD_RESUMED {{ admin_email }} +MESSAGE="On `hostname`:`date`:`whoami`: slurm-trigger event for Primary_SLURMCTLD_RESUMED" +echo "${MESSAGE}" | `which mail` -s Primary_SLURMCTLD_RESUMED {{ admin_email }} # Submit trigger for next primary slurmctld failure event +#write to syslog +logger "${MESSAGE}" + FILE=/tmp/primary_up.txt #COMMAND="su slurm -c {{ slurm_dir }}/sbin/set_primary_slurmctld_resumed_operation_trigger.sh" COMMAND="{{ slurm_dir }}/sbin/set_primary_slurmctld_resumed_operation_trigger.sh"