Added basic utilities.
This commit is contained in:
parent
f55f4d699d
commit
84475594cc
8 changed files with 113 additions and 19 deletions
12
modules/rhizomatica_base_system/files/bin/bind_check.sh
Executable file
12
modules/rhizomatica_base_system/files/bin/bind_check.sh
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
currdate=`date`
|
||||
|
||||
if (grep 'but not bound for Rx' /var/log/osmo-nitb/current > /dev/null); then
|
||||
echo -e "$currdate - OpenBSC lost RX bind" >> /var/log/bind_check.log
|
||||
/etc/init.d/kannel restart >/dev/null
|
||||
:>/var/log/osmo-nitb/current
|
||||
echo -e "$currdate - Restarted kannel and cleared osmo-nitb log" >> /var/log/bind_check.log
|
||||
else
|
||||
echo -e "$currdate - OpenBSC has the RX bind" >> /var/log/bind_check.log
|
||||
fi
|
10
modules/rhizomatica_base_system/files/bin/capture_traffic.sh
Executable file
10
modules/rhizomatica_base_system/files/bin/capture_traffic.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash -x
|
||||
TCPDUMP="/usr/sbin/tcpdump"
|
||||
CAPTURE_DEVICE="eth1"
|
||||
CAPTURE_PORTS="port 3002 or port 3003"
|
||||
CAPTURE_LIMIT="1024"
|
||||
CAPTURE_SIZE="1"
|
||||
CAPTURE_BASENAME="/tmp/tcpdump-capture-"
|
||||
CAPTURE_COMPRESS="-z /usr/sbin/tcpdump-compress"
|
||||
CAPTURE_OPTIONS="-pi $CAPTURE_DEVICE -s0 -w $CAPTURE_BASENAME -C $CAPTURE_SIZE -W $CAPTURE_LIMIT $CAPTURE_COMPRESS $CAPTURE_PORTS"
|
||||
$TCPDUMP $CAPTURE_OPTIONS
|
4
modules/rhizomatica_base_system/files/bin/check_amp_status.sh
Executable file
4
modules/rhizomatica_base_system/files/bin/check_amp_status.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
. ./vars.sh
|
||||
echo "BTS1: "
|
||||
ssh root@$BTS1 sbts2050-util sbts2050-pwr-status | grep Amp
|
4
modules/rhizomatica_base_system/files/bin/check_status.sh
Executable file
4
modules/rhizomatica_base_system/files/bin/check_status.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
. ./vars.sh
|
||||
echo "BTS1: "
|
||||
ssh root@$BTS1 sbts2050-util sbts2050-pwr-status
|
13
modules/rhizomatica_base_system/files/bin/log_broken_channels.sh
Executable file
13
modules/rhizomatica_base_system/files/bin/log_broken_channels.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
. ./vars.sh
|
||||
|
||||
while (true);
|
||||
do STR=`echo "show lchan" | nc localhost 4242 | grep BROKEN`;
|
||||
|
||||
if [ -n "$STR" ];
|
||||
then echo `date "+%y%m%d_%H%M"` >> /var/tmp/broken_channels_log.txt;
|
||||
STR=`echo "show lchan" | nc localhost 4242`;
|
||||
echo -e "Subject:BROKEN Channels\n\nBroken at: `date`\n\n\n$STR" | sendmail $RECIPIENTS
|
||||
fi;
|
||||
sleep 600;
|
||||
done
|
34
modules/rhizomatica_base_system/files/bin/turn_on_amplifier.sh
Executable file
34
modules/rhizomatica_base_system/files/bin/turn_on_amplifier.sh
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
. ./vars.sh
|
||||
|
||||
echo "Beginning amplifier procedure... brace yourself!"
|
||||
|
||||
echo "turning off osmo-nitb and kannel"
|
||||
sv stop osmo-nitb
|
||||
/etc/init.d/kannel stop
|
||||
|
||||
echo "Rebooting first BTS"
|
||||
ssh root@$BTS1 "/sbin/reboot"
|
||||
|
||||
echo "sleeping 30 seconds..."
|
||||
sleep 30
|
||||
|
||||
echo "turning off the second BTS"
|
||||
ssh root@$BTS1 "/usr/bin/sbts2050-util sbts2050-pwr-enable 1 0 0"
|
||||
|
||||
echo "sleeping 10 seconds..."
|
||||
sleep 10
|
||||
|
||||
echo "turning on the amplifier"
|
||||
ssh root@$BTS1 "/usr/bin/sbts2050-util sbts2050-pwr-enable 1 0 1"
|
||||
|
||||
echo "sleeping 10 seconds..."
|
||||
sleep 10
|
||||
|
||||
echo "turning back on the second BTS"
|
||||
ssh root@$BTS1 "/usr/bin/sbts2050-util sbts2050-pwr-enable 1 1 1"
|
||||
|
||||
echo "turning on osmo-nitb and kannel"
|
||||
sv start osmo-nitb
|
||||
sleep 10
|
||||
/etc/init.d/kannel start
|
Loading…
Add table
Add a link
Reference in a new issue