Logging start using netconsole and syslog to remote server
netconsole
Starting from firmware version 0.2.18-r5 added support of netconsole, but only after the network starts in the Rootfs.
Start depends on bootloader environment variables:
nc_ip - is necessary.
nc_port - is not necessary.
These parameters can be sent 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
Starting from firmware version 0.2.18-r5 also there was added support of the Syslog feature.
It is controlled by the Bootloader environment variable syslog_srv. Its 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 the DHCP server have higher priority than environment variables.
When Syslog is turned on it has an output of Syslog from the player (if this output is turned on from JS API SetSyslogLevel), kernel messages(klogd) and all output from /test.sh including stderror.
Changes will take effect only after the STB reboot.
Changes can be forced using API:
gSTB.ServiceControl("netconsole","restart"); gSTB.ServiceControl("syslog","restart");
To get log on the server, Netcat can be run:
nc -l -u 2222
Note: In contrast to netconsole, a log from Syslog will be shown without a newline.
For the more convenient reading of Syslog run syslogd on the server with next parameters:
syslogd -r -m 0
If the port is not indicated for Syslog, standard 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 remove comments from the lines:
$ModLoad imudp $UDPServerRun 514 $ModLoad imtcp $InputTCPServerRun 514
Reload
rsyslog :
/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 forget to open specified ports in the firewall, if it is used