Ok, that sounds like rsyslog is looking up the hostnameas it starts up, and then when DHCP changes the name later it keeps using the old one.

if you are happy having it in a config file, then you can hard set it in the template in the config file. This seems like it would be effectivly the same thing as the config option you are talking about.

or you could configure your DHCP client to restart rsyslog when it gets a new hostname. (or just not have rsyslog started before the network is up, kernel messages would still be logged)

David Lang

On Mon, 13 Dec 2010, Joe Williams wrote:

On Dec 13, 2010, at 4:49 PM, [email protected] wrote:

I'm pretty sure that rsyslog only looks up the hostname at startup time. are 
you seeing something in testing that indicates that it's looking up the 
hostname repeatedly?

If this is happening, it should be changed to only look it up once, just from a 
performance point of view, but I sure don't remember seeing anything like that 
in my performance tests.


No, it's a funny edge case on EC2 (and likely elsewhere) where the hostname is 
set by DHCP. If one reboots and rsyslog starts before the hostname has been set 
it caches the wrong one. My solution in the past (for other applications) has 
been to set the hostname statically in the configuration or as a command 
argument of the application. Ideally I would be able to override the hostname 
lookup in rsyslog with my own value, if it only gets set once I can't imagine 
the patch being too difficult. I'll take a look in the morning but if anyone 
has any pointers/suggestions please chime in.

-Joe



On Mon, 13 Dec 2010, Joe Williams wrote:

David,

Thanks but that won't work. I want to enforce the hostname that rsyslog is 
started with in case the hostname changes at some point.

-Joe



On Dec 13, 2010, at 1:20 PM, [email protected] wrote:

On Mon, 13 Dec 2010, Rainer Gerhards wrote:

Unfortunately, this is not possible...

however, what you can do is to change the template to put any string you want 
instead of %hostname%, that will have the same effect.

David Lang

Rainer

-----Original Message-----
From: [email protected] [mailto:rsyslog-
[email protected]] On Behalf Of Joe Williams
Sent: Monday, December 13, 2010 9:04 PM
To: rsyslog-users
Subject: [rsyslog] setting the hostname


List,

I would like to statically set the hostname (don't use the actual
hostname of the system) that rsyslogd uses for a node in the
configuration or as an argument to the rsyslogd command on that node. I
didn't immediately see a way to do this in the docs, is this possible?

Thanks.

-Joe



Name: Joseph A. Williams
Email: [email protected]
Blog: http://www.joeandmotorboat.com/
Twitter: http://twitter.com/williamsjoe

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

Name: Joseph A. Williams
Email: [email protected]
Blog: http://www.joeandmotorboat.com/
Twitter: http://twitter.com/williamsjoe

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

Name: Joseph A. Williams
Email: [email protected]
Blog: http://www.joeandmotorboat.com/
Twitter: http://twitter.com/williamsjoe

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

Reply via email to