Logging using netconsole and syslog on remote server.

netconsole

Starting from firmware version 0.2.18-r5 was edit support of netconsole.

Start depends on bootloader enviropment variables.

nc_ip - is necessary. nc_port - is not necessary.

These parameters can be send using DHCP:

option Infomir.nc_ip code 30 = ip-address;
option Infomir.nc_port code 31 = integer 16;

option Infomir.nc_ip 192.168.1.xxx;
option Infomir.nc_port 3333;

Parameters that are set via DHCP server have higher priority than enviropment variables.

syslog

Also there was added support of syslog.

Is controlled by bootloader enviropment variable syslog_srv value can be- host:port or just host

This parameter can be send using DHCP:

option Infomir.syslog_srv code 32 = text;
option Infomir.syslog_srv "192.168.1.xxx:2222";

Parameters that are set via DHCP server have higher priority than enviropment variables.

When syslog is turned on it has output of syslog from player (if this output is turned on from JS API SetSyslogLevel), kernel messages(klogd) and all output from /test.sh including stderror.

Changes will be only after STB reboot.

Changes can be forceed using API:

gSTB.ServiceControl("netconsole","restart");
gSTB.ServiceControl("syslog","restart");

To get log on server, netcat can be runned:

nc -l -u 2222

Note: Different from netconsole, log from syslog will be shown without line feed.

For more convenient reading of syslog run syslogd on server with next parametrs:

syslogd -r -m 0

If port is not selecter for syslog, standart port 514 is used.

Example how to use rsyslog to listen to syslog from STB on Ubuntu Server 12.04

Installation rsyslog:

aptitude install rsyslog

In config file set:

$ModLoad imudp $UDPServerRun 514 $ModLoad imtcp $InputTCPServerRun 514

reloadrsyslog:

/etc/init.d/rsyslog restart

To see logлога. Use next.

tail -f /var/log/syslog | grep -i 'ip_or_name_of_host_that_send_syslog'

Attention! Do not forger to open specified ports in firewall, of it is used