Merge branch '2.3.x-saas' into 2.4.x-saas
Conflicts: airtime_mvc/application/controllers/ScheduleController.php airtime_mvc/application/forms/AddShowWhen.php airtime_mvc/application/models/Schedule.php python_apps/pypo/airtime-playout
This commit is contained in:
commit
3b9b23a7dd
36 changed files with 261 additions and 739 deletions
|
@ -1,6 +1,18 @@
|
|||
set daemon 10 # Poll at 10 second intervals
|
||||
set logfile /var/log/monit.log
|
||||
|
||||
set mailserver %%mail_server%% port 25
|
||||
set alert support@airtime.pro
|
||||
|
||||
set mail-format {
|
||||
from: lxc%%instance_id%%@airtime.pro
|
||||
subject: $ACTION $SERVICE (%%mail_server%%)
|
||||
message:
|
||||
Monit: $ACTION $SERVICE
|
||||
Date: $DATE
|
||||
Description: $DESCRIPTION.
|
||||
}
|
||||
|
||||
set httpd port 2812
|
||||
allow admin:$admin_pass
|
||||
allow guest:airtime read-only
|
||||
|
|
|
@ -26,6 +26,10 @@ export LC_ALL=`cat /etc/default/locale | grep "LANG=" | cut -d= -f2 | tr -d "\n\
|
|||
export TERM=xterm
|
||||
|
||||
|
||||
#Nothing to do with Pypo, but for container maintenance. Let's parse the IP address
|
||||
#so we may more easily manage our instance containers
|
||||
ifconfig eth0 | egrep -o 'inet addr:([0-9]{1,3}\.){3}[0-9]{1,3}' | cut -d':' -f2 > /etc/airtime_ip_addr
|
||||
|
||||
exec python ${pypo_path}/${pypo_script} > /var/log/airtime/pypo/py-interpreter.log 2>&1
|
||||
|
||||
# EOF
|
||||
|
|
|
@ -10,8 +10,9 @@ import time
|
|||
from api_clients import api_client
|
||||
|
||||
class ListenerStat(Thread):
|
||||
def __init__(self, logger=None):
|
||||
def __init__(self, config, logger=None):
|
||||
Thread.__init__(self)
|
||||
self.config = config
|
||||
self.api_client = api_client.AirtimeApiClient()
|
||||
if logger is None:
|
||||
self.logger = logging.getLogger()
|
||||
|
@ -48,12 +49,18 @@ class ListenerStat(Thread):
|
|||
|
||||
f = urllib2.urlopen(req)
|
||||
document = f.read()
|
||||
|
||||
return document
|
||||
|
||||
|
||||
def get_icecast_stats(self, ip):
|
||||
url = 'http://%(host)s:%(port)s/admin/stats.xml' % ip
|
||||
document = self.get_stream_server_xml(ip, url)
|
||||
document = None
|
||||
if "airtime.pro" in ip["host"].lower():
|
||||
url = 'http://%(host)s:%(port)s/stats.xsl' % ip
|
||||
document = self.get_stream_server_xml(ip, url)
|
||||
else:
|
||||
url = 'http://%(host)s:%(port)s/admin/stats.xml' % ip
|
||||
document = self.get_stream_server_xml(ip, url)
|
||||
dom = xml.dom.minidom.parseString(document)
|
||||
sources = dom.getElementsByTagName("source")
|
||||
|
||||
|
@ -156,5 +163,5 @@ if __name__ == "__main__":
|
|||
# add ch to logger
|
||||
#logger.addHandler(ch)
|
||||
|
||||
ls = ListenerStat(logger)
|
||||
ls.run()
|
||||
#ls = ListenerStat(logger=logger)
|
||||
#ls.run()
|
||||
|
|
|
@ -287,7 +287,7 @@ if __name__ == '__main__':
|
|||
recorder.daemon = True
|
||||
recorder.start()
|
||||
|
||||
stat = ListenerStat()
|
||||
stat = ListenerStat(config)
|
||||
stat.daemon = True
|
||||
stat.start()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue