From 7c65394a372177d94302416c2064acb28fc40310 Mon Sep 17 00:00:00 2001 From: Ciaby Date: Mon, 16 Feb 2015 14:24:42 -0600 Subject: [PATCH] Still more refactoring on monitor code --- .../files/bin/check_amp_status.sh | 4 +-- .../files/bin/turn_on_amplifier.sh | 6 ++-- .../templates/vars.sh.erb | 30 ------------------- 3 files changed, 5 insertions(+), 35 deletions(-) diff --git a/modules/rhizomatica_base_system/files/bin/check_amp_status.sh b/modules/rhizomatica_base_system/files/bin/check_amp_status.sh index b963eba..0d4e7b2 100755 --- a/modules/rhizomatica_base_system/files/bin/check_amp_status.sh +++ b/modules/rhizomatica_base_system/files/bin/check_amp_status.sh @@ -1,7 +1,7 @@ #!/bin/sh -# Check for AMP status on each BTS, from BTS1 up to BTS10 +# Check for AMP status on each BTS, from BTS1 up to BTS3 . ./vars.sh -for bts in $BTS1 $BTS2 $BTS3 $BTS4 $BTS5 $BTS6 $BTS7 $BTS7 $BTS8 $BTS9 $BTS10; do +for bts in $BTS1 $BTS2 $BTS3; do echo "BTS $bts:"; ssh root@$bts sbts2050-util sbts2050-pwr-status | grep Amp; done diff --git a/modules/rhizomatica_base_system/files/bin/turn_on_amplifier.sh b/modules/rhizomatica_base_system/files/bin/turn_on_amplifier.sh index b05560a..1073553 100755 --- a/modules/rhizomatica_base_system/files/bin/turn_on_amplifier.sh +++ b/modules/rhizomatica_base_system/files/bin/turn_on_amplifier.sh @@ -1,9 +1,9 @@ #!/bin/bash -# Turn on AMP on all BTS, from BTS1 to BTS 10 +# Turn on AMP on all BTS, from BTS1 to BTS3 . ./vars.sh LOGFILE="/var/log/rhizomatica/monitor_amp.log" -for bts in $BTS1 $BTS2 $BTS3 $BTS4 $BTS5 $BTS6 $BTS7 $BTS7 $BTS8 $BTS9 $BTS10; do - logc "Turning on AMP on BTS $bts:" +for bts in $BTS1 $BTS2 $BTS3; do + logc "Turning on AMP on BTS $bts:"; ssh root@$bts "sbts2050-util sbts2050-pwr-enable 1 1 1"; done diff --git a/modules/rhizomatica_base_system/templates/vars.sh.erb b/modules/rhizomatica_base_system/templates/vars.sh.erb index b1d6dec..a1c8b14 100644 --- a/modules/rhizomatica_base_system/templates/vars.sh.erb +++ b/modules/rhizomatica_base_system/templates/vars.sh.erb @@ -11,41 +11,11 @@ function logc() { <% if @bts1_ip_address %> BTS1=<%= @bts1_ip_address %> <% end %> - <% if @bts2_ip_address %> BTS2=<%= @bts2_ip_address %> <% end %> - <% if @bts3_ip_address %> BTS3=<%= @bts3_ip_address %> <% end %> -<% if @bts4_ip_address %> -BTS4=<%= @bts4_ip_address %> -<% end %> - -<% if @bts5_ip_address %> -BTS5=<%= @bts5_ip_address %> -<% end %> - -<% if @bts6_ip_address %> -BTS6=<%= @bts6_ip_address %> -<% end %> - -<% if @bts7_ip_address %> -BTS7=<%= @bts7_ip_address %> -<% end %> - -<% if @bts8_ip_address %> -BTS8=<%= @bts8_ip_address %> -<% end %> - -<% if @bts9_ip_address %> -BTS9=<%= @bts9_ip_address %> -<% end %> - -<% if @bts10_ip_address %> -BTS10=<%= @bts10_ip_address %> -<% end %> - RECIPIENTS=<%= @mail_admins %>