changed fix Supernode Hostnames

This commit is contained in:
stebifan 2016-05-06 10:19:08 +02:00
parent 9163672a42
commit 8b479fa9bf

View File

@ -33,7 +33,7 @@ while [ true ] ; do
else else
echo 0 > /etc/supernode-status/supernode.status echo 0 > /etc/supernode-status/supernode.status
fi fi
echo "collectd.gateways.troisdorf5.sn-status $online `date +%s`" | nc -q 0 10.188.1.27 2003 echo "collectd.gateways.{{ sn_hostname }}.sn-status $online `date +%s`" | nc -q 0 10.188.1.27 2003
} }
# Supernode on # # Supernode on #
supernode_on () { supernode_on () {
@ -48,7 +48,7 @@ while [ true ] ; do
else else
echo 2 > /etc/supernode-status/supernode.status echo 2 > /etc/supernode-status/supernode.status
fi fi
echo "collectd.gateways.troisdorf5.sn-status $online `date +%s`" | nc -q 0 10.188.1.27 2003 echo "collectd.gateways.{{ sn_hostname }}.sn-status $online `date +%s`" | nc -q 0 10.188.1.27 2003
} }
# Restart Services # # Restart Services #
supernode_fail () { supernode_fail () {
@ -59,7 +59,7 @@ while [ true ] ; do
/usr/sbin/service radvd restart /usr/sbin/service radvd restart
/usr/sbin/service isc-dhcp-server restart /usr/sbin/service isc-dhcp-server restart
echo 0 > /etc/supernode-status/supernode.status echo 0 > /etc/supernode-status/supernode.status
echo "collectd.gateways.troisdorf5.sn-status $online `date +%s`" | nc -q 0 10.188.1.27 2003 echo "collectd.gateways.{{ sn_hostname }}.sn-status $online `date +%s`" | nc -q 0 10.188.1.27 2003
} }
# who am i ? # # who am i ? #
if [ $iam = "troisdorf5" ]; if [ $iam = "troisdorf5" ];
@ -120,10 +120,10 @@ while [ true ] ; do
do do
x=`pidof $service`; x=`pidof $service`;
if [ "$x" = "" ]; then if [ "$x" = "" ]; then
echo "collectd.gateways.troisdorf5.$service 0 `date +%s`" | nc -q 0 10.188.1.27 2003 echo "collectd.gateways.{{ sn_hostname }}.$service 0 `date +%s`" | nc -q 0 10.188.1.27 2003
echo 0 > /etc/supernode-status/"$service".status echo 0 > /etc/supernode-status/"$service".status
else else
echo "collectd.gateways.troisdorf5.$service 1 `date +%s`" | nc -q 0 10.188.1.27 2003 echo "collectd.gateways.{{ sn_hostname }}.$service 1 `date +%s`" | nc -q 0 10.188.1.27 2003
echo 1 > /etc/supernode-status/"$service".status echo 1 > /etc/supernode-status/"$service".status
fi fi
done done