Пример #1
0
def main():
    for channel in channelist:
        tsTime = last_ts_time(m3u8_path + channel + '.m3u8')
        delayTime = time.time() - tsTime
        if delayTime > 600:
            logger('%s breakdown, last ts time %s' % (channel, tsTime))
            cf = ConfigParser.ConfigParser()
            cf.read('/opt/scripts/Streamer_Monitor/config.ini')
            rtmp = cf.get('TYL_Channel', channel)
            logger('channel: %s rtmp: %s' % (channel, rtmp))
            mes.redis_process(channel, 'TYL', rtmp=rtmp)
        else:
            pass
Пример #2
0
def main():
    for channel in channelist:
        tsTime = last_ts_time(m3u8_path + channel + '.m3u8')
        delayTime = time.time() - tsTime
        if delayTime > 600:
	    logger('%s breakdown, last ts time %s' %(channel,tsTime))
            cf = ConfigParser.ConfigParser()
            cf.read('/opt/scripts/Streamer_Monitor/config.ini')
            rtmp = cf.get('TYL_Channel',channel)
	    logger('channel: %s rtmp: %s' %(channel,rtmp))
            mes.redis_process(channel,'TYL',rtmp=rtmp)
        else:
	    pass
Пример #3
0
def main():
    channelist = mysql_breakdown_channel()
    if len(channelist) != 0:
        for i in channelist:
            channelid = i[0].encode('utf-8')
            channel = i[1].encode('utf-8')
            print channel
            print channelid
            cf = ConfigParser.ConfigParser()
            cf.read('/opt/scripts/Streamer_Monitor/config.ini')
            rtmp = cf.get('NLTP_Channel',channel)
            print "%s is %s" %(channel, rtmp)
            mes.redis_process(channel, 'NLTP', rtmp=rtmp)
            mysql_reset_channel(channelid)
    else:
        print "channel normal"
Пример #4
0
def main():
    channelist = mysql_breakdown_channel()
    if len(channelist) != 0:
        for i in channelist:
            channelid = i[0].encode('utf-8')
            channel = i[1].encode('utf-8')
            print channel
            print channelid
            cf = ConfigParser.ConfigParser()
            cf.read('/opt/scripts/Streamer_Monitor/config.ini')
            rtmp = cf.get('NLTP_Channel', channel)
            print "%s is %s" % (channel, rtmp)
            mes.redis_process(channel, 'NLTP', rtmp=rtmp)
            mysql_reset_channel(channelid)
    else:
        print "channel normal"
Пример #5
0
def main():
    for rtsp_channel in rtsp_channel_list:
        rtsp_url = rtsp_monitor_url(rtsp_channel)
        #print rtsp_url
        channel_info_json = probe_stream(rtsp_url)
        #print channel_info_json
        if channel_info_json:
            channel_info = json.loads(channel_info_json)
	    #print channel_info
            if channel_info:
                print "%s normal" %rtsp_channel
		#logger(channel_info_json)
                m = stram_info_json_format(channel_info)
	        '''
                print "video_codec_type: %(video_codec_type)s \n" \
                  "video_codec_name: %(video_codec_name)s \n" \
                  "video_profile: %(video_profile)s \n" \
                  "video_Resolution: %(video_Resolution)s \n" \
                  "profile_level: %(profile_level)s \n" \
                  "video_start_time: %(video_start_time)s \n" \
                  "audio_codec_type: %(audio_codec_type)s \n" \
                  "audio_codec_name: %(audio_codec_name)s \n" \
                  "audio_channels: %(audio_channels)s \n" \
                  "sample_rate: %(sample_rate)s \n" \
                  "audio_start_time:%(audio_start_time)s" % m
	       '''
            else:
	        #print "%s breakdown" %rtsp_channel
	        rtsp = cf.get('RTSP_Channel', rtsp_channel)
	        mes.redis_process(rtsp_channel,'RTSP',rtsp=rtsp)
	        logger("RTSP %s breakdown" %rtsp_channel)
		logger("%s json is %s" %(rtsp_channel,channel_info_json))
        else:
            #print "%s ***breakdown***" %rtsp_channel
            rtsp = cf.get('RTSP_Channel', rtsp_channel)
	    #mes.redis_process(rtsp_channel,'RTSP',rtsp=rtsp)
            logger("RTSP %s ***breakdown***" %rtsp_channel)
	    logger("%s json is %s" %(rtsp_channel,channel_info_json))
Пример #6
0
    tsTime = targeLine.strip('\n')[-18:-3]
    return date_helper.format_tup(tsTime)

