Changes

Jump to: navigation, search

Remote console setup

1,267 bytes added, 20:02, 9 October 2007
Respawn capturing + log rotating on remote side, testing netconsole
When your kernel prints something on the console, the text will be also captured on this netconsole server.
 
For automatic care about capturing on console server you can use init respawn feature in this way:
 
<pre>
echo "n1:23:respawn:/bin/netcat -u -l -p 6666 >> /var/log/netconsole" >> /etc/inittab
telinit q
</pre>
 
For long term capturing you would like to do log rotating some way. With logrotate you can do it by creating config file /etc/logrotate.d/netconsole:
 
<pre>
/var/log/netconsole {
weekly
rotate 8
missingok
compress
copytruncate
notifempty
}
</pre>
 
=== Testing netconsole ===
 
First check log level of console messages on OpenVZ side by:
 
<pre>cat /proc/sys/kernel/printk</pre>
 
First number should be 7 for testing. You can arrange it by:
 
<pre>sysctl -w kernel.printk="7 4 1 7"</pre>
 
After testing you can repair previous seting the same way.
 
Load netconsole module (see above) and on console server do netcat command. On OpenVZ side provocate any console message, f.e. by command
 
<pre>
modprobe tun
</pre>
 
If you see any console message on OpenVZ side, you should see message on console server too. If not, something is wrong. By debuging problem you should not use tcpdump on OpenVZ side, it is not able to show you netconsole packets. Use tcpdump on console server. Often source of problems with netconsole are firewalls.
 
[[Category:HOWTO]]
[[Category:Kernel]]
[[Category:Troubleshooting]]
3
edits

Navigation menu