Compare commits

..

No commits in common. "f33375f7888bdf3a944698bdcb1dec6f5bdd6080" and "ce8089c65b944c95b3a7b6a6fd5d8a9ee61dcf6b" have entirely different histories.

11 changed files with 60 additions and 153 deletions

View file

@ -3,8 +3,6 @@
# This script should be updated from time to time
# with nightly tasks for the BTS
#exit
# Consider when making modifications that
# running the script more than once is expected to be safe.
@ -13,26 +11,16 @@ if [ "$PWD" != "/var/SysmoBTS" ]; then
cd /var/SysmoBTS
fi
SSH_OPTS="-q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/tmp/known-$RANDOM"
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/tmp/known-$RANDOM"
. /home/rhizomatica/bin/vars.sh
# Ensure BTS has access to public internet.
echo "Check Masquerading.."
/var/SysmoBTS/chk_masq
for bts in "${!BTS[@]}" ; do
_model=${MODEL[$bts]}
echo -e "---- Config: BTS $bts is a $_model ----\n"
if [ "$_model" == "UmSite" ] || [ "$_model" == "UmSite1" ] || [ "$_model" == "" ] || [ "$_model" == "2100" ] || \
[ "$_model" == "DUG20" ] || [ "$_model" == "rbs2000" ] || [ "$_model" == "Fake" ] ; then
echo -e "Do nothing for this BTS Model\n"
continue
fi
#scp $SSH_OPTS authorized_keys root@${BTS[$bts]}:/home/root/.ssh/
echo -n "Set Date --> "
echo -e "Set Date\n"
ssh $SSH_OPTS root@${BTS[$bts]} "date -s '$(date)'"
if [ "$?" != "0" ] ; then
echo "No ssh access to BTS?"
@ -40,17 +28,14 @@ for bts in "${!BTS[@]}" ; do
fi
# Commands to run on all BTS:
#echo "Checking if BTS can access OPKG REPOS."
#ssh $SSH_OPTS root@${BTS[$bts]} "echo nameserver 1.1.1.1 > /etc/resolv.conf; echo nameserver 9.9.9.9 >> /etc/resolv.conf"
#ssh $SSH_OPTS root@${BTS[$bts]} "wget https://downloads.sysmocom.de -O /dev/null"
#ssh $SSH_OPTS root@${BTS[$bts]} "opkg clean; opkg update"
#ssh $SSH_OPTS root@${BTS[$bts]} "opkg list-upgradable"
#ssh $SSH_OPTS root@${BTS[$bts]} "opkg upgrade sysmobts-util osmo-bts osmo-pcu gps-utils gpsdate gpsd-conf gpsd-udev gpsd gpsd-gpsctl"
#scp $SSH_OPTS ca-fix.sh root@${BTS[$bts]}:/home/root/
#ssh $SSH_OPTS root@${BTS[$bts]} "chmod 750 /home/root/ca-fix.sh"
_modelNR=$(ssh $SSH_OPTS ${BTS[$bts]} sysmobts-util model-nr)
continue
if [ "$?" == "127" ]; then
echo -e "\n---- No sysmobts-util? ----\n"
echo "No sysmobts-util?"
continue
fi
@ -61,66 +46,52 @@ for bts in "${!BTS[@]}" ; do
continue
fi
#ssh $SSH_OPTS root@${BTS[$bts]} "mkdir -p /etc/profile.d"
#scp $SSH_OPTS alias.sh root@${BTS[$bts]}:/etc/profile.d/alias.sh
#scp $SSH_OPTS osmo-pcu_$bts.cfg root@${BTS[$bts]}:/etc/osmocom/osmo-pcu.cfg
#scp $SSH_OPTS pcu bts mgr txp /usr/local/bin/vty root@${BTS[$bts]}:/bin/
#ssh $SSH_OPTS root@${BTS[$bts]} "chmod 750 /bin/pcu /bin/bts /bin/mgr /bin/txp /bin/vty"
if [ "$_modelNR" == "1020" ] && [ "$_trxNR" == "255" ] ; then
echo "Looks like a SysmoBTS"
ssh $SSH_OPTS root@${BTS[$bts]} "opkg update ; opkg install osmo-bts osmo-pcu"
# Nothing to do
fi
#ssh $SSH_OPTS root@${BTS[$bts]} "opkg list-upgradable | cut -f 1 -d ' ' | grep gps | xargs -r opkg upgrade"
#ssh $SSH_OPTS root@${BTS[$bts]} "opkg list-installed | grep kernel-module-ipt | xargs -r opkg remove --force-removal-of-dependent-package --force-remove"
#ssh $SSH_OPTS root@${BTS[$bts]} "opkg list-installed | grep kernel-module-nf | xargs -r opkg remove --force-removal-of-dependent-package --force-remove"
if [ "$_modelNR" == "65535" ] || [ "$_modelNR" == "1020" ] && [ "$_trxNR" == "255" ] ; then
echo "Looks like a SysmoBTS ($_modelNR)"
#ssh $SSH_OPTS root@${BTS[$bts]} "systemctl stop osmo-pcu"
#scp $SSH_OPTS osmo-pcu.1.2.0.70-697f root@${BTS[$bts]}:/usr/bin/osmo-pcu
#ssh $SSH_OPTS root@${BTS[$bts]} "systemctl start osmo-pcu"
#ssh $SSH_OPTS root@${BTS[$bts]} "echo '$SITE-$bts' > /etc/hostname"
#scp $SSH_OPTS master/ntp.conf root@${BTS[$bts]}:/etc/ntp.conf
#scp $SSH_OPTS osmo-pcu_$bts.cfg root@${BTS[$bts]}:/etc/osmocom/osmo-pcu.cfg
#ssh $SSH_OPTS root@${BTS[$bts]} "systemctl stop gpsd.socket ; systemctl disable gspd.socket; systemctl restart gpsd"
#scp $SSH_OPTS osmo-bts_$bts.cfg root@${BTS[$bts]}:/etc/osmocom/osmo-bts-sysmo.cfg
#scp $SSH_OPTS bts pcu /usr/local/bin/vty root@${BTS[$bts]}:/bin/
#ssh $SSH_OPTS root@${BTS[$bts]} "chmod 750 /bin/txp"
#scp $SSH_OPTS gpsdate.service root@${BTS[$bts]}:/lib/systemd/system
#ssh $SSH_OPTS root@${BTS[$bts]} "opkg list-upgradable | cut -f 1 -d ' ' | grep libosmoabis | xargs -r opkg upgrade"
#ssh $SSH_OPTS root@${BTS[$bts]} "opkg upgrade sysmobts-util"
if [ "$_modelNR" == "65536" ] && [ "$_trxNR" == "255" ] ; then
echo "Looks like a SysmoBTS 1002? (65536)"
ssh $SSH_OPTS root@${BTS[$bts]} "opkg update ; opkg install osmo-bts osmo-pcu"
# Nothing to do
fi
if [ "$_modelNR" == "2050" ] && [ "$_trxNR" == "0" ] ; then
# Master Verified.
echo "BTS is a 2050 Master"
#ssh $SSH_OPTS root@${BTS[$bts]} "echo '$SITE-Master-$bts' > /etc/hostname"
#ssh $SSH_OPTS root@${BTS[$bts]} "systemctl stop gpsd.socket ; systemctl disable gspd.socket; systemctl restart gpsd"
#ssh $SSH_OPTS root@${BTS[$bts]} "systemctl stop osmo-pcu"
#scp $SSH_OPTS osmo-pcu.1.2.0.70-697f root@${BTS[$bts]}:/usr/bin/osmo-pcu
#ssh $SSH_OPTS root@${BTS[$bts]} "systemctl start osmo-pcu"
#scp $SSH_OPTS osmo-bts_$bts.cfg root@${BTS[$bts]}:/etc/osmocom/osmo-bts-sysmo.cfg
#scp $SSH_OPTS bts pcu /usr/local/bin/vty root@${BTS[$bts]}:/bin/
ssh $SSH_OPTS root@${BTS[$bts]} "opkg update"
ssh $SSH_OPTS root@${BTS[$bts]} "opkg install osmo-bts osmo-pcu"
#scp $SSH_OPTS pcu-ns root@${BTS[$bts]}:/bin/
#scp $SSH_OPTS tgl-s root@${BTS[$bts]}:/bin/tgl
#ssh $SSH_OPTS root@${BTS[$bts]} "chmod 750 /bin/pcu-ns /bin/tgl"
#gunzip -c sysmobts-mgr-arm.gz > sysmobts-mgr
#ssh $SSH_OPTS root@${BTS[$bts]} "systemctl stop sysmobts-mgr"
#scp $SSH_OPTS sysmobts-mgr root@${BTS[$bts]}:/usr/bin/
#ssh $SSH_OPTS root@${BTS[$bts]} "chmod 755 /usr/bin/sysmobts-mgr ; systemctl restart sysmobts-mgr"
# things to do
#scp $SSH_OPTS rc.local root@${BTS[$bts]}:/etc/rc.local
#ssh $SSH_OPTS root@${BTS[$bts]} "opkg list-upgradable | cut -f 1 -d ' ' | grep gps | xargs -r opkg upgrade"
#ssh $SSH_OPTS root@${BTS[$bts]} "chmod 750 /etc/rc.local"
fi
if [ "$_trxNR" == "1" ] ; then
# Slave Verified.
echo "BTS is a 2050 Slave"
#scp $SSH_OPTS slave/gpsdate root@${BTS[$bts]}:/etc/default/gpsdate
#ssh $SSH_OPTS root@${BTS[$bts]} "systemctl stop osmo-pcu"
#scp $SSH_OPTS osmo-pcu.1.2.0.70-697f root@${BTS[$bts]}:/usr/bin/osmo-pcu
#ssh $SSH_OPTS root@${BTS[$bts]} "systemctl start osmo-pcu"
#ssh $SSH_OPTS root@${BTS[$bts]} "echo '$SITE-Slave-$bts' > /etc/hostname"
#ssh $SSH_OPTS root@${BTS[$bts]} "systemctl enable osmo-pcu; systemctl start osmo-pcu"
#ssh $SSH_OPTS root@${BTS[$bts]} "systemctl stop gpsd.socket ; systemctl disable gspd.socket; systemctl stop gpsd ; systemctl disable gpsd"
#scp $SSH_OPTS osmo-pcu_$bts.cfg root@${BTS[$bts]}:/etc/osmocom/osmo-pcu.cfg
#scp $SSH_OPTS osmo-bts_$bts.cfg root@${BTS[$bts]}:/etc/osmocom/osmo-bts-sysmo.cfg
#scp $SSH_OPTS bts pcu /usr/local/bin/vty root@${BTS[$bts]}:/bin/
#ssh $SSH_OPTS root@${BTS[$bts]} "chmod 750 /bin/txp"
#ssh $SSH_OPTS root@${BTS[$bts]} "opkg upgrade sysmobts-util osmo-bts osmo-pcu"
ssh $SSH_OPTS root@${BTS[$bts]} "opkg update"
ssh $SSH_OPTS root@${BTS[$bts]} "opkg install osmo-bts osmo-pcu"
#ssh $SSH_OPTS root@${BTS[$bts]} "/home/root/ca-fix.sh"
#scp $SSH_OPTS pcu-ns root@${BTS[$bts]}:/bin/
#scp $SSH_OPTS tgl-m root@${BTS[$bts]}:/bin/tgl
#ssh $SSH_OPTS root@${BTS[$bts]} "chmod 750 /bin/pcu-ns /bin/tgl"
# Nothing to do.
fi
echo -e "----\n"
done
#/var/SysmoBTS/opkg-1.sh
if [ "$OLDPWD" != "" ]; then
cd $OLDPWD
fi

