Example #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
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
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"
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"
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))
    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
        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"
            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"
Example #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