Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I installed netconsole using the instrunctions given here:

https://wiki.ubuntu.com/Kernel/Netconsole

dmesg | grep netconsole says everything is OK, but I won't believe it so easily:)

How can I make Ubuntu generate some kernel message in order to see if netconsole really works and sends everything to the other computer? I tried:

logger -p kern.alert "test message" # this apparently talks to syslog only
echo "test message" >/dev/kmsg

and wrote a small program that just did a segfault. All this generated entries in /var/log/kern.log, but not in dmesg and it was NOT copied via netconsole to the other computer.

So what can I do to see if netconsole actually works?

(My Ubuntu version is 12.04)

share|improve this question
add comment

3 Answers 3

The netconsole howto says that you can just

dmesg | grep netcon
share|improve this answer
add comment

You can generate console messages using alt+sysrq strings.

Something safe like:

echo m | sudo tee /proc/sysrq-trigger

You should see a few lines of text like the following on the netconsole server:

[ 7027.114084] Node 0 DMA: 2*4kB 2*8kB 0*16kB 2*32kB 1*64kB 1*128kB 1*256kB 0*512kB 1*1024kB 1*2048kB 3*4096kB = 15896kB
[ 7027.114092] Node 0 DMA32: 284*4kB 123*8kB 108*16kB 207*32kB 202*64kB 89*128kB 34*256kB 15*512kB 4*1024kB 3*2048kB 5*4096kB = 81896kB
[ 7027.114099] Node 0 Normal: 311*4kB 142*8kB 121*16kB 79*32kB 67*64kB 24*128kB 9*256kB 8*512kB 9*1024kB 2*2048kB 1*4096kB = 38012kB
[ 7027.114107] 446611 total pagecache pages
[ 7027.114108] 0 pages in swap cache
[ 7027.114110] Swap cache stats: add 0, delete 0, find 0/0
[ 7027.114111] Free swap  = 4104672kB
[ 7027.114112] Total swap = 4104672kB
[ 7027.124913] 1048048 pages RAM
[ 7027.124916] 58057 pages reserved
[ 7027.124918] 360968 pages shared
[ 7027.124919] 807997 pages non-shared
share|improve this answer
add comment

Its on step 5 of mentioned howto:

One way to test whether logging is working correctly or not is to insert some removable media like a CD, DVD or usb stick.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.