View file

@ -91,14 +91,14 @@ once() {
done
done
for item in oml_connected chanloadavg chan_ccch_sdcch4 chan_sdcch8 chan_tch_h chan_tch_f chan_osmo_dyn lchan_borken; do
for item in oml_connected chanloadavg chan_ccch_sdcch4 chan_sdcch8 chan_tch_h chan_osmo_dyn lchan_borken; do
rm -rf $item-*
for bts in "${!BTS[@]}" ; do
category_bts_g $item $bts
done
done
rm -rf BTS_uptime-* EGPRS_* BYTES-* PCU_RACH-* PDCH-* MS_PRESENT-* SUBS-VLR
rm -rf BTS_uptime-* EGPRS_* BYTES-* PCU_RACH-* PDCH-* MS_PRESENT-*
for bts in "${!BTS[@]}" ; do
@ -152,11 +152,10 @@ once() {
ln -s $f MS-`echo $f | awk -F'.' '{print $6"."$7}'`.rrd
done
cd ..
done
mkdir SUBS-VLR || exit
cd SUBS-VLR
ln -s ../statsd/gauge-vlr.0.subscribers.rrd Connected-Count.rrd
done
find -name chreq-total.rrd -type l -delete
find -name cm_serv_rej-rrd.rrd -type l -delete

View file

@ -1,16 +0,0 @@
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 80
Listen 81
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

View file

@ -4,9 +4,4 @@ if [ "$1" == "" ] ; then
else
_cmd=$1
fi
if [ "$_cmd" == "policy" ] ; then
apt policy osmo-stp osmo-bsc osmo-msc osmo-hlr osmo-mgw osmo-sgsn osmo-sip-connector 2>/dev/null| grep '^osmo-\|Installed\|Candidate'
exit
fi
systemctl $_cmd osmo-stp osmo-bsc osmo-msc osmo-hlr osmo-mgw osmo-sgsn osmo-sip-connector

View file

@ -27,7 +27,6 @@ class rhizo_base {
$charge_scheme = hiera('rhizo::charge_scheme', 'normal')
$test_playback = hiera('rhizo::test_playback', 'tone_stream://%(4000,250,440);loops=-1')
$sip_calling_url = hiera('rhizo::sip_calling_url', '')
$sms_shortcodes = hiera('rhizo::sms_shortcodes', '')
# database
$pgsql_db = hiera('rhizo::pgsql_db')
@ -116,7 +115,6 @@ class rhizo_base {
$sms_destination_unauthorized = hiera('rhizo::sms_destination_unauthorized')
$free_numbers = hiera('rhizo::free_numbers', '[]')
$welcome_sms = hiera('rhizo::welcome_sms', '')
$currencies = hiera('rhizo::currencies', '{}')
$rai_admin_user = hiera('rhizo::rai_admin_user')
$rai_admin_pwd = hiera('rhizo::rai_admin_pwd')
@ -240,7 +238,7 @@ schedule { 'weekly':
}
schedule { 'offpeak':
range => '0:15 - 3:30',
range => '1 - 4.30',
}
schedule { 'repod':

View file

@ -20,44 +20,25 @@ class rhizo_base::osmocom::buster inherits rhizo_base::osmocom::common {
ensure => 'installed'
}
package { [ 'libosmoabis13', 'libosmotrau2' ]:
ensure => '1.5.2'
}
package { [ 'libosmonetif11' ]:
ensure => '1.4.0'
}
package { [ 'libosmo-ranap7' ]:
ensure => '1.5.1'
package { [ 'libosmoabis10' ]:
ensure => '1.4.1'
}
package { [ 'libosmocore' ]:
ensure => '1.9.2'
ensure => '1.8.0'
}
package { [ 'osmo-bsc', 'osmo-bsc-meas-utils' ]:
schedule => 'offpeak',
ensure => '1.11.0.2.6c6ca~rhizomatica.production',
ensure => '1.9.0+rhizo3b',
require => Class['rhizo_base::apt'],
notify => Exec['notify-osmo-restart'],
}
package { [ 'osmo-msc' ]:
schedule => 'offpeak',
require => Class['rhizo_base::apt'],
ensure => '1.9.0.92.a021a~rhizomatica.production',
ensure => '1.10.0.77.11e4b~rhizomatica.production',
}
package { [ 'osmo-mgw', 'libosmo-mgcp-client12' ]:
schedule => 'offpeak',
require => Class['rhizo_base::apt'],
ensure => '1.12.2.8.78a93~rhizomatica.production',
}
package { [ 'osmo-sgsn' ]:
ensure => "$repo" ? { "latest" => '1.11.1.2.01c5~rhizomatica.production', "nightly" => "installed" },
require => Class['rhizo_base::apt'],
}
package { [ 'libgtp6' ]:
ensure => "$repo" ? { "latest" => '1.11.0', "nightly" => "installed" },
package { [ 'osmo-sgsn', 'libgtp6' ]:
ensure => "$repo" ? { "latest" => '1.10.1', "nightly" => "installed" },
require => Class['rhizo_base::apt'],
}
package { [ 'osmo-sip-connector' ]:
@ -66,15 +47,9 @@ class rhizo_base::osmocom::buster inherits rhizo_base::osmocom::common {
}
package { [ 'osmo-hlr', 'libosmo-mslookup1', 'osmo-mslookup-utils',
'libosmo-gsup-client0' ]:
schedule => 'offpeak',
ensure => '1.7.0.10.6784~rhizomatica.production',
ensure => '1.6.0.19.80b2~rhizomatica.production',
require => Class['rhizo_base::apt'],
}
package { [ 'osmo-stp' ]:
ensure => '1.8.1',
require => Class['rhizo_base::apt'],
}
}
class rhizo_base::osmocom::common {
@ -107,8 +82,7 @@ class rhizo_base::osmocom::common {
$mgw_num_ep = hiera('rhizo::mgw_num_ep', $bts.size * 24)
$osmo_local_bin = hiera('rhizo::osmo_local_bin', [])
package { [ "osmocom-nitb", 'libosmo-sigtran7',
'libosmo-mgcp-client9', 'libosmonetif8' ]:
package { "osmocom-nitb":
ensure => 'absent'
}
@ -117,11 +91,15 @@ class rhizo_base::osmocom::common {
ensure => 'installed',
}
package { [ 'libsmpp1', 'libosmo-sigtran9' ]:
package { [ 'libsmpp1', 'libosmo-sigtran7',
'libosmo-mgcp-client9',
'libosmonetif8', 'libosmotrau2',
'osmo-stp', 'osmo-mgw' ]:
ensure => 'installed',
require => Class['rhizo_base::apt']
}
$ts0_phys_chan = { "unknown" => "CCCH",
"1002" => "CCCH+SDCCH4",
"1020" => "CCCH+SDCCH4",

View file

@ -41,20 +41,6 @@ class rhizo_base::wifi {
notify => Service['apache2']
}
file { '/etc/apache2/ports.conf':
ensure => present,
source => 'puppet:///modules/rhizo_base/ports.conf',
require => Package['apache2'],
notify => Service['apache2']
}
file { '/etc/apache2/mods-enabled/rewrite.load':
ensure => link,
target => '../mods-available/rewrite.load',
require => Package['apache2'],
notify => Service['apache2']
}
firewall { '000 accept DHCP (udp port 67)':
proto => 'udp',
iniface => $wifi_if,

View file

@ -26,7 +26,7 @@ pgsql_db = '<%= @pgsql_db %>'
pgsql_user = '<%= @pgsql_user %>'
pgsql_pwd = '<%= @pgsql_pwd %>'
pgsql_host = '<%= @pgsql_host %>'
db_revision = 19
db_revision = 18
# SITE
site_name = "<%= @site_name %>"
@ -49,10 +49,6 @@ site_routing = [
<%= @site_routing %>
]
sms_shortcodes = [
<%= @sms_shortcodes %>
]
# SITE settings
# rate type can be "call" or "min"
limit_local_calls = "<%= @limit_local_calls %>"
@ -68,7 +64,6 @@ charge_inbound_rate = "<%= @charge_inbound_rate %>"
charge_inbound_rate_type = "<%= @charge_inbound_rate_type %>"
charge_outbound_rate_type = "<%= @charge_outbound_rate_type %>"
free_numbers = <%= @free_numbers %>
currencies = <%= @currencies %>
smsc_shortcode = "<%= @smsc_shortcode %>"
sms_sender_unauthorized = '<%= @sms_sender_unauthorized %>'

View file

@ -55,6 +55,7 @@ mgcp
sdp audio-payload send-name
loop 0
number endpoints <%= @mgw_num_ep %>
no allow-transcoding
osmux off
<% if @bts[0]["model"] == "rbs2000" -%>
trunk 0

View file

@ -13,3 +13,4 @@ pcu
cs 4
alloc-algorithm dynamic
gamma 0
neighbor resolution 172.16.0.1 4248

View file

@ -10,7 +10,6 @@
<VirtualHost <%= @wifi_ip %>:81>
#ServerName www.example.com
ServerName <%= @wifi_ip %>
ServerAdmin webmaster@localhost
DocumentRoot /var/rhizomatica/portal