From 82b25ddf603652c211ddbe51fb4960c0f4912852 Mon Sep 17 00:00:00 2001 From: Ciaby Date: Fri, 20 Feb 2015 12:47:02 -0600 Subject: [PATCH] Fixed monitoring scripts. --- .../files/bin/check_amp_status.sh | 2 +- .../rhizomatica_base_system/files/bin/check_status.sh | 4 ---- .../rhizomatica_base_system/files/bin/monitor_amp.sh | 10 ++++++++++ .../files/bin/turn_on_amplifier.sh | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) delete mode 100755 modules/rhizomatica_base_system/files/bin/check_status.sh create mode 100755 modules/rhizomatica_base_system/files/bin/monitor_amp.sh 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 0d4e7b2..e408a50 100755 --- a/modules/rhizomatica_base_system/files/bin/check_amp_status.sh +++ b/modules/rhizomatica_base_system/files/bin/check_amp_status.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Check for AMP status on each BTS, from BTS1 up to BTS3 . ./vars.sh for bts in $BTS1 $BTS2 $BTS3; do diff --git a/modules/rhizomatica_base_system/files/bin/check_status.sh b/modules/rhizomatica_base_system/files/bin/check_status.sh deleted file mode 100755 index 74bfd03..0000000 --- a/modules/rhizomatica_base_system/files/bin/check_status.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. ./vars.sh -echo "BTS1: " -ssh root@$BTS1 sbts2050-util sbts2050-pwr-status diff --git a/modules/rhizomatica_base_system/files/bin/monitor_amp.sh b/modules/rhizomatica_base_system/files/bin/monitor_amp.sh new file mode 100755 index 0000000..0ab2b38 --- /dev/null +++ b/modules/rhizomatica_base_system/files/bin/monitor_amp.sh @@ -0,0 +1,10 @@ +#!/bin/bash +. ./vars.sh +LOGFILE="/var/log/monitor_amp.log" + +$RHIZO_SCRIPT/check_amp_status.sh | grep -q OFF +if [ $? == 0 ]; then + logc "Amplifier is OFF! Turn on amp" + $RHIZO_SCRIPT/turn_on_amplifier.sh >/dev/null 2>&1 + logc 'Procedure completed' +fi 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 1073553..5b7dc08 100755 --- a/modules/rhizomatica_base_system/files/bin/turn_on_amplifier.sh +++ b/modules/rhizomatica_base_system/files/bin/turn_on_amplifier.sh @@ -1,7 +1,7 @@ #!/bin/bash # Turn on AMP on all BTS, from BTS1 to BTS3 . ./vars.sh -LOGFILE="/var/log/rhizomatica/monitor_amp.log" +LOGFILE="/var/log/monitor_amp.log" for bts in $BTS1 $BTS2 $BTS3; do logc "Turning on AMP on BTS $bts:";