1833195 Members
2425 Online
110051 Solutions
New Discussion

dmesg not playing ball

 
Simon Hargrave
Honored Contributor

dmesg not playing ball

We have on our servers crontab jobs to put dmesg output into /var/adm/messages thus: -

0,10,20,30,40,50 * * * * /usr/sbin/dmesg - >> /var/adm/messages

This works for a while, but periodically it just stops. The "dmesg -" command stops outputing messages, even though the /var/adm/msgbuf file differs from the "dmesg" output. The msgbuf file does get updated, it just appears that "dmesg -" doesn't produce any output. If I delete the msgbuf file, "dmesg -" begins to work again.

Any ideas?
4 REPLIES 4
Fred Ruffet
Honored Contributor

Re: dmesg not playing ball

What about free space in /var ? what are the right for msgbuf, messages and /var/adm ?

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Franky_1
Respected Contributor

Re: dmesg not playing ball

Hi,

with the "-" option dmesg computes (incrementally) the new messages since the
last time it was run and places these on the standard output
Maybe somtimes there are just no new messages to be printed ? Just a thought

Regards

Franky
Don't worry be happy
Simon Hargrave
Honored Contributor

Re: dmesg not playing ball

free space on /var is plenty.
permissions are 644.
there definately are messages to display, as if i do a diff on the output of dmesg against the msgbuf, there are (or were before i removed the file) about 6 lines difference.
Muthukumar_5
Honored Contributor

Re: dmesg not playing ball

dmesg - uses the /var/adm/msgbuf file for to store the dmesg informations/ IF it found any differences then only it is updating on to the standard output. If we make nullify the one then it will give all informations.

If we diff as,

dmesg - --> null then,

cp /var/adm/msgbuf /tmp/tmpbuf
> /var/adm/msgbuf

dmesg - >> /tmp/testbuf

diff /tmp/testbuf /tmp/tmpbuf

Only some timestamp difference / --- newline at end on msgbuf file and growing rate .

Can you post the difference here if it is differing more then above.
Easy to suggest when don't know about the problem!