Commit e27519ca authored by Robert Dietrich's avatar Robert Dietrich

moved collectd conf and pid to global pika conf

parent 69d913a6
......@@ -10,8 +10,8 @@ touch $ERROR_FILE
# grep for various errors in logfile
echo "search for errors in collectd log file:"
grep -m 10 -i "error" $COLLECTD_LOGFILE >> $ERROR_FILE
grep -m 1 "uc_update" $COLLECTD_LOGFILE >> $ERROR_FILE
grep -m 10 -i "error" $PIKA_COLLECTD_LOGFILE >> $ERROR_FILE
grep -m 1 "uc_update" $PIKA_COLLECTD_LOGFILE >> $ERROR_FILE
# search for error in debug output (only for files not older than 1 day)
files="$(find /tmp/pika_debug/pika_* -mtime -1)"
if [ ! -z "$files" ]; then
......
......@@ -8,7 +8,7 @@ MAILTEXT_FILE=${PIKA_LOGPATH}/mailtext_collectd
touch $MAILTEXT_FILE
# grep for various errors in logfile
cat $COLLECTD_LOGFILE | grep -i "error" >> $MAILTEXT_FILE
cat $PIKA_COLLECTD_LOGFILE | grep -i "error" >> $MAILTEXT_FILE
# search for error in debug output (only for files not older than 1 day)
files="$(find /tmp/pika_debug/pika_* -mtime -1)"
for file in "$files"
......
#!/bin/bash
# local collectd config file
COLLECTD_CONF=/tmp/pika_collectd.conf
# collectd call
COLLECTD_PID_FILE=/tmp/pika_collectd.pid
DAEMON="${PIKA_INSTALL_PATH}/collectd/${COLLECTD_VERSION}/sbin/collectd -C ${COLLECTD_CONF} -P ${COLLECTD_PID_FILE}"
DAEMON="${PIKA_INSTALL_PATH}/collectd/${COLLECTD_VERSION}/sbin/collectd -C ${PIKA_COLLECTD_CONF} -P ${PIKA_COLLECTD_PID_FILE}"
# check if any jobs are already running on the local node
if [ ${LOCAL_JOBS_RUNNING} -eq 0 ]; then
......
......@@ -16,12 +16,7 @@ function pika_install() {
}
function pika_start() {
# local collectd config file
COLLECTD_CONF=/tmp/pika_collectd.conf
# collectd call
COLLECTD_PID_FILE=/tmp/pika_collectd.pid
DAEMON="${PIKA_INSTALL_PATH}/collectd/${COLLECTD_VERSION}/sbin/collectd -C ${COLLECTD_CONF} -P ${COLLECTD_PID_FILE}"
DAEMON="${PIKA_INSTALL_PATH}/collectd/${COLLECTD_VERSION}/sbin/collectd -C ${PIKA_COLLECTD_CONF} -P ${PIKA_COLLECTD_PID_FILE}"
touch $DEBUG_PATH
......@@ -63,4 +58,4 @@ else
echo "$1 is not supported."
;;
esac
fi
\ No newline at end of file
fi
......@@ -2,7 +2,6 @@
#requires a source of /sw/taurus/tools/pika/pika-current.conf
#source /sw/taurus/tools/pika/pika-current.conf
#COLLECTD_CONF=/tmp/pika_collectd.conf
CD_INST_PATH=$PIKA_INSTALL_PATH/collectd/$COLLECTD_VERSION
CUSTOM_TYPES_DIR=$PIKA_INSTALL_PATH/collectd/$COLLECTD_VERSION/share/collectd
......@@ -11,17 +10,17 @@ COLLECTD_PYTHON_PLUGIN_PATH=$PIKA_ROOT/daemon/collectd/collectd-plugins/python
# set hostname to avoid systemcall for every metric dispatch and copy collectd.conf into /tmp
hostshort=`hostname -s`
sed "/#HostnameReplace/cHostname ${hostshort}" \
${PIKA_ROOT}/daemon/collectd/collectd_template.conf > ${COLLECTD_CONF}
${PIKA_ROOT}/daemon/collectd/collectd_template.conf > ${PIKA_COLLECTD_CONF}
# set the path and name of the collectd logfile
sed -i '/<Plugin logfile>/,/Plugin>/'" s|File.*|File \"${COLLECTD_LOGFILE}\"|" ${COLLECTD_CONF}
sed -i '/<Plugin logfile>/,/Plugin>/'" s|File.*|File \"${PIKA_COLLECTD_LOGFILE}\"|" ${PIKA_COLLECTD_CONF}
# use + as sed separator
sed -i -e "s+CD_INST_PATH+${CD_INST_PATH}+" ${COLLECTD_CONF}
sed -i -e "s+CUSTOM_TYPES_DIR+${CUSTOM_TYPES_DIR}+" ${COLLECTD_CONF}
sed -i -e "s+CD_INST_PATH+${CD_INST_PATH}+" ${PIKA_COLLECTD_CONF}
sed -i -e "s+CUSTOM_TYPES_DIR+${CUSTOM_TYPES_DIR}+" ${PIKA_COLLECTD_CONF}
# set python module path
sed -i "/ModulePath/c \ \ ModulePath \"${COLLECTD_PYTHON_PLUGIN_PATH}\"" ${COLLECTD_CONF}
sed -i "/ModulePath/c \ \ ModulePath \"${COLLECTD_PYTHON_PLUGIN_PATH}\"" ${PIKA_COLLECTD_CONF}
# Check for lustre and, if available reset counters
LUSTRE_PATH=/proc/fs/lustre
......@@ -37,22 +36,22 @@ if [ -d "${LUSTRE_PATH}" ]; then
fi
else
echo -e "Disable Lustre plugin. ${LUSTRE_PATH} not found." >> $DEBUG_PATH 2>&1
sed -i "/Import \"lustre_bw\"/,/<\/Module>/"' s/^/#/' "${COLLECTD_CONF}"
sed -i "/Import \"lustre_bw\"/,/<\/Module>/"' s/^/#/' "${PIKA_COLLECTD_CONF}"
fi
# set InfluxDB access settings
sed -i "/#INFLUXHOST/c \ \ \ \ host \"${INFLUXDB_HOST}\"" ${COLLECTD_CONF}
sed -i "/#INFLUXPORT/c \ \ \ \ port \"${INFLUXDB_PORT}\"" ${COLLECTD_CONF}
sed -i "/#INFLUXUSER/c \ \ \ \ user \"${INFLUXDB_USER}\"" ${COLLECTD_CONF}
sed -i "/#INFLUXPWD/c \ \ \ \ pwd \"${INFLUXDB_PASSWORD}\"" ${COLLECTD_CONF}
sed -i "/#INFLUXDBNAME/c \ \ \ \ database \"${INFLUXDB_DATABASE}\"" ${COLLECTD_CONF}
sed -i "/#INFLUXHOST/c \ \ \ \ host \"${INFLUXDB_HOST}\"" ${PIKA_COLLECTD_CONF}
sed -i "/#INFLUXPORT/c \ \ \ \ port \"${INFLUXDB_PORT}\"" ${PIKA_COLLECTD_CONF}
sed -i "/#INFLUXUSER/c \ \ \ \ user \"${INFLUXDB_USER}\"" ${PIKA_COLLECTD_CONF}
sed -i "/#INFLUXPWD/c \ \ \ \ pwd \"${INFLUXDB_PASSWORD}\"" ${PIKA_COLLECTD_CONF}
sed -i "/#INFLUXDBNAME/c \ \ \ \ database \"${INFLUXDB_DATABASE}\"" ${PIKA_COLLECTD_CONF}
which nvidia-smi >> $DEBUG_PATH 2>&1
# disable (comment out) the NVML plugin if nvidia-smi is not available or CUDA driver not installed
if ! [ -x "$(command -v nvidia-smi)" ] || [ "$(nvidia-smi | grep -c failed)" -gt 0 ]; then
echo -e "\nDisable GPU NVIDIA plugin (no nvidia-smi or CUDA driver)." >> $DEBUG_PATH 2>&1
sed -i "/<LoadPlugin gpu_nvidia>/,/gpu_nvidia_end/"' s/^/#/' "${COLLECTD_CONF}"
sed -i "/<LoadPlugin gpu_nvidia>/,/gpu_nvidia_end/"' s/^/#/' "${PIKA_COLLECTD_CONF}"
fi
# get the architecture directory of Likwid perfgroup
......@@ -79,26 +78,26 @@ if [ "$group_count" -gt 0 ]; then
startsecond=$((60-(group_count*mtime)))
echo -e "Set Likwid align second to $startsecond and measurement time to $mtime (arch: ${arch_dir})" >> $DEBUG_PATH 2>&1
sed -i '/<LoadPlugin likwid>/,/LoadPlugin/'" s/AlignRead.*/AlignRead $startsecond/" "${COLLECTD_CONF}"
sed -i "/Mtime/c \ \ Mtime \"$mtime\"" ${COLLECTD_CONF}
sed -i '/<LoadPlugin likwid>/,/LoadPlugin/'" s/AlignRead.*/AlignRead $startsecond/" "${PIKA_COLLECTD_CONF}"
sed -i "/Mtime/c \ \ Mtime \"$mtime\"" ${PIKA_COLLECTD_CONF}
group_string=`ls $LIKWID_INST_PATH/share/likwid/perfgroups/$arch_dir | grep "pika_metrics" | tr '\n' ',' | sed 's/.txt,/,/g' | sed 's/,*$//g'`
sed -i "/Groups/c \ \ Groups \"$group_string\"" ${COLLECTD_CONF}
sed -i "/Groups/c \ \ Groups \"$group_string\"" ${PIKA_COLLECTD_CONF}
#expose path to likwid library (needed to load collectd likwid plugin)
export LD_LIBRARY_PATH=${LIKWID_INST_PATH}/lib:${LD_LIBRARY_PATH}
# set the socket file from PIKA configuration
sed -i '/<Plugin unixsock>/,/Plugin>/'" s|SocketFile.*|SocketFile \"${PIKA_COLLECTD_SOCKET}\"|" ${COLLECTD_CONF}
sed -i '/<Plugin unixsock>/,/Plugin>/'" s|SocketFile.*|SocketFile \"${PIKA_COLLECTD_SOCKET}\"|" ${PIKA_COLLECTD_CONF}
else
echo -e "Error: No PIKA group definitions for LIKWID found! Disable LIKWID and unixsock plugins." >> $DEBUG_PATH 2>&1
sed -i "/likwid/,/likwid_end/"' s/^/#/' "${COLLECTD_CONF}"
sed -i "/LoadPlugin unixsock/,/Plugin>/"' s/^/#/' "${COLLECTD_CONF}"
sed -i "/likwid/,/likwid_end/"' s/^/#/' "${PIKA_COLLECTD_CONF}"
sed -i "/LoadPlugin unixsock/,/Plugin>/"' s/^/#/' "${PIKA_COLLECTD_CONF}"
fi
# disallow users to read collectd config file
chmod 640 ${COLLECTD_CONF}
chmod 640 ${PIKA_COLLECTD_CONF}
# start collectd
echo -e "\nStarting Collectd: $DAEMON" >> $DEBUG_PATH 2>&1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment