/var/log file system and monitoring health of system
Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Ubuntu 10.04 LTS on IBM Lenovo R61e, RHEL5-6,SLES10-11
Posts: 262
Rep:
/var/log file system and monitoring health of system
Hi
I'm trying to understand how to monitor health of redhat system.
I know the follwoing :
-----------------------
/var/log/messages ---> error messages related system and its services
/var/log/boot ---> init error messages
/var/log/dmesg ---> boot error messages
Questions :
------------
1. So if I want to seee whether some disk have I/O errors I read /var/log/dmesg ?
2. It depends whether a service is configured to use syslog or not by using 'logger'cmd or syslog API ?
3. What is 'dmesg' cmd for ? Is'nt the same as /var/log/dmesg ?
2. Not sure about it, perhaps someone else has some explanation on it.
1&3. It's the same log. Disk I/O and SMART related messages usually go to this log.
Why output from dmesg cmd differs a little bit from /var/log/messages output (differences in bold) ?
It look like both have some common messages but each one have some additional messages too.
thx for help.
Last edited by drManhattan; 04-29-2011 at 01:53 PM.
Sorry, I think I have misread the question; dmesg and /var/log/messages (I thought it was /var/log/dmesg) are different.
/var/log/messages is written to by syslogd daemon with verbosity level defined in /etc/syslog.conf. On the other hand, dmesg is a kernel ring buffer message and not dependent on syslogd. dmesg invocation defined in /etc/rc.sysinit (usually goes to /var/log/dmesg) and its verbosity level set in /etc/sysconfig/init (in Red Hat).
I think the loglevel/verbosity level setting that made their output different.
Distribution: Ubuntu 10.04 LTS on IBM Lenovo R61e, RHEL5-6,SLES10-11
Posts: 262
Original Poster
Rep:
Sorry it was my mistake.
I wanted to know what is the difference between output from 'dmesg'cmd and /var/log/dmesg file.
I see that there is not the same info.
output from dmesg cmd :
Code:
[ 5621.991005] [UFW BLOCK] IN=wlan0 OUT= MAC=00:1c:bf:6f:a9:57:00:23:33:1f:28:a0:08:00 SRC=193.17.41.111 DST=10.0.250.55 LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=0 DF PROTO=TCP SPT=80 DPT=41444 WINDOW=0 RES=0x00 RST URGP=0
[ 6778.252288] warning: `VirtualBox' uses 32-bit capabilities (legacy support in use)
[ 6791.541527] device vboxnet0 entered promiscuous mode
[ 6801.652387] vboxnet0: no IPv6 routers present
[ 7034.673054] CE: hpet increasing min_delta_ns to 22500 nsec
[ 7819.777406] CE: hpet increasing min_delta_ns to 33750 nsec
[ 7882.330666] svc: failed to register lockdv1 RPC service (errno 97).
[ 8107.618152] __ratelimit: 27 callbacks suppressed
[ 8107.618157] vlc[4093]: segfault at 115b78f ip 00218914 sp b73fe9e0 error 4 in libc-2.11.1.so[1ea000+153000]
[11886.356021] hrtimer: interrupt took 23327 ns
output from /var/log/dmesg :
Code:
[ 26.418966] Registered led device: iwl-phy0::radio
[ 26.418990] Registered led device: iwl-phy0::assoc
[ 26.419012] Registered led device: iwl-phy0::RX
[ 26.419032] Registered led device: iwl-phy0::TX
[ 26.429927] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 26.431518] alloc irq_desc for 29 on node -1
[ 26.431521] alloc kstat_irqs on node -1
[ 26.431555] tg3 0000:04:00.0: irq 29 for MSI/MSI-X
[ 26.464349] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 26.721529] cfg80211: Found new beacon on frequency: 2467 MHz (Ch 12) on phy0
--
/var/log/dmesg gets written when the system boots, near the end of sysinit process to enable us to see what kernel sees at booting phase. From /etc/rc.sysinit :
Code:
# Now that we have all of our basic modules loaded and the kernel going,
# let's dump the syslog ring somewhere so we can find it later
dmesg -s 131072 > /var/log/dmesg
When we execute dmesg from the prompt, it simply prints out the buffer again, adding the output to whatever has been there, while /var/log/dmesg does not get updated as it only gets written by the sysinit script.
--
Occasionally it might be useful to have a booting-phase information from the kernel ring saved somewhere, in this case, in /var/log/dmesg.
Beyond that, since syslogd catches kernel messages from level .info all the way up to .panic, I don't think there's so much significance in differentiate between the two. After all, the default kernel loglevel as defined in /etc/sysconfig/init will be reset by syslogd configuration in /etc/syslog.conf.
From /etc/sysconfig/init :
Code:
# default kernel loglevel on boot (syslog will reset this)
LOGLEVEL=3
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.