Skip to content
Snippets Groups Projects
Commit c966ff56 authored by Chris Hines's avatar Chris Hines
Browse files

Merge pull request #99 from CVL-GitHub/slurmbrach8

Slurmbrach8
parents 0fd5d73f c4d85c6b
No related branches found
No related tags found
No related merge requests found
......@@ -3,9 +3,10 @@ NHC_RM=slurm
HELPERDIR={{ nhc_dir }}/libexec/nhc
PATH={{ slurm_dir }}/bin:{{ nhc_dir }}/sbin:$PATH
LOGFILE=/var/log/nhc.log
LOG_LEVEL={{ nhc_log_level }}
CONFFILE="{{ nhc_dir }}/etc/nhc/{{ nhc_config_file }}"
NHC_EMAIL_TO= {{ nhc_emails }}
NHC_EMAIL_SUBJECT="Node failure"
NHC_EMAIL_TO={{ nhc_emails }}
NHC_EMAIL_SUBJECT={{ nhc_email_subject }}
NHC_LOOP_TIME="300"
......@@ -10,6 +10,7 @@ config_file=${CONFFILE-/etc/nhc/nhc.conf}
loop=${NHC_LOOP_TIME-300}
email_subject=${NHC_EMAIL_SUBJECT-notification}
logfile=${LOGFILE-/var/log/nhc.log}
loglevel=${LOG_LEVEL-0}
email_to=${NHC_EMAIL_TO-root}
function log() {
......@@ -27,7 +28,9 @@ function email() {
fi
}
log "Start health check ${config_file}"
if [ ${loglevel} -gt "0" ]; then
log "Start health check ${config_file}"
fi
nhc -c "${config_file}" > /root/nhc.log 2>&1 || { log "$(cat /root/nhc.log)" && email && exit 1; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment