Click to See Complete Forum and Search --> : hostname not printing correctly in /var/log/messages


bkevind
01-07-2004, 11:26 AM
Multiple, supposedly identical suse 8 installs.

Most print the hostname after the timestamp on each line of the /var/log/messages file.

Some are not printing the hostname, but are instead printing "linux"

I haven't yet found the reason for this, any hints would be very much appreciated.

Thanks for your time.

nowonmai
01-07-2004, 01:16 PM
you can change the hostname on a suse box by either editing /etc/HOSTNAME or using YaST2. Select Network Services, followed by Hostname and DNS.

bkevind
01-07-2004, 02:06 PM
Thank you, but I should clarify that the hostnames are all correctly set.

The problem specifically is that the hostname is not being printed on each line of the /var/log/messages file on some of my systems. I can't find a difference between the systems that work and the ones that do not.

The hostname is printed just after the timestamp of each line of the messages file, but for on the systems that do not, "linux" is printed instead.

Magueta
01-08-2004, 03:51 AM
Is there something in common with the services that are logging with "Linux" instead of your hostname? It may be that the software that sends the logs to syslog is either configured to just send "Linux" to the log or is unable to find the hostname. I know you may be reluctant to post some of the information from your logs but could you perhaps post some of the lines that have "Linux" instead of your hostname? Perhaps there's some sort of clue there.

Joe

bkevind
01-08-2004, 07:47 AM
I've been wondering if syslog is not correctly getting the hostname but I haven't been able to find out exactly. There is nothing in /etc/syslog.conf that would cause this to happen.

As far as clues from the messages file, there is nothing to see, other than what I've mentioned.

It prints something like this

Jan 7 05:10:46 linux blah blah blah normal messages..

Whereas the good systems print this:

Jan 7 05:10:46 <hostname> blah blah blah normal messages..

Magueta
01-08-2004, 08:19 AM
Perhaps what you should investigate isn't syslog itself but the settings in the applications that send those messages to syslog. I don't really think this is the case but as an example there could be differences in the levels of logging in the installations of the applications.

Joe

P.S. There is no spoon. :-)

bkevind
01-08-2004, 09:50 AM
It's everything...kernel messages, warning, error, etc.

For example, if I use the logger command to send a message to the file, it does the same thing.

EVERY line in the messages file has this problem, including boot-up info.

re PS: That's what I've heard! How disturbing - when I use a fork to eat ice-cream I wind up stabbing myself in the cheek because I'm all numb from the cold! Soup has to be drank and cereal is no longer a pleasant meal. Then there is the loss of a percussion instrument for some bands...it's a shame really.