From b1fb301f6e4d7b6e450bce70219afd62b67464ef Mon Sep 17 00:00:00 2001 From: Andy Witter Date: Mon, 21 Oct 2013 08:20:29 -0400 Subject: [PATCH] Add munin config to Monitoring servers. --- GenaSYS.sh | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/GenaSYS.sh b/GenaSYS.sh index 4edc6e8..6369735 100755 --- a/GenaSYS.sh +++ b/GenaSYS.sh @@ -69,6 +69,7 @@ TMPREVZONEFILE="${TMPFOLDER}/tmprevzonefile.txt" TMPOSRFNODES="${TMPFOLDER}/tmposrfnodes" TMPOPENSRF_XML="${TMPFOLDER}/tmpopensrf.xml" TMPNAGIHOSTS="${TMPFOLDER}/hosts.cfg" +TMPMUNINCONF="${TMPFOLDER}/munin.conf" PSQL_VERSION="9.1" [ -z $CONFIG_FILE ] && CONFIG_FILE="$WD/genasys.conf" NEW_CONFIG_FILE="$OUTDIR/genasys.conf" @@ -2321,7 +2322,7 @@ do MUNIN_HOST=$( echo "${MUNINODE}" | tr '[:lower:]' '[:upper:]' ) MUNIN_CFG_FILE="${OUTDIR}/${MUNINODE}/etc/munin/munin-node.conf" mkdir -p "${OUTDIR}/${MUNINODE}/etc/munin" - echo '### Generated by GenaSYS' >> ${MUNIN_CFG_FILE} + echo "### Generated by GenaSYS $_VERSION for Evergreen $EG_VER" >> ${MUNIN_CFG_FILE} echo "host_name ${MUNINODE}.${CLUSTERDOMAINNAME}" >> ${MUNIN_CFG_FILE} printf "allow $MONITOR01_IP # IP address of the monitor server\n" >> ${MUNIN_CFG_FILE} printf "allow $MONITOR02_IP # IP address of the monitor server\n" >> ${MUNIN_CFG_FILE} @@ -2332,10 +2333,26 @@ do eval echo -e "host \$${MUNIN_HOST#*-}_IP \# Host IP address" >> ${MUNIN_CFG_FILE} fi done -## Munin on monitor servers -for MUNINODE in ${MACHINES_MONITOR} +## Build munin.conf for monitor servers. +for MUNINODE in ${MACHINES_NO_BRICKS} +do + MUNIN_HOST=$( echo "${MUNINODE}" | tr '[:lower:]' '[:upper:]' ) + echo "[${MUNINODE}.${CLUSTERDOMAINNAME}]" >> $TMPMUNINCONF + if echo $MUNINODE | grep -q lvs0 + then + eval echo -e "\\\taddress \$${MUNIN_HOST#*-}_PRIVATE_IP" >> $TMPMUNINCONF + else + eval echo -e "\\\taddress \$${MUNIN_HOST#*-}_IP" >> $TMPMUNINCONF + fi + echo -e "\tuse_node_name yes" >> $TMPMUNINCONF + echo >> $TMPMUNINCONF +done + +## copy munin.conf to monitor servers. +for MONITOR in ${MACHINES_MONITOR} do - echo $MMACHINES_MONITOR + mkdir -p "$OUTDIR/$MONITOR/etc/munin" + cp -f "$TMPMUNINCONF" "$OUTDIR/$MONITOR/etc/munin" done -- 2.11.0