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"
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}
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