(args)
Monitor the standalone DVB-S2 receiver
Monitor the standalone DVB-S2 receiver
Monitor the standalone DVB - S2 receiver
def monitor(args):
    """Monitor the standalone DVB-S2 receiver"""

    # User info
    user_info = config.read_cfg_file(args.cfg, args.cfg_dir)
    if (user_info is None):
        return

    # IP Address
    rx_ip_addr = _parse_address(user_info, args.address)

    # Client to the S400's SNMP agent
    s400 = S400Client(args.demod, rx_ip_addr, args.port)

    util.print_header("Novra S400 Receiver")

    if (not s400.print_demod_config()):
        logger.error("s400 receiver at {} is unreachable".format(s400.address))
        return

    # Log Monitoring
    monitor = monitoring.Monitor(args.cfg_dir,
                                 logfile=args.log_file,
                                 scroll=args.log_scrolling,
                                 min_interval=args.log_interval,
                                 server=args.monitoring_server,
                                 port=args.monitoring_port,
                                 report=args.report,
                                 report_opts=monitoring.get_report_opts(args),
                                 utc=args.utc)

    util.print_header("Receiver Monitoring")

    # Fetch the receiver stats periodically
    c_time = time.time()
    while (True):
        try:
            stats = s400.get_stats()

            if (stats is None):
                return

            monitor.update(stats)

            next_print = c_time + args.log_interval
            if (next_print > c_time):
                time.sleep(next_print - c_time)
            c_time = time.time()

        except KeyboardInterrupt:
            break
def monitor ( args ) : # User info user_info = config . read_cfg_file ( args . cfg , args . cfg_dir ) if ( user_info is None ) : return # IP Address rx_ip_addr = _parse_address ( user_info , args . address ) # Client to the S400's SNMP agent s400 = S400Client ( args . demod , rx_ip_addr , args . port ) util . print_header ( "Novra S400 Receiver" ) if ( not s400 . print_demod_config ( ) ) : logger . error ( "s400 receiver at {} is unreachable" . format ( s400 . address ) ) return # Log Monitoring monitor = monitoring . Monitor ( args . cfg_dir , logfile = args . log_file , scroll = args . log_scrolling , min_interval = args . log_interval , server = args . monitoring_server , port = args . monitoring_port , report = args . report , report_opts = monitoring . get_report_opts ( args ) , utc = args . utc ) util . print_header ( "Receiver Monitoring" ) # Fetch the receiver stats periodically c_time = time . time ( ) while ( True ) : try : stats = s400 . get_stats ( ) if ( stats is None ) : return monitor . update ( stats ) next_print = c_time + args . log_interval if ( next_print > c_time ) : time . sleep ( next_print - c_time ) c_time = time . time ( ) except KeyboardInterrupt : break