PURPOSE_="Generate config files needed for Evergreen-ILS Cluster"
SYNOPSIS_="$NAME_"
REQUIRES_="standard GNU commands, apt, dpkg"
- VERSION_="1.18"
- DATE_="2010-09-23; last update: 2013-10-30"
+ VERSION_="1.19"
+ DATE_="2010-09-23; last update: 2013-11-04"
AUTHOR_="Andy Witter <awitter@georgialibraries.org>"
URL_="http://evergreen-ils.org"
CATEGORY_="devel"
sed -i 's^<!-- <base_url>http://syndetics.com/index.aspx</base_url> -->^<base_url>http://syndetics.com/index.aspx</base_url>^g' $TMPOPENSRF_XML
fi
+### Start setup of munin.conf file
+cp -f ${TEMPLATEDIR}/monitor/munin.conf $TMPMUNINCONF
+
### Set the hostnames and IPs of heads and drones.
### And create the configuration files as needed.
printf '\tuse\t\tgeneric-host\n}\n' >>$TMPNAGIHOSTS
### Build munin-node.conf file.
- eval echo "host_name \$BRICKHOSTNAME${BRICK}-head" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
+ #eval echo "host_name \$BRICKHOSTNAME${BRICK}-head" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
+ cp -f $TEMPLATEDIR/monitor/munin-node.conf ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
+ eval sed -i "s^MONITORED_NODENAME.CLUSTER_DOMAIN_NAME^$(eval echo \$BRICKHOSTNAME${BRICK}-head.$CLUSTERDOMAINNAME)^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
echo "allow $MONITOR01_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
echo "allow $MONITOR02_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
- eval echo "host \$BRICKHOSTNAME${BRICK}_HEAD_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
+ #eval echo "host \$BRICKHOSTNAME${BRICK}_HEAD_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
### Build munin.conf file.
- eval echo -e "[\$BRICKHOSTNAME${BRICK}-head.${CLUSTERDOMAINNAME}]" >>$TMPMUNINCONF
- eval echo -e "\\\taddress \$BRICKHOSTNAME${BRICK}_HEAD_IP" >>$TMPMUNINCONF
- eval echo -e "\\\tuse_node_name yes" >>$TMPMUNINCONF
+ eval echo -e "[${CLUSTERDOMAINNAME};\$BRICKHOSTNAME${BRICK}-head]" >>$TMPMUNINCONF
+ #eval echo -e "\\\taddress \$BRICKHOSTNAME${BRICK}_HEAD_IP" >>$TMPMUNINCONF
+ eval echo -e "\\\taddress \$BRICKHOSTNAME${BRICK}-head.${CLUSTERDOMAINNAME}" >>$TMPMUNINCONF
+ #eval echo -e "\\\thost_name \$BRICKHOSTNAME${BRICK}-head.${CLUSTERDOMAINNAME}" >>$TMPMUNINCONF
echo >>$TMPMUNINCONF
done
printf '\tuse\t\tgeneric-host\n}\n' >>$TMPNAGIHOSTS
### Build munin-node.conf file.
- eval echo "host_name \$BRICKHOSTNAME${BRICK}-head" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
+ #eval echo "host_name \$BRICKHOSTNAME${BRICK}-head" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
+ cp -f $TEMPLATEDIR/monitor/munin-node.conf ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
+ eval sed -i "s^MONITORED_NODENAME.CLUSTER_DOMAIN_NAME^$(eval echo \$BRICKHOSTNAME${BRICK}-head.$CLUSTERDOMAINNAME)^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
echo "allow $MONITOR01_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
echo "allow $MONITOR02_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
- eval echo "host \$BRICKHOSTNAME${BRICK}_HEAD_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
+ #eval echo "host \$BRICKHOSTNAME${BRICK}_HEAD_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/munin/munin-node.conf
### Build munin.conf file.
- eval echo -e "[\$BRICKHOSTNAME${BRICK}-head.${CLUSTERDOMAINNAME}]" >>$TMPMUNINCONF
- eval echo -e "\\\taddress \$BRICKHOSTNAME${BRICK}_HEAD_IP" >>$TMPMUNINCONF
- eval echo -e "\\\tuse_node_name yes" >>$TMPMUNINCONF
+ eval echo -e "[${CLUSTERDOMAINNAME}\;\$BRICKHOSTNAME${BRICK}-head]" >>$TMPMUNINCONF
+ #eval echo -e "\\\taddress \$BRICKHOSTNAME${BRICK}_HEAD_IP" >>$TMPMUNINCONF
+ eval echo -e "\\\taddress \$BRICKHOSTNAME${BRICK}-head.${CLUSTERDOMAINNAME}" >>$TMPMUNINCONF
+ #eval echo -e "\\\thost_name \$BRICKHOSTNAME${BRICK}-head.${CLUSTERDOMAINNAME}" >>$TMPMUNINCONF
echo >>$TMPMUNINCONF
for DRONE in $(seq $DRONECOUNT)
do
printf '\tuse\t\tgeneric-host\n}\n' >>$TMPNAGIHOSTS
### Build munin-node.conf file.
- eval echo "host_name \$BRICKHOSTNAME${BRICK}_DRONE${DRONE}" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})/etc/munin/munin-node.conf
- echo "allow $MONITOR01_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})/etc/munin/munin-node.conf
- echo "allow $MONITOR02_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})/etc/munin/munin-node.conf
- eval echo "host \$BRICKHOSTNAME${BRICK}_DRONE${DRONE}_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})/etc/munin/munin-node.conf
-
- ### Build munin.conf file.
- eval echo -e "[\$BRICKHOSTNAME${BRICK}_DRONE${DRONE}.${CLUSTERDOMAINNAME}]" >>$TMPMUNINCONF
- eval echo -e "\\\taddress \$BRICKHOSTNAME${BRICK}_DRONE${DRONE}_IP" >>$TMPMUNINCONF
- eval echo -e "\\\tuse_node_name yes" >>$TMPMUNINCONF
- echo >>$TMPMUNINCONF
+ #eval echo "host_name \$BRICKHOSTNAME${BRICK}_DRONE${DRONE}" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})/etc/munin/munin-node.conf
+ #echo "allow $MONITOR01_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})/etc/munin/munin-node.conf
+ #echo "allow $MONITOR02_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})/etc/munin/munin-node.conf
+ cp -f $TEMPLATEDIR/monitor/munin-node.conf ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})/etc/munin/munin-node.conf
+ eval sed -i "s^MONITORED_NODENAME.CLUSTER_DOMAIN_NAME^$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE}.$CLUSTERDOMAINNAME)^g" ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})/etc/munin/munin-node.conf
+ echo "allow $MONITOR01_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})/etc/munin/munin-node.conf
+ echo "allow $MONITOR02_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})/etc/munin/munin-node.conf
+ #eval echo "host \$BRICKHOSTNAME${BRICK}_DRONE${DRONE}_IP" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK}-drone0${DRONE})/etc/munin/munin-node.conf
+
+ ### Build munin.conf file.
+ eval echo -e "[${CLUSTERDOMAINNAME}\;\$BRICKHOSTNAME${BRICK}_DRONE${DRONE}]" >>$TMPMUNINCONF
+ #eval echo -e "\\\taddress \$BRICKHOSTNAME${BRICK}_DRONE${DRONE}_IP" >>$TMPMUNINCONF
+ eval echo -e "\\\taddress \$BRICKHOSTNAME${BRICK}_DRONE${DRONE}.${CLUSTERDOMAINNAME}" >>$TMPMUNINCONF
+ #eval echo -e "\\\thost_name \$BRICKHOSTNAME${BRICK}-head.${CLUSTERDOMAINNAME}" >>$TMPMUNINCONF
+ echo >>$TMPMUNINCONF
done
#echo
printf ")\n" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/openils/conf/.oils_brick.cfg
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 $_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}
- if echo $MUNINODE | grep -q lvs0
- then
- eval echo -e "host \$${MUNIN_HOST#*-}_PRIVATE_IP \# Host IP address" >> ${MUNIN_CFG_FILE}
- else
- eval echo -e "host \$${MUNIN_HOST#*-}_IP \# Host IP address" >> ${MUNIN_CFG_FILE}
- fi
+ cp -f ${TEMPLATEDIR}/monitor/munin-node.conf "${MUNIN_CFG_FILE}"
+ #echo "### Generated by GenaSYS $_VERSION for Evergreen $EG_VER" >> ${MUNIN_CFG_FILE}
+ #echo "host_name ${MUNINODE}.${CLUSTERDOMAINNAME}" >> ${MUNIN_CFG_FILE}
+ sed -i "s^MONITORED_NODENAME.CLUSTER_DOMAIN_NAME^${MUNINODE}.${CLUSTERDOMAINNAME}^g" ${MUNIN_CFG_FILE}
+ printf "allow ${MONITOR01_IP}\n" >> ${MUNIN_CFG_FILE}
+ printf "allow ${MONITOR02_IP}\n" >> ${MUNIN_CFG_FILE}
+ #if echo $MUNINODE | grep -q lvs0
+ #then
+ # eval echo -e "host \$${MUNIN_HOST#*-}_PRIVATE_IP \# Host IP address" >> ${MUNIN_CFG_FILE}
+ #else
+ # eval echo -e "host \$${MUNIN_HOST#*-}_IP \# Host IP address" >> ${MUNIN_CFG_FILE}
+ #fi
done
## Build munin.conf for monitor servers.
for MUNINODE in ${MACHINES_NO_BRICKS}
#for MUNINODE in ${ALL_MACHINES_LIST}
do
MUNIN_HOST=$( echo "${MUNINODE}" | tr '[:lower:]' '[:upper:]' )
- echo "[${MUNINODE}.${CLUSTERDOMAINNAME}]" >> $TMPMUNINCONF
+ echo "[${CLUSTERDOMAINNAME};${MUNINODE}]" >> $TMPMUNINCONF
if echo $MUNINODE | grep -q lvs0
then
- eval echo -e "\\\taddress \$${MUNIN_HOST#*-}_PRIVATE_IP" >> $TMPMUNINCONF
+ #eval echo -e "\\\taddress \$${MUNIN_HOST#*-}_PRIVATE_IP" >> $TMPMUNINCONF
+ eval echo -e "\\\taddress ${MUNINODE}.${CLUSTERDOMAINNAME}" >> $TMPMUNINCONF
else
- eval echo -e "\\\taddress \$${MUNIN_HOST#*-}_IP" >> $TMPMUNINCONF
+ #eval echo -e "\\\taddress \$${MUNIN_HOST#*-}_IP" >> $TMPMUNINCONF
+ eval echo -e "\\\taddress ${MUNINODE}.${CLUSTERDOMAINNAME}" >> $TMPMUNINCONF
fi
- echo -e "\tuse_node_name yes" >> $TMPMUNINCONF
+ #echo -e "\thost_name ${MUNINODE}.${CLUSTERDOMAINNAME}" >> $TMPMUNINCONF
echo >> $TMPMUNINCONF
done