Dear all experts,
I would like to know where can I find the hostname located as when I receive the syslog, I can only see as below : (showing in localhost instead of the hostname)
Feb 6 15:31:31 localhost syslog:info syslogd: restart
Feb 6 15:31:50 localhost syslog:info syslogd: restart
Feb 6 15:36:06 localhost daemon:info xntpd[3604704]: synchronized to LOCAL(0), stratum=3
Feb 6 15:42:01 localhost syslog:info syslogd: restart
I have checked /etc/hosts, hostname has stated correctly with correct IP.
Hi, thanks for your reply.
Are you saying the smitty hostname? Or command hostname?
For your info, I have done that and the returned value is my server's hostname. And that's why I can't understand why the syslog doesn't show the my server's hostname and instead it only show "localhost"
The 'host name' shown in the syslog is usually set by the source system. I suspect that your server is receiving log data from another server and the problem lies there. Back-tracking may prove difficult.
Can you cause anything to generate these messages on demand? e.g. restart the syslog service
FYI, my server was restored from another server's mksysb. I have changed the host tables as well as the network to become a new server. There may be some system files that still having information of the previous server.
But I have performed refresh -s syslogd and the hostname shown in syslog still "localhost".
I have also performed refresh -g inetd and several tcp related subsystem group. Do I need to reboot the server?
For the question of whether I can generate messages on demand for the syslog? Yes, I can always try to sign in with dummy user ID and the syslog will capture it.
Thanks for all the responses, I have managed to get the hostname display in syslog. After I reboot the server, the syslog start to record as the hostname.
I have done the refresh of syslogd, inetd, tcp, etc.. but no change. But reboot of server, then it changed.
So the command hostname showed localhost ? In the large txt file hostname showed another name. I assume you changed somewhere localhost into that other name, before you rebooted? Or did you not change anything and just rebooted? Am I missing something?
syslogd's hostname is taken from gethostbyaddr(ip address of hostname), but only once afaik - when syslogd is started. If you changed the hostname and everything configured correctly, the next step is to restart syslogd - stopsrc -s syslogd ; sleep 2 ; startsrc -s syslog . The refresh operation re-reads configuration file, but doesn't check the hostname.