def main():
    for channel in channelist:
        tsTime = last_ts_time(m3u8_path + channel + '.m3u8')
        delayTime = time.time() - tsTime
        if delayTime > 600:
	    logger('%s breakdown, last ts time %s' %(channel,tsTime))
            cf = ConfigParser.ConfigParser()
            cf.read('/opt/scripts/Streamer_Monitor/config.ini')
            rtmp = cf.get('TYL_Channel',channel)
	    logger('channel: %s rtmp: %s' %(channel,rtmp))
            mes.redis_process(channel,'TYL',rtmp=rtmp)
        else:
	    pass
            
            
if __name__ == '__main__':
    for channel in channelist:
        tsTime = last_ts_time(m3u8_path + channel + '.m3u8')
        delayTime = time.time() - tsTime
        print delayTime
        if delayTime > 600:
            cf = ConfigParser.ConfigParser()
            cf.read('/opt/scripts/Streamer_Monitor/config.ini')
            rtmp = cf.get('TYL_Channel',channel)
            mes.redis_process(channel,'TYL',rtmp=rtmp)
        else:
            print "channel:%s normal" %channel
Пример #7
0
        for i in channelist:
            channelid = i[0].encode('utf-8')
            channel = i[1].encode('utf-8')
            print channel
            print channelid
            cf = ConfigParser.ConfigParser()
            cf.read('/opt/scripts/Streamer_Monitor/config.ini')
            rtmp = cf.get('NLTP_Channel',channel)
            print "%s is %s" %(channel, rtmp)
            mes.redis_process(channel, 'NLTP', rtmp=rtmp)
            mysql_reset_channel(channelid)
    else:
        print "channel normal"
		
if __name__ == '__main__':
    channelist = mysql_breakdown_channel()
    if len(channelist) != 0:
        for i in channelist:
            channelid = i[0].encode('utf-8')
            channel = i[1].encode('utf-8')
            print channel
	    print channelid
            cf = ConfigParser.ConfigParser()
            cf.read('/opt/scripts/Streamer_Monitor/config.ini')
            rtmp = cf.get('NLTP_Channel',channel)
            print "%s is %s" %(channel, rtmp)
            mes.redis_process(channel, 'NLTP', rtmp=rtmp)
            mysql_reset_channel(channelid)
    else:
        print "channel normal"
Пример #8
0
            channelid = i[0].encode('utf-8')
            channel = i[1].encode('utf-8')
            print channel
            print channelid
            cf = ConfigParser.ConfigParser()
            cf.read('/opt/scripts/Streamer_Monitor/config.ini')
            rtmp = cf.get('NLTP_Channel', channel)
            print "%s is %s" % (channel, rtmp)
            mes.redis_process(channel, 'NLTP', rtmp=rtmp)
            mysql_reset_channel(channelid)
    else:
        print "channel normal"


if __name__ == '__main__':
    channelist = mysql_breakdown_channel()
    if len(channelist) != 0:
        for i in channelist:
            channelid = i[0].encode('utf-8')
            channel = i[1].encode('utf-8')
            print channel
            print channelid
            cf = ConfigParser.ConfigParser()
            cf.read('/opt/scripts/Streamer_Monitor/config.ini')
            rtmp = cf.get('NLTP_Channel', channel)
            print "%s is %s" % (channel, rtmp)
            mes.redis_process(channel, 'NLTP', rtmp=rtmp)
            mysql_reset_channel(channelid)
    else:
        print "channel normal"
Пример #9
0
    return date_helper.format_tup(tsTime)


def main():
    for channel in channelist:
        tsTime = last_ts_time(m3u8_path + channel + '.m3u8')
        delayTime = time.time() - tsTime
        if delayTime > 600:
            logger('%s breakdown, last ts time %s' % (channel, tsTime))
            cf = ConfigParser.ConfigParser()
            cf.read('/opt/scripts/Streamer_Monitor/config.ini')
            rtmp = cf.get('TYL_Channel', channel)
            logger('channel: %s rtmp: %s' % (channel, rtmp))
            mes.redis_process(channel, 'TYL', rtmp=rtmp)
        else:
            pass


if __name__ == '__main__':
    for channel in channelist:
        tsTime = last_ts_time(m3u8_path + channel + '.m3u8')
        delayTime = time.time() - tsTime
        print delayTime
        if delayTime > 600:
            cf = ConfigParser.ConfigParser()
            cf.read('/opt/scripts/Streamer_Monitor/config.ini')
            rtmp = cf.get('TYL_Channel', channel)
            mes.redis_process(channel, 'TYL', rtmp=rtmp)
        else:
            print "channel:%s normal" % channel