diff --git a/modules/rhizo_base/files/bin/check_amp_status.sh b/modules/rhizo_base/files/bin/check_amp_status.sh index 87ddc54..e791b9b 100755 --- a/modules/rhizo_base/files/bin/check_amp_status.sh +++ b/modules/rhizo_base/files/bin/check_amp_status.sh @@ -2,7 +2,8 @@ # Check for AMP status on each BTS, from BTS1 up to BTS3 RHIZO_SCRIPT="/home/rhizomatica/bin" . $RHIZO_SCRIPT/vars.sh -for bts in $BTS0 $BTS1 $BTS2; do + +for bts in "${BTS_MASTER[@]}" ; do echo "BTS $bts:"; ssh root@$bts sbts2050-util sbts2050-pwr-status | grep Amp; done diff --git a/modules/rhizo_base/files/bin/check_broken.sh b/modules/rhizo_base/files/bin/check_broken.sh index 88ca89a..cd065da 100755 --- a/modules/rhizo_base/files/bin/check_broken.sh +++ b/modules/rhizo_base/files/bin/check_broken.sh @@ -8,7 +8,7 @@ NACK=`echo "show lchan" | nc -q1 localhost 4242 | grep "BROKEN UNUSABLE Error re if [ $NACK -gt 0 ]; then waitfor0calls _bts=0 - for bts in $BTS0 $BTS1 $BTS2; do + for bts in "${BTS[@]}" ; do echo "Dropping BTS connection $_bts due to $NACK broken (NACK) Channels" echo -e "enable\n drop bts connection $_bts oml" | nc -q1 localhost 4242 done diff --git a/modules/rhizo_base/files/bin/turn_off_amplifier.sh b/modules/rhizo_base/files/bin/turn_off_amplifier.sh index 6810a5d..116ca3d 100755 --- a/modules/rhizo_base/files/bin/turn_off_amplifier.sh +++ b/modules/rhizo_base/files/bin/turn_off_amplifier.sh @@ -4,7 +4,7 @@ RHIZO_SCRIPT="/home/rhizomatica/bin" . $RHIZO_SCRIPT/vars.sh LOGFILE="/var/log/monitor_amp.log" -for bts in $BTS0 $BTS1 $BTS2; do +for bts in "${BTS_MASTER[@]}" ; do logc "Turning off AMP on BTS $bts:"; ssh root@$bts "sbts2050-util sbts2050-pwr-enable 1 1 0"; done diff --git a/modules/rhizo_base/files/bin/turn_on_amplifier.sh b/modules/rhizo_base/files/bin/turn_on_amplifier.sh index 16ce888..e8f7c88 100755 --- a/modules/rhizo_base/files/bin/turn_on_amplifier.sh +++ b/modules/rhizo_base/files/bin/turn_on_amplifier.sh @@ -4,7 +4,7 @@ RHIZO_SCRIPT="/home/rhizomatica/bin" . $RHIZO_SCRIPT/vars.sh LOGFILE="/var/log/monitor_amp.log" -for bts in $BTS0 $BTS1 $BTS2; do +for bts in "${BTS_MASTER[@]}" ; do logc "Turning on AMP on BTS $bts:"; ssh root@$bts "sbts2050-util sbts2050-pwr-enable 1 1 1"; done diff --git a/modules/rhizo_base/templates/vars.sh.erb b/modules/rhizo_base/templates/vars.sh.erb index 8122505..259dfcf 100644 --- a/modules/rhizo_base/templates/vars.sh.erb +++ b/modules/rhizo_base/templates/vars.sh.erb @@ -6,16 +6,22 @@ function logc() { echo "[`date '+%d-%m-%Y %H:%M:%S'`] $txt" >> $LOGFILE } -#BTSs IP addresses +#BTSs IP addresses (for amps etc) +declare -a BTS +declare -a BTS_MASTER <% @bts.each_with_index do |bts, index| -%> -BTS<%= index %>=<%= bts["ip"] %> +BTS[<%= index %>]=<%= bts["ip"] %> +<% if bts ["model"] == '2050M' -%> +BTS_MASTER[<%= index %>]=<%= bts["ip"] %> +<% end -%> <% end -%> LATENCY_HOST=<%= @latency_check_address %> LATENCY_TINC=<%= @latency_check_vpn %> STAT_DISK=<%= @stats_disk %> STAT_IF=<%= @stats_if %> +_PUB_IF=<%= @stats_if %> RECIPIENTS="<%= @mail_admins -%